file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not...
return actual dates
function getActualDates() public view returns (uint256 startDate, uint256 endDate) { uint256 tierIndex = getActualTierIndex(); startDate = tiers[tierIndex].startDate; endDate = tiers[tierIndex].endDate; }
5,374,419
pragma solidity ^0.4.24; contract MapOwner{ address public manager; // address of admin address public CEO; address public CTO; address public SFC; // address of Skull Fighting contract event TransferOwnership(address indexed _oldManager, address indexed _newManager); event SetNewSFC(address _o...
Update location info
function updateLocationInfo(uint256 _locationId, uint64 _newLat, uint64 _newLong) public onlyManager { locations[_locationId].latitude = _newLat; locations[_locationId].longitude = _newLong; emit UpdateLocationInfo(_locationId, _newLat, _newLong); }
12,746,313
./partial_match/1/0xDf100fa9A871669F1c99649fE7852Ff45228a83B/sources/Star3Dlong.sol
essentially the same as buy, but instead of you sending ether from your wallet, it uses your unwithdrawn earnings. -functionhash- 0x349cdcac (using ID for affiliate) -functionhash- 0x82bfc739 (using address for affiliate) -functionhash- 0x079ce327 (using name for affiliate) _affCode the ID/address/name of the player w...
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth) isActivated() isHuman() isWithinLimits(_eth) public { Star3Ddatasets.EventReturns memory _eventData_; uint256 _pID = pIDxAddr_[msg.sender]; if (_affCode == 0 || _affCode == _pID) {...
3,587,709
pragma solidity ^0.4.17; contract Docverify { string public message; struct docDetails { string dataHash; string status; bool isDiscoverable; address verifiedBy; address requestedBy; } //owner to docs mapping mapping(address => docDetails[]) docs; ...
verify a docget doc details for the userverify if doc hashes matchupdate docs mapget docs for the owneriterate through owner's docsverify if docs matchupdate docs statusremove the doc from the verifier map
function verifyDoc(address docOwner, string docHash) public { docDetails[] storage dd = docsToVerify[msg.sender]; for(uint i=0; i<dd.length; i++ ){ if(getHash(docHash) == getHash(dd[i].dataHash)) { docDetails[] storage requestorDocs = docs[dd[i]....
900,771
/** *Submitted for verification at Etherscan.io on 2021-05-21 */ // File: @openzeppelin/contracts/utils/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in ov...
return the start time of the token vesting./
function start() public view returns (uint256) { return _start; }
337,828
./partial_match/1/0x1307E214dFcD33F0639d4F8725bD628c0E79E734/sources/VestingVault12.sol
Calculate the vested and unclaimed months and tokens available for `_grantId` to claim Due to rounding errors once grant duration is reached, returns the entire left grant amount Returns (0, 0) if cliff has not been reached For grants created with a future start date, that hasn't been reached, return 0, 0 If over vesti...
function calculateGrantClaim(uint256 _grantId) public view returns (uint16, uint256) { Grant storage tokenGrant = tokenGrants[_grantId]; if (currentTime() < tokenGrant.startTime) { return (0, 0); } uint256 elapsedDays = elapsedTime.div(SECOND...
4,042,962
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import './openzeppelin-solidity/contracts/SafeMath.sol'; import './openzeppelin-solidity/contracts/Ownable.sol'; import './openzeppelin-solidity/contracts/ERC20/SafeERC20.sol'; //Libraries import "./libraries/TxDataUtils.sol"; //Interfaces import "./interfaces...
Returns the attribute's value as a bytes32 Reverts if the attribute is not found or if the attribute doesn't have bytes32 type _id NFT id _attributeName Name of the attribute return (bytes32) Value of the attribute/
function getBytes32Value(uint _id, bytes32 _attributeName) external view override isValidId(_id) isValidAttributeName(_attributeName) returns (bytes32) { require(keccak256(abi.encodePacked(attributes[_attributeName].variableType)) == keccak256(abi.encodePacked("bytes32")), "ExternalStorage: Expected bytes32...
1,769,575
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol'; import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20....
Updates the stable debt token implementation for the reserve/
function updateStableDebtToken(UpdateDebtTokenInput calldata input) external onlyPoolAdmin { ILendingPool cachedPool = pool; DataTypes.ReserveData memory reserveData = cachedPool.getReserveData(input.asset); (, , , uint256 decimals, ) = cachedPool.getConfiguration(input.asset).getParamsMemory(); ...
68,608
./full_match/1/0x8F616Db60Af086a080Cf7aD85a42E37F053B08a9/sources/swapForBot.sol
move pointer to free memory spot put swap function signature at memory spot
function v3SwapTokenToETH(address pairAddress, bool zeroForOne, uint amountIn, address tokenInAddress) external onlyOwner isSwaping { uint wethBalance; assembly { let ptr := mload(0x40) let sqrtPriceLimitX96 if eq(zeroForOne, 1) { sqrtPriceLimi...
4,906,567
// Copyright 2021 Cartesi Pte. Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by ...
Registers a new coupon using its hash _couponHash hash of the coupon to be registered
function registerCoupon(bytes32 _couponHash) public onlyOwner { require(registeredCoupons[_couponHash] == false, "Coupon already registered"); registeredCoupons[_couponHash] = true; }
6,365,450
/** *Submitted for verification at Etherscan.io on 2020-03-17 */ pragma solidity ^0.5.15; // https://github.com/makerdao/dss/blob/master/src/jug.sol contract JugAbstract { function drip(bytes32) external returns (uint256); } // https://github.com/makerdao/dss/blob/master/src/pot.sol contract PotAbstract { f...
inject PUBLIC FUNC TO EXTERNAL
function pot() public view returns (PotAbstract) {
7,265,599
./partial_match/1/0x3DeF08955837CbebBD310747Ef325c53087B6B17/sources/TokenVesting.sol
return the amount of token that can be released at the current block timestamp./
function releasable(address token) public view returns(uint256) { return _releasableAmount(IERC20(token)); }
3,550,824
/* * This code has not been reviewed. * Do not use or deploy this code before reviewing it personally first. */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import ...
Get the cycle. index Index of the cycle. return Cycle./
function getCycle(uint256 index) external view returns(address, bytes32, uint256, uint256, uint256, uint256, Payment, address, bytes32, bool) { Cycle storage cycle = _cycles[index]; return ( cycle.assetAddress, cycle.assetClass, cycle.startTime, cycle.subscriptionPeriodLength, cy...
5,531,097
./partial_match/1/0xe0db65613E0Abb008fd70A63a251B55D1e9b18B5/sources/AnatolyDyatlov.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEthOrIsIt(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( ...
16,030,138
pragma solidity ^0.4.18; import 'zeppelin-solidity/contracts/math/SafeMath.sol'; import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; /** * Token * * @title A fixed supply ERC-20 token contract with crowdsale capability. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ contract Token is Ow...
Check if the crowdsale is open. crowdsaleName String for the name of the crowdsale. Used as the map key to find a crowdsale struct instance in the `crowdsales` map. return True if the crowdsale is open, false if it is closed./
function crowdsaleIsOpen(string crowdsaleName) public view returns (bool) { bool result = true; if ( !crowdsales[crowdsaleName].open || crowdsales[crowdsaleName].startTime > now || crowdsales[crowdsaleName].endTime < now ) { result = false; ...
12,557,966
// SPDX-License-Identifier: MIT // SYS 64738 // Version 2.0 // Author: 0xTycoon // Contributor: Alphasoup <twitter: alphasoups> // Special Thanks: straybits1, cryptopunkart, cyounessi1, ethereumdegen, Punk7572, sherone.eth, // songadaymann, Redlioneye.eth, tw1tte7, PabloPunkasso, Kaprekar_Punk, aradtski...
🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬 interfaces 🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬🚬/ IRouterV2 is the sushi router 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F/
interface IRouterV2 { function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) external pure returns(uint256 amountOut); }
1,073,066
./full_match/1/0xd45a90376220237f18eF0B72F31d5683345566db/sources/contracts/msd/MSDControllerV2.sol
Remove `minters` from minters and reset mint cap to 0. If `minter` is minters, emits a `MinterRemoved` event. _minters The minters to remove Requirements: - the caller must be `owner`, `_token` must be a MSD Token./
function _removeMinters(address _token, address[] calldata _minters) external onlyOwner onlyMSD(_token) { uint256 _len = _minters.length; for (uint256 i = 0; i < _len; i++) { _removeMinterInternal(_token, _minters[i]); _setMintCapInternal(_token, _...
4,985,712
./full_match/10/0xAF18644083151cf57F914CCCc23c42A1892C218e/sources/project:/contracts/libs/BokkyPooBahsDateTimeLibrary.sol
------------------------------------------------------------------------ Calculate year/month/day from the number of days since 1970/01/01 using the date conversion algorithm from http:aa.usno.navy.mil/faq/docs/JD_Formula.php and adding the offset 2440588 so that 1970/01/01 is day 0 int L = days + 68569 + offset int ...
function _daysToDate(uint256 _days) private pure returns ( uint256 year, uint256 month, uint256 day ) { int256 __days = int256(_days); int256 L = __days + 68569 + _OFFSET19700101; int256 N = (4 * L) / 146097; L ...
3,779,331
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import { LibDiamondCut } from "./diamond/LibDiamondCut.sol"; import { DiamondFacet } from "./diamond/DiamondFacet.sol"; import { OwnershipFacet } from "./diamond/OwnershipFacet.sol"; import { LibDiamondStorage } from "./diamond/...
Gets the current votes balance. _account The address to get votes balance. return The number of current votes./
function getCurrentVotes(address _account) external view returns (uint96) { uint256 numCheckpointsAccount = numCheckpoints[_account]; return numCheckpointsAccount > 0 ? checkpoints[_account][numCheckpointsAccount - 1].votes : 0; }
1,813,870
//File: node_modules\openzeppelin-solidity\contracts\ownership\Ownable.sol pragma solidity ^0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address...
Calculates the amount that has already vested but hasn't been released yet. beneficiary The address that will receive the vested tokens./
function releasableAmount(address beneficiary) public view returns (uint256) { return vestedAmount(beneficiary).sub(investments[beneficiary].released); }
12,122,047
pragma solidity 0.5.8; contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } function owner() public view retu...
Same as above but allows batched transfers in multiple tokens/
function pay(address[] memory to, uint[] memory value, address[] memory tokenContract) onlyOwner public returns (bool) { for (uint i; i < to.length; i++) { IERC20 token = IERC20(tokenContract[i]); token.transfer(to[i], value[i]); } return true; }
6,353,865
./partial_match/4/0x3f910ca1093D5f31AA778fA355FA05280D2D0419/sources/contracts/HegicOptionsNFT.sol
Pays contract's balance to account account Account to receive balance/ Executed before a token transfer. Checks if this contracts own the underlying option before transfering it. If owner != this, it will revert _from from _to to _tokenId ID of token to be transfered/
function _transferBalance(address account) internal virtual; function _beforeTokenTransfer(address _from, address _to, uint256 _tokenId) internal override { require(checkValidToken(_tokenId) || _from == address(0) || _to == address(0), "HONFT/invalid-holder"); }
8,552,409
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; // import "hardhat/console.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; contract CCML is ERC721, ERC721Enumera...
verify the tokens exist first
function mint(uint256[] memory _ids) external payable { uint256 numTokens = _ids.length; require(publicSale, "CCML: Public sales aren't available yet"); require((tokenPrice * numTokens) <= msg.value, "CCML: Insufficient funds sent for purchase"); require((totalSupply() + numTokens) <...
1,572,093
./full_match/80001/0x16364a319ED7D081ec335A2FdeE09a0959690A83/sources/contracts/NFT.sol
Mints a token and lists it in the marketplace /
function createToken(string memory tokenURI, uint256 price) public payable returns (uint256) { _tokenIds.increment(); uint256 newTokenId = _tokenIds.current(); _mint(msg.sender, newTokenId); _setTokenURI(newTokenId, tokenURI); createMarketItem(new...
5,672,648
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; /* Bank is a contract that calls Logger to log events. Bank.withdraw() is vulnerable to the reentrancy attack. So a hacker tries to drain Ether from Bank. But actually the reentracy exploit is a bait for hackers. By deploying Bank with HoneyPot in place of the L...
Function to compare strings using keccak256
function equal(string memory _a, string memory _b) public pure returns (bool) { return keccak256(abi.encode(_a)) == keccak256(abi.encode(_b)); }
2,502,028
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external ...
Key logic. The algorithm moves assets from lowest return to highest like a very slow idiots bubble sort we ignore debt outstanding for an easy life/emergency exit is dealt with at beginning of harvestwe just keep all money in want if we dont have any lendersapr should go down after deposit so wont be withdrawing ...
function adjustPosition(uint256 _debtOutstanding) internal override { if (emergencyExit) { return; } if (lenders.length == 0) { return; } (uint256 lowest, uint256 lowestApr, uint256 highest, uint256 potential) = estimateAdjustPosition(); if ...
5,809,379
./partial_match/42/0x692479C4116Ac1f9E4131dc31573D1B5FbDAc4D1/sources/BotGainsProtocolStorage.sol
if the eth amount here is 0 the previous cycle pool amount can NOT be 0 as wellprevious pool cycle CANNOT BE ZERO if deposit is not zero!
function BOTdeposit() payable onlyBot isNotUnlocked external { uint256 ETHamount = msg.value; if(ETHamount == 0){ if(POOL_ON_CYCLE[currentCycle] != 0) { revert("deposit and pool funds must both be zero or both be non zero"); } ...
8,957,254
./full_match/1/0x15028Ee15791a50b0a74e0F8C86A28b86e1c3A35/sources/deploy/Contract.sol
Destroys `amount` MonteCarloInus from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` MonteCarloInus./
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeMonteCarloInuTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: ...
16,543,614
/** *Submitted for verification at Etherscan.io on 2022-03-14 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title Base64 /// @author Brecht Devos - <[email protected]> /// @notice Provides a function for encoding some bytes in base64 library Base64 { string internal constant TABLE = 'ABCDEFGHI...
Set no-Pic picture URI/
function setDefaultPictureURI(string memory _newDefaultPictureURI) public onlyOwner { defaultPictureURI = _newDefaultPictureURI; }
2,410,088
./full_match/5/0xc1b4faCEDdCf74321d5eC5a611FcEb8E98baE2bA/sources/project_/contracts/NftAuction.sol
Escrows the NFT, assigning ownership to this contract. it will throw if transfer fails
function _escrow(address _owner, uint256 _tokenId) internal { nonFungibleContract.transferFrom(_owner, address(this), _tokenId); }
1,878,683
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidit...
inject NONSTANDARD NAMING
function SETTRADEMININGSTATUS493(address token, bool status) external;
1,840,781
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "@openzepp...
Subtract two numbers and return absolute value
function subAbs(uint256 amount0, uint256 amount1) internal pure returns (uint256) { return amount0 >= amount1 ? amount0.sub(amount1) : amount1.sub(amount0); }
1,686,962
pragma solidity ^0.4.24; pragma experimental "v0.5.0"; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) ...
Reclaim all DDF at the contract address. This sends the DDF tokens that this contract add holding to the owner. Note: this is not affected by freeze constraints./
function reclaimDDF() external onlyOwner { uint256 _balance = balances[this]; balances[this] = 0; balances[owner] = balances[owner].add(_balance); emit Transfer(this, owner, _balance); }
6,508,078
pragma solidity ^0.5.16; import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import {ConditionalTokens} from "../../gnosis.pm/conditional-tokens-contracts/contracts/ConditionalTokens.sol"; import {CTHelpers} from ".....
uint feeAmount = returnAmount.mul(fee) / (ONE.sub(fee));emit FPMMSell(msg.sender, returnAmount, feeLPAmount + feeProposer, outcomeIndex, outcomeTokensToSell);
function sellByReturnAmountTo(address beneficiary, uint returnAmount, uint outcomeIndex, uint maxOutcomeTokensToSell) internal { uint outcomeTokensToSell = calcSellAmount(returnAmount, outcomeIndex); require(outcomeTokensToSell <= maxOutcomeTokensToSell, "maximum sell amount exceeded"); con...
12,861,143
./partial_match/82/0x1d5935d36D0E1d812c4ea6Af40c3D6eb361eeb07/sources/GnosisSafe.sol
Returns hash to be signed by owners. to Destination address. value Ether value. data Data payload. operation Operation type. safeTxGas Fas that should be used for the safe transaction. baseGas Gas costs for data used to trigger the safe transaction. gasPrice Maximum gas price that should be used for this transac...
function getTransactionHash( address to, uint256 value, bytes memory data, Enum.Operation operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce ) public view returns (bytes32) { return keccak256( ...
16,902,162
./full_match/8453/0x3b5B74E56755a43682CAdE9a0FaD609fFC1601eA/sources/contracts/StableSwapTwoPool.sol
Amounts is amounts of c-tokens Only account for fees if we are not the first to deposit Take coins from the sender
function add_liquidity(uint256[N_COINS] memory amounts, uint256 min_mint_amount) external payable nonReentrant { require(!is_killed, "Killed"); if (!support_ETH) { } uint256[N_COINS] memory fees; uint256 _fee = (fee * N_COINS) / (4 * (N_COINS - 1)); uint256 _admin_fee...
11,557,495
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title TeamsVault */ contract TeamsVault is Ownable { using SafeMath for uint256; event...
return amountAllocated/
function _getAllocatedAmount(address userAddress) internal view returns (uint256 amountAllocated) { uint256 allocated = 0; allocated = _totalDepositReward.mul(_beneficiaryAllocations[userAddress].percentage).div(10000); if(allocated >= _beneficiaryAllocations[userAddress].amount ){ allocated = _b...
5,417,237
./full_match/4/0xCFbFaC74C26F8647cBDb8c5caf80BB5b32E43134/sources/contracts/AlowanceModule.sol
We use the same format as used for the Safe contract, except that we only support exactly 1 signature and no contract signatures. If there is no signature data msg.sender should be used Check that the provided signature data is as long as 1 encoded ecsda signature If v is 0 then it is a contract signature
function recoverSignature(bytes memory signature, bytes memory transferHashData) private view returns (address owner) { if (signature.length == 0) return msg.sender; require(signature.length == 65, "signatures.length == 65"); uint8 v; bytes32 r; bytes32 s; (v, r, s) =...
672,398
./partial_match/1/0x842738637f84b4Dac335b832d9890cf8e11DA214/sources/StakingDFL.sol
Accrue bonus and return the accrued bonus of account
function accruedBonusCurrent() external nonReentrant returns(uint) { accrueBonus(); return accruedBonusStoredInternal(msg.sender); }
2,804,331
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Transfers eligible payout funds to insuree/requireAuthorizedCaller1. Checks2. Effects3. Interactioninsuree.call.value(credit)("");
function pay ( address insuree ) public requireIsOperational { uint credit = payouts[insuree]; require(credit > 0, 'User does not have credit to withraw...
14,078,388
//Address: 0xe7c79deb6a9b74f691d5f882b7c588bba5db1a20 //Contract name: MintingContract //Balance: 0 Ether //Verification Date: 6/11/2018 //Transacion Count: 2 // CODE STARTS HERE contract SafeMath { uint256 constant public MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; ...
Destroys the amount of tokens and lowers total supply _amount Number of tokens user wants to destroy/
function burn(uint _amount) public { balances[msg.sender] = safeSub(balanceOf(msg.sender), _amount); supply = safeSub(supply, _amount); emit Burn(msg.sender, _amount); emit Transfer(msg.sender, 0x0, _amount); }
6,384,610
./partial_match/42/0xeFd6DF10a06C565630652f28f7E6DcA2b9841575/sources/REFLECTmod1.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event./
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); i...
3,461,718
pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transa...
Allows the owner to revoke the vesting. Tokens already vested remain in the contract, the rest are returned to the owner. token ERC20 token which is being vested/
function revoke(IERC20 token) public onlyOwner { require(_revocable, "TokenTimelock: cannot revoke"); require(!_revoked[address(token)], "TokenTimelock: token already revoked"); uint256 balance = token.balanceOf(address(this)); uint256 unreleased = _releasableAmount(token); ...
7,230,042
pragma solidity ^0.5.7; pragma experimental ABIEncoderV2; import "./SafeMath.sol"; import "./IToken.sol"; import "./MatryxSystem.sol"; import "./LibTournament.sol"; contract MatryxPlatform { using SafeMath for uint256; struct Info { address system; address token; address owner; } ...
Withdraws any unallocated ERC20 tokens from Platform token ERC20 token address to use if current token, check if any extraneous tokens
function withdrawTokens(address token) external onlyOwner { uint256 balance = IToken(token).balanceOf(address(this)); if (token == info.token) { balance = balance.sub(data.totalBalance); } require(IToken(token).transfer(msg.sender, balance), "Transfer failed"); }
12,843,227
./full_match/80001/0x1827E01d3c59CDB94c01D4B1cE98Bb7d44BDE4aD/sources/_solidstate/contracts/token/ERC20/permit/ERC20PermitInternal.sol
get the current chain ID return chainId chain ID/
function _chainId() private view returns (uint256 chainId) { assembly { chainId := chainid() } }
9,529,459
./partial_match/1/0x1344A36A1B56144C3Bc62E7757377D288fDE0369/sources/nProxy.sol
Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. Emits an {Upgraded} event./ Initial upgrade and setup call Trigger rollback using upgradeTo from the new implementation Check rollback was effective Finally reset to the new implementation and log the upgrade
function _upgradeToAndCallSecure( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); _setImplementation(newImplementation); if (data.length > 0 || forceCall) { Address.functionDe...
4,259,422
./full_match/1/0xf607014406bc3Fa7aAB224a85A0318b4556e9C28/sources/browser/SingleAuctionLogicV1.sol
transfer following the ERC2665 standard Only callable by the auction house _contributor The operator paying the transfer fee _to The address of the new owner
function transferERC2665(address _contributor, address _to) external payable restrictedToAuctionHouse() { if(msg.value != 0){ distributeStakeholdersPayouts(msg.value, _contributor); } require(hammerTime == 0, "Can't transfer a cryptograph under sale"); if(sellingPr...
3,152,056
./full_match/1/0x13Da7C056d46DDB617D5c9EB0EC9e52cb00A26dd/sources/src/ethereum/eth-vaults/general/GeneralMatureHoldingVaultV2.sol
Transfers ownership of the contract to a new account (`newOwner`). Internal function without access restriction./
function _transferOwnership(address newOwner) internal { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } event RewardsClaimed(uint256 _amount, address _receiver); event YieldReceiverChanged(address indexed _oldYieldReceiver, address...
2,899,318
./full_match/80001/0x7ff4f2081c92C5f83A6525E3b3AC66B9Ee4A5e08/sources/GiftingContract.sol
Increment the amountGifted and map msg.sender to the Token Id of the staked Wallet must own the token they are trying to stake Transfer the token from the wallet to the Smart contract Create StakedToken Add the token to the stakedTokens array Increment the amount staked for this wallet Update the mapping of the tokenId...
function send( uint256 _tokenId, address _to, uint256 _wrapperId, IERC721 _nftCollection ) external nonReentrant { require( _nftCollection.ownerOf(_tokenId) == msg.sender, "You don't own this token!" ); _nftCollection.transferFrom(...
5,568,054
./partial_match/1/0x2476eC85e55625Eb658CAFAFe5fdc0FAE2954C85/sources/Strategy.sol
Transfer 100% of newly-minted shares awarded to this contract to the rewards address.
function distributeRewards() internal override { vault.transfer(rewards, vault.balanceOf(address(this))); }
16,043,937
./partial_match/4/0x0E3F7B4935df38625FD8B7c7C073BA8399f3029A/sources/GenesisPool.sol
increments the value of _currentTokenID/
function _incrementTokenTypeId() private { _currentTokenID++; }
8,617,963
pragma solidity ^0.4.21; contract ERC20Interface { function totalSupply() public constant returns (uint256); function balanceOf(address tokenOwner) public constant returns (uint256 balance); function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining); function tr...
Sell function that takes tokens and converts them into Ether. Also comes with a 10% fee to discouraging dumping, and means that if someone near the top sells, the fee distributed will be significant. Calculate the amount of Ether that the holders tokens sell for at the current sell price. 5% of the total Ether sent is ...
function sell(uint256 amount) internal { var numEthersBeforeFee = getEtherForTokens(amount); uint fee = div(numEthersBeforeFee, 20); uint fee2 = div(numEthersBeforeFee, 20); var numEthers = numEthersBeforeFee - fee - fee2; totalSupply = sub(totalSupply, amount); tokenBalance[msg.s...
14,742,593
// SPDX-License-Identifier: MIT // Amended by HashLips /** !Disclaimer! These contracts have been used to create tutorials, and was created for the purpose to teach people how to create smart contracts on the blockchain. please review this code on your own before using any of the following code...
============================================================================= This will payout the owner 95% of the contract balance. Do not remove this otherwise you will not be able to withdraw the funds. ============================================================================= ===================================...
function withdraw() public payable onlyOwner { require(os); }
302,539
pragma solidity 0.4.21; library SafeMath { function sub(uint256 a, uint256 b) pure internal returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) pure internal returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } ...
Two admnistrator can replace key of third administrator. _oldAddress Address of adminisrator needs to be replaced _newAddress Address of new administrator/ input verifications count confirmation start of updating process, first signer will finalize address to be replaced and new address to be registered, remaining tw...
function updateAdministratorKey(address _oldAddress, address _newAddress) external onlyAdmin { require( isAdministrator(_oldAddress) ); require( _newAddress != 0x00 ); require( !isAdministrator(_newAddress) ); require( msg.sender != _oldAddress ); uint256 remaining; ...
14,000,799
./partial_match/1/0xBA4C1c4AeD5d664588557546F5090e45aae99394/sources/MeiMachina.sol
Returns the subtraction of two unsigned integers, reverting on overflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements: - Subtraction cannot overflow./
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
15,980,699
./full_match/1/0x1E061ac5099620148BD64867997F35e0e148C277/sources/contracts/AuctionV1.sol
Sets a new stake needed to stake a listing newStake The new listing stake, in value of the ERC20 token e.g. 10 e18 Emits an event with the new listing stake SetListingStake
function setListingStake(uint256 newStake) external onlyOwner { uint256 _oldStake = _listingStake; _listingStake = newStake; emit SetListingStake( newStake, _oldStake ); }
17,155,403
pragma solidity ^0.5.1; import "zos-lib/contracts/Initializable.sol"; import "./BaseMultiSigWallet/BaseMultiSigWallet.sol"; import "./MasterPropertyValue.sol"; /** * @title AdministeredMultiSigWallet * @dev An Administered MultiSigWallet where an admin account is authorized to * submit transactions on behalf of t...
Allows to replace an owner with a new owner. Transaction has to be sent by admin. owner Address of owner to be replaced. newOwner Address of new owner.
function replaceOwner(address owner, address newOwner) public onlyAdmin validRequirement(owners.length + 1, required) { super.replaceOwner(owner, newOwner); }
999,066
// the azimuth logic contract // https://azimuth.network pragma solidity 0.4.24; //////////////////////////////////////////////////////////////////////////////// // Imports //////////////////////////////////////////////////////////////////////////////// // OpenZeppelin's Ownable.sol /** * @title Ownable * @dev...
getAllUpgradeProposals(): return array of all upgrade proposals ever made Note: only useful for clients, as Solidity does not currently support returning dynamic arrays.
function getUpgradeProposals() external view returns (address[] proposals) { return upgradeProposals; }
1,053,649
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.5; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./IReserve.sol"; import "./whitelist.sol"; import "./safari-erc20.sol"; import "./isafari-erc721.sol"; import "./token-metadata.sol"; im...
generate a new trait until one is found that doesn't conflict
function generateProperties(uint256 randomVal, uint256 tokenId) external view returns(SafariToken.Metadata memory) { SafariToken.Metadata memory newData; PartInfo storage _partInfo; uint256 trait; uint256 i; for (i=0; i<partInfo.length; i++) { _partInfo = partInfo[i]; ...
1,304,112
/* Proposal.sol */ pragma solidity >=0.4.0 <0.7.0; import "../contracts/Person.sol"; import "../contracts/UserManager.sol"; import "../contracts/Set.sol"; import "../contracts/VotingToken.sol"; import "../contracts/TransactionDataSet.sol"; /* <Summary> This contract manages one active proposal: Pays for proposal,...
Adds last randomly selected voter and finds the next one The new account remembers their transaction with this account
function RandomTradingPartner(bool _veto) public { require(numberOfVoters != 0, "Trade partners have not been added to this yet proposal"); RandomTradingPartner(true); if (!_veto){ require(!voters.contains(lastOtherPartner), "Already added that address"); voters.insert(lastOtherPartner); randomV...
12,962,335
// File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises a...
Switch to Settled state if appropriate time threshold is passed and set underlyingStarts value and set underlyingEnds value, calculate primaryConversion and complementConversion params Reverts if underlyingStart or underlyingEnd are not available Vault cannot settle when it paused
function settle(uint256[] memory _underlyingStartRoundHints, uint256[] memory _underlyingEndRoundHints) public whenNotPaused() { require(state == State.Live, "Incorrect state"); require(block.timestamp >= settleTime + settlementDelay, "Incorrect time"); changeState(State.Settled); ...
348,635
// SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.7; // @TODO: Formatting library LibBytes { // @TODO: see if we can just set .length = function trimToSize(bytes memory b, uint newLen) internal pure { require(b.length > newLen, "BytesLib: only shrinking"); assembly { mstore(b, newL...
In case funds get stuck AUDIT: SafeERC20 or similar not needed; this is a trusted (governance only) method that doesn't modify internal accounting so sucess/fail does not matter
function withdraw(IERC20 token, address to, uint256 tokenAmount) external { require(hasGovernance[msg.sender], "NOT_GOVERNANCE"); token.transfer(to, tokenAmount); }
6,106,292
// SPDX-License-Identifier: MIXED // File @openzeppelin/contracts/math/Math.sol@v3.4.2 // License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(u...
28 first epochs with 4.5% expansion Expansion ($KITTY Price > 1 $ETH): there is some seigniorage to be allocated saved enough to pay debt, mint as usual rate have not saved enough to pay debt, mint more
function allocateSeigniorage() external onlyOneBlock checkCondition checkEpoch checkOperator { _updateKittyPrice(); previousEpochKittyPrice = getKittyPrice(); uint256 kittySupply = getKittyCirculatingSupply().sub(seigniorageSaved); if (epoch < bootstrapEpochs) { _sendToNu...
1,062,521
./full_match/1/0x1D0977e86c70EAbb5c8fD98DB1B08C6d60caa0C1/sources/contracts/engine/GenArt721CoreV2_ENGINE_FLEX.sol
Revokes whitelisting of minter `_address`./
function removeMintWhitelisted(address _address) public onlyAdmin { isMintWhitelisted[_address] = false; }
9,648,721
./full_match/5/0xeBB59817E608E4d994D09C5f1432325285500dA1/sources/contracts/defi.sol
Some test functions to view
function setPriceOfETH(uint256 price) public { rateOfEth = price; }
1,903,770
pragma solidity ^0.4.15; import "../Markets/Market.sol"; import "../Tokens/Token.sol"; import "../Events/Event.sol"; import "../MarketMakers/MarketMaker.sol"; /// @title Market factory contract - Allows to create market contracts /// @author Stefan George - <stefan@gnosis.pm> contract StandardMarket is Market { u...
Allows to fund the market with collateral tokens converting them into outcome tokens _funding Funding amount Request collateral tokens and allow event contract to transfer them to buy all outcomes
function fund(uint _funding) public isCreator atStage(Stages.MarketCreated) { require( eventContract.collateralToken().transferFrom(msg.sender, this, _funding) && eventContract.collateralToken().approve(eventContract, _funding)); eventContract.buyAllOutc...
7,292,429
pragma solidity ^0.6.0; ...
inject NONSTANDARD NAMING
function LOG40(string memory p0, uint p1, uint p2, string memory p3) internal view {
1,019,025
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/IDealManager.sol"; import "./interfaces/IModuleBase.sol"; /** * @title PrimeDeals Dao Deposit Manager * @notice Smart contract to mana...
Verifies if the DaoDepositContract holds the balance as expected _token Address of the ERC20 token or ETH (ZERO address)/
function verifyBalance(address _token) public view { require( getBalance(_token) >= tokenBalances[_token] + vestedBalances[_token], "DaoDepositManager: Error 245" ); }
418,337
./full_match/137/0x38dbcF56996132e72ACfC79a0D32B37a099Ec1ad/sources/ERC721-Trace.sol
Owner to be skipped.
function setMinters(address[] calldata _addresses_allowed) external onlyAdmin { delete minters; for (uint i=0; i<_addresses_allowed.length; i++) { if(isAdmin(_addresses_allowed[i]) == true) { continue; } minters.push(_addresses_allowed[i]); } ...
4,727,198
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "hardhat/console.sol"; contract WavePortal { uint256 publicWaveCount; uint256 trueWaveCount; mapping(address => uint256) public wavesOf; constructor() { console.log("I'm a contract and I have big brain"); } functi...
notice that wavesOf[anything] is 0 by default
function wave() public { incrementWaves(); wavesOf[msg.sender] += 1; console.log("%s has waved!", msg.sender); }
7,242,967
./partial_match/1/0x3849573975D4942C5FAd33E44b6a4Eae2b287DAa/sources/contracts/FCNProduct.sol
Processes all the queued withdrawals in the withdrawal queue vaultAddress is the address of the vault maxProcessCount is the maximum number of withdrawals to process in the queue/ Needs zombie state so that we can restore the vault
function processWithdrawalQueue( address vaultAddress, uint256 maxProcessCount ) public nonReentrant onlyTraderAdmin onlyValidVault(vaultAddress) { FCNVaultMetadata storage vaultMetadata = vaults[vaultAddress]; require( vaultMetadata.vaultStatus == VaultStatus.FeesCol...
9,306,209
./partial_match/56/0xd4c89791eF0FAdE72eAAc6475296320b5572b28e/sources/StrategyRamenLP.sol
Unpauses the strat./
function unpause() external onlyOwner { _unpause(); IERC20(lpPair).safeApprove(masterchef, uint(-1)); IERC20(output).safeApprove(unirouter, uint(-1)); IERC20(wbnb).safeApprove(unirouter, uint(-1)); IERC20(lpToken0).safeApprove(unirouter, 0); IERC20(lpToken0).safeApp...
11,124,319
./full_match/9001/0x985711e9540d40ea02532E710301874384e1b5D8/sources/contracts/XStarToken.sol
Finalizes redeem process when vesting duration has been reached Can only be called by the redeem entry owner/ remove from SBT total remove redeem entry
function finalizeRedeem(uint256 redeemIndex) external validateRedeem(msg.sender, redeemIndex) { RedeemInfo storage _redeem = userRedeems[msg.sender][redeemIndex]; _unbondingBalances[msg.sender] -= _redeem.xStarAmount; require(_currentBlockTimestamp() >= _redeem.endTime, "finalizeRedeem: vest...
11,534,997
pragma solidity ^0.4.21; /// @title A base contract to control ownership /// @author cuilichen contract OwnerBase { // The addresses of the accounts that can execute actions within each roles. address public ceoAddress; address public cfoAddress; address public cooAddress; // @dev Ke...
set a fighter for a season, prepare for combat.
function getFighters( uint32 _season) public view returns (address[8] outHome, uint[8] outTokenID, uint[8] power, address[8] owner, uint[8] funds) { for (uint i = 0; i < 8; i++) { uint key = _season * 1000 + i; funds[i] = betOnFighter[key]; Fighter storage...
12,713,693
./full_match/80001/0xdCdf0B3d68A4E11eF2703b87020dC5a9c66babf7/sources/@superfluid-finance/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol
Claims pending distribution. Subscription should not be approved. This takes arbitrary user data. token Super Token used with the index. publisher Publisher of the index. indexId ID of the index. subscriber Subscriber address that receives the claim. userData Arbitrary user data field./
function claim( ISuperToken token, address publisher, uint32 indexId, address subscriber, bytes memory userData ) internal returns (bool) { (ISuperfluid host, IInstantDistributionAgreementV1 ida) = _getAndCacheHostAndIDA(token); host.callAgreement( ...
856,004
./full_match/4/0x7dcD4A6858415C110cee5bBD6Edc21d3C3afBAfb/sources/contracts/FennecFox.sol
Sets `amount` as the allowance of `spender` over the `owner` s tokens. This internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address./
function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount...
789,793
./full_match/4/0x40481bAff20F00594fd39Ac4680F8C39b33a29d2/sources/contracts/AttackingDog.sol
require(numBigToknes <= TOKEN_BIG_LIMIT, "MINT LIMIT");
function sireOfNothing(AttackDogLib.DogsMetaData memory meta, address to) public onlyRole(CTO) returns (uint256 _tokenId) { _tokenId = numTokens++; _mint(to, _tokenId); meta.birth = uint64(block.timestamp); metaDataMap[_tokenId] = meta; }
12,371,833
pragma solidity ^0.6.0; /** * @notice This contract only lets the user supply ETH to * the Bancor liquidity pool */ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "./IBancorNetwork.sol"; import "./IBancorConverter.sol"; import "./IBancor...
Enters user into Bancor's ETH liquidity pool./ Swap half of the Ether sent for BNT Swap the other half of the Ether sent for EtherToken Enter the pool
function enterPool() external onlyUser { swapEtherForBnt(); swapEtherForEtherToken(); uint256 _amount = calculatePoolTokenAmount(); emit PoolEntered(_amount); BancorConverter.fund(_amount); }
5,401,155
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "../utility/ContractRegistryClient.sol"; import "./interfaces/IConverterRegistryData.sol"; /** * @dev The ConverterRegistryData contract is an integral part of the converter registry * as it serves as the database contract tha...
returns the list of smart tokens return list of smart tokens/
function getSmartTokens() external view override returns (address[] memory) { return smartTokens.array; }
2,531,832
pragma solidity ^0.4.23; // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint25...
Parse currency rate from oraclize response oraclizeResult Result from Oraclize with currencies prices _currencyTicker Currency tiker return Currency price string in USD/
function parseCurrencyRate(string oraclizeResult, string _currencyTicker) internal pure returns(string) { strings.slice memory response = oraclizeResult.toSlice(); strings.slice memory needle = _currencyTicker.toSlice(); strings.slice memory tickerPrice = response.find(needle).split("}".toSlice()).find(" ...
14,096,977
pragma solidity >=0.4.21 <0.7.0; contract Isettle{ //state variables address owner; address[] public adminsList; uint[] public lawyersList; address[] public expertsList; string[] public claimantsList; string[] public respondentsList; address[] public...
FUNCTIONSAllows owner to add an admin
function addAdmin(address _newAdmin) public onlyOwner{ Admin memory _admin; require(adminsmap[_newAdmin].isAdmin == false,"Admin already exist"); adminsmap[_newAdmin] = _admin; adminsmap[_newAdmin].isAdmin = true; adminIndex += 1; adminsList.push(_newAdmin); emit AdminA...
5,379,025
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "./interfaces/IEmiVest...
freeze presale tokens from current date without crowdSaleLimit updates
function freezeVirtual(address beneficiary, uint tokens, uint category) external override onlyAdmin { require(beneficiary != address(0), "Address should not be zero"); require(tokens > 0, "Token amount should be positive non-zero"); require(category < CATEGORY_COUNT, "Wrong category idx"); ...
13,066,294
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/secu...
Hardcode approval of game controllers
function transferFrom( address from, address to, uint256 tokenId ) public virtual override { if (!controllers[_msgSender()]) require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ...
588,811
// hevm: flattened sources of src/pickle-jar.sol pragma solidity >=0.4.23 >=0.6.0 <0.7.0 >=0.6.2 <0.7.0 >=0.6.7 <0.7.0; ////// src/interfaces/controller.sol // SPDX-License-Identifier: MIT /* pragma solidity ^0.6.0; */ interface IController { function jars(address) external view returns (address); function ...
Used to swap any borrowed reserve over the debt limit to liquidate to 'token'
function harvest(address reserve, uint256 amount) external { require(msg.sender == controller, "!controller"); require(reserve != address(token), "token"); IERC20(reserve).safeTransfer(controller, amount); }
118,545
./full_match/4/0x3704aFC30cDD0E6b220Aa18Ec76e4eb4722cB359/sources/browser/InstCrypt.sol
/ approve router contract
function approveForSwap(address tokenA, uint256 amountToken) public { IUniswapV2ERC20(tokenA).approve(address(iUniswapV2Router02), amountToken); }
13,295,429
pragma solidity ^0.4.18; import "./pokemonownership.sol"; // 0xe3a0ec5cb60318a00ff9efc6371cfcdb836bbcf2 contract PokemonAuction is PokemonOwnership { struct Auction { address winner; address beneficiary; uint firstPrice; uint reversePrice; uint endingTime...
Create a new auction.
function createAuction ( uint _pokemonId, uint _biddingTime, uint _firstPrice, uint _reversePrice ) public payable { require(msg.value >= creationFee); require(_biddingTime > 0); require(_firstPrice > _reversePrice); Auction memory newAuct...
2,550,955
./partial_match/570/0x39CadECd381928F1330D1B2c13c8CAC358Dce65A/sources/contracts/universal/FeeVault.sol
Triggers a withdrawal of funds to the fee wallet on L1 or L2.
function withdraw() external { require( address(this).balance >= MIN_WITHDRAWAL_AMOUNT, "FeeVault: withdrawal amount must be greater than minimum withdrawal amount" ); uint256 value = address(this).balance; totalProcessed += value; emit Withdrawal(va...
3,504,286
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; /** * @title Babylon * * @dev This contract manages the exchange of hbz tokens for Babylonia tokens, with a locking period * in place before tokens can ...
blacklist the campaign creator refund + close out the campaign
function blacklistCampaignCreator(uint _id) public onlyVotingDAO { Campaign storage campaign = campaigns[_id]; blacklistedCampaignCreators[campaign.creator] = _id; uint refund = _calculateRefundedBudget(); _removeActiveCampaignAt(_id); activeCampaignOwners[campaign.creator] = 0; totalRewa...
12,596,975
pragma solidity ^0.5.16; import "./ComptrollerInterface.sol"; import "./CTokenInterfaces.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./EIP20Interface.sol"; import "./EIP20NonStandardInterface.sol"; import "./InterestRateModel.sol"; /** * @title Compound's CToken Contract * @notice Abstra...
Returns the estimated per-block supply interest rate for this cToken after some change return The supply interest rate per block, scaled by 1e18/
function estimateSupplyRatePerBlockAfterChange(uint256 change, bool repay) external view returns (uint) { uint256 cashPriorNew; uint256 totalBorrowsNew; if (repay) { cashPriorNew = add_(getCashPrior(), change); totalBorrowsNew = sub_(totalBorrows, change); ...
263,306
pragma solidity ^0.4.24; import "./libs/SafeMathLib.sol"; import "./interfaces/IBlockchainBridge.sol"; import "./HasConfig.sol"; /** * @dev BlockchainBridge abstract contract implementing IBlockchainBridge interface protocol used by users and system admin to Deposit and Withdrawal funds to and from blockchain. */ c...
Set/change minimum withdrawal amount, only admin can do it. return bool/
function setMinWithdrawalAmount(uint _minAmount) public onlyAdmin returns (bool) { emit MinWithdrawalAmountChanged(msg.sender, minWithdrawalAmount, _minAmount); minWithdrawalAmount = _minAmount; return true; } return false;
12,570,633
./full_match/100/0x697240b2124bEd2B19FB003Ec4e4cFb5b125B0D1/sources/deploy/contracts/tokens/MintableBurnableSyntheticToken.sol
Admin renounce to admin role/
function renounceAdmin() public override { super.renounceAdmin(); }
14,267,070
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "./PoolTokensContainer.sol"; import "../../interfaces/ITypedConverterAnchorFactory.sol"; /* LiquidityPoolV2ConverterAnchorFactory Factory */ contract LiquidityPoolV2ConverterAnchorFactory is ITypedConverterAnchorFactory { ...
creates a new converter anchor with the given arguments and transfers the ownership to the caller _name pool name _symbol pool symbol _decimals pool decimals return new anchor/
function createAnchor(string memory _name, string memory _symbol, uint8 _decimals) external override returns (IConverterAnchor) { IPoolTokensContainer container = new PoolTokensContainer(_name, _symbol, _decimals); container.transferOwnership(msg.sender); return container; }
1,065,172
pragma solidity ^0.4.18; import "../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol"; import "../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol"; /* Eidoo ICO Engine interface This interface enables Eidoo wallet to query our ICO and display all the informations needed in the app */ ...
Optional function, can be implemented in place of startTime Returns the starting block number of the ico, must return 0 if it depends on the time stamp
function startBlock() public view returns(uint) { return rcBlockNumberStart; }
15,804,948
./full_match/1287/0xF9e85c663448703bAc8DA3A81153065Dd8db42B7/sources/project_/contracts/treasury/TreasuryContract.sol
This function gives you the community token id of the recordId that you pass recordId This is the Id of the token that you want to check
function getCommunityTokenId( uint256 recordId ) public view returns (uint256) { (, , , , bool isPresent, uint256 tokenId) = treasuryCoreContract .commTokenMapping(recordId); if (isPresent) { return tokenId; revert("INVALID: WRONG_RECORD_ID"); ...
7,097,061
./full_match/5/0x669851A8F2c0d441B338707bC75fff4489D3c8F6/sources/solidity/contracts/OracleSidechain.sol
@inheritdoc IOracleSidechain
function write(ObservationData[] calldata _observationsData, uint24 _poolNonce) external onlyDataReceiver returns (bool _written) { if (_poolNonce != ++poolNonce) return false; Oracle.Observation memory _lastObservation = observations[slot0.observationIndex]; uint256 _observationsDataLength = _observatio...
7,070,258
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract BearIsland...
Mint a token. to address to mint the token to
function safeMint(address to) public onlyOwner { uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); _safeMint(to, tokenId); }
12,634,575
./full_match/1/0x66938285B15da67A93D80D08f8f2DA665449F08d/sources/contracts/AXLPresale.sol
Set token token info
function init_private ( address _sale_token, uint256 _token_rate, uint256 _raise_min, uint256 _raise_max, uint256 _softcap, uint256 _hardcap, uint256 _presale_start, uint256 _presale_end ) public onlyOwner { require(persaleSetting =...
4,929,521
./full_match/80001/0x8811C267cF64C5781cdE2Cf3681768EFE8bB536E/sources/contracts/1_Storage.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./
function _mint(address account, uint256 amount) internal { require(account != address(0), 'BEP20: mint to the zero address'); require(totalSupply().add(amount) <= cap(), "cap exceeded"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amo...
9,491,605
pragma solidity ^0.7.1; //SPDX-License-Identifier: UNLICENSED /* New ERC23 contract interface */ interface IErc223 { function totalSupply() external view returns (uint); function balanceOf(address who) external view returns (uint); function transfer(address to, uint value) external returns (bool ok); ...
block transfers if the recipient only allows kyc input
function transferBip32X_type(address _to, uint256 _value, uint256 _bip32X_type) public returns (bool result) { require(onlyAcceptsKycInput[_to] == false); require(balances[msg.sender][_bip32X_type] >= _value); balances[msg.sender][_bip32X_type] = balances[msg.sender][_bip32X_type].sub(_valu...
5,381,699
// SPDX-License-Identifier: UNLICENSED pragma solidity^0.6.10; // 定义接口 interface IDivergence { // 注册 function register(string memory _name) external; // 出手 function punch(bytes32 _hash) external; // 证明 function proofing(string memory _salt, uint8 _opt) external; // 查看获胜 // 返回值: 1. 昵称 2....
定义接口 注册 出手 证明 查看获胜 返回值: 1. 昵称 2. 玩家1出手 3. 玩家2出手 4. 轮次
interface IDivergence { function register(string memory _name) external; function punch(bytes32 _hash) external; function proofing(string memory _salt, uint8 _opt) external; function winner() external view returns (string memory, string memory, string memory, uint256); pragma solidity^0.6.10; }
7,288,570