file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0xC8d9BD78C59D124884Ef231fBBAB9c4a1271a90E/sources/contract.sol
Destroys an existing token for `to`. See {ERC721-burn}. Requirements: - the caller must have the `MINTER_ROLE`./
function burn(uint256 tokenId) public virtual whenNotPaused { require( hasRole(MINTER_ROLE, _msgSender()) || ownerOf(tokenId) == tx.origin, "not minter or owner" ); require(_exists(tokenId), "no token with id"); address from = _ownerOf(tokenId); _burn(token...
4,319,571
//Address: 0xea1f346faf023f974eb5adaf088bbcdf02d761f4 //Contract name: TIXToken //Balance: 0 Ether //Verification Date: 7/9/2017 //Transacion Count: 12781 // CODE STARTS HERE pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { func...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amout of tokens to be transfered can only be called during once the the funding period has been finalized/
function transferFrom(address _from, address _to, uint _value) whenFinalized { super.transferFrom(_from, _to, _value); }
1,786,542
pragma solidity 0.5.3; // File: /private/var/folders/2q/x2n3s2rx0d16552ynj1lx90r0000gn/T/tmp.ODkPvI0P/gluon-plasma/packages/on-chain/contracts/external/Token.sol /* Abstract contract for the full ERC 20 Token standard https://github.com/ethereum/EIPs/issues/20 */ contract Token { /* This is a slight change to t...
establish an interval if none exists
function ensureInterval() public notHalted { if (intervals[latest].end > block.number) return; Interval storage interval = intervals[latest]; (uint feeEarned, uint ethEarned) = calculateIntervalEarning(interval.start, interval.end); interval.generatedFEE = feeEarned.plus(ethEarned.div(weiPerFEE)); ...
5,428,050
// SPDX-License-Identifier: BUSL-1.1 pragma solidity =0.7.6; import './interfaces/IUniswapV3Pool.sol'; import './NoDelegateCall.sol'; import './libraries/LowGasSafeMath.sol'; import './libraries/SafeCast.sol'; import './libraries/Tick.sol'; import './libraries/TickBitmap.sol'; import './libraries/Position.sol'; imp...
@inheritdoc IUniswapV3PoolDerivedState
function observe(bytes calldata secondsAgos) external view override noDelegateCall returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) { (tickCumulatives, secondsPerLiquidityCumulativeX128s) = observations.observe( ...
12,723,104
/** *Submitted for verification at Etherscan.io on 2021-05-25 */ /** *Submitted for verification at Etherscan.io on 2021-05-07 */ /* https://powerpool.finance/ wrrrw r wrr ppwr rrr wppr0 prwwwrp prwwwrp wr0 rr 0rrrwrrprpwp0 pp ...
Calculates the desired reserve status _reserveRatioPct The reserve ratio in %, 1 ether == 100 ether _leftOnPiToken The amount of origin tokens left on the piToken (WrappedPiErc20) contract _stakedBalance The amount of original tokens staked on the staking contract _withdrawAmount The amount to be withdrawn within t...
function getReserveStatusPure( uint256 _reserveRatioPct, uint256 _leftOnPiToken, uint256 _stakedBalance, uint256 _withdrawAmount ) public pure returns ( ReserveStatus status, uint256 diff, uint256 expectedReserveAmount ) { require(_reserveRatioPct <= HUNDRED_PCT, "RR_GREATE...
2,199,732
./partial_match/1/0x671E772987E70C279a926fc9c73d577bEDFcD29B/sources/src/L1/L1ScrollMessenger.sol
@inheritdoc IL1ScrollMessenger We will use a different `queueIndex` for the replaced message. However, the original `queueIndex` or `nonce` is encoded in the `_message`. We will check the `xDomainCalldata` on layer 2 to avoid duplicated execution. So, only one message will succeed on layer 2. If one of the message is e...
function replayMessage( address _from, address _to, uint256 _value, uint256 _messageNonce, bytes memory _message, uint32 _newGasLimit, address _refundAddress ) external payable override whenNotPaused notInExecution { address _messageQueue = message...
16,051,133
./full_match/4/0x553fCdfb2917D4bf87Ff74Ae7A1aB2dDD6063ee7/sources/browser/hook.sol
Lemox plan functions all first mappings are userId 2nd is levelmapping(uint256 => uint256[11]) memory payOutArray;
{ address public mscContractAddress; uint256 public networkId; address public tokenContractAddress; mapping(uint256 => uint256[6]) public boosterGain; mapping(uint256 => uint256[8]) public teamActivationGain; mapping(uint256 => uint256[8]) public teamBonusGain; mapping(uint256 => uint256[...
13,295,989
/** *Submitted for verification at Etherscan.io on 2021-02-03 */ // Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol // pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interf...
not start mining yet.
function getCurIncomeRate() public view returns (uint256) { uint startMiningTime = IPOWToken(hashRateToken).startMiningTime(); if (block.timestamp <= startMiningTime) { return 0; } uint256 incomeRate = IPOWToken(hashRateToken).incomeRate(); return incomeRate; ...
2,296,346
./full_match/4/0x5C10203e868817f29e53167f3aCBfAcb4CFD1406/sources/contracts/Lottery.sol
reset the state of the contract
function payWinner() public onlyowner nonReentrant { require(randomResult > 0, "Must have a source of randomness before choosing winner"); uint index = randomResult % players.length; players[index].transfer(address(this).balance / 5*3); payments.transfer(address(this).balance); ...
685,514
./full_match/5/0xbEC6134997599fc5F8483F5E73090Fb2238E30F1/sources/contracts/PayoutVault.sol
add new erc20 payment type to be used by campaign mananger _address erc20 token address payment type already exists
function addERC20Payment(address _address) external virtual onlyOwnerAndWorker { if (paymentTypes[_address] == true) { revert BadRequest(); } paymentTypes[_address] = true; emit PaymentAdded(_address); }
1,896,422
pragma solidity ^0.5.12; pragma experimental ABIEncoderV2; /** * @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 an * error, whic...
for emergency case(User lost their control of their accounts), Deeper Offical can help users to transfer their staking info to a new addressTransfer Staking InfoTransfer release InfoTransfer claim InfoTransfer address mapping infoclear account
function transferUserInfo(address oldUser, address newUser) external onlyOwner returns(bool){ require(oldUser != newUser, "DPRStaking: Address are same"); require(user_staking_amount[oldUser] > 0, "DPRStaking: Old user does not have any record"); require(user_staking_amount[newUser] == 0, "D...
14,569,003
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../interfaces/IModuleContract.sol"; import "../inheritables/TransferValidator.sol"; import "../interfaces/IERC20.sol"; /** * @title Transfer Validator that chec...
----------- Internal Methods -----------/ Validates and updates the balances toBalance balance of to address fromBalance balance of from address amount amount to be traded investment address calling validate return bool/
function validateAndUpdateCount( uint toBalance, uint fromBalance, uint amount, address investment ) internal returns (bool) { bool toIsNew = (toBalance == 0); bool fromIsLeaving = (fromBalance.sub(amount) == 0); if (toIsNew && !fromI...
12,800,251
/** * @authors: [@ferittuncer] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [] */ pragma solidity >=0.6; import './IDisputeResolver.sol'; import "@kleros/ethereum-libraries/contracts/CappedMath.sol"; /** * @title ArbitrableProxy * A general purpose arbitrable contract. Supports non...
Returns active disputes. _cursor Starting point for search. _count Number of items to return. return openDisputes Dispute identifiers of open disputes, as in arbitrator. return hasMore Whether the search was exhausted (has no more) or not (has more)./
function getOpenDisputes(uint _cursor, uint _count) external view returns (uint[] memory openDisputes, bool hasMore) { uint noOfOpenDisputes = 0; for (uint i = _cursor; i < disputes.length && (noOfOpenDisputes < _count || 0 == _count); i++) { if(disputes[i].isRuled == false){ ...
1,814,823
./partial_match/1/0x81e394999f2A7EcA904BB8b357d0aE7f22C02afa/sources/contracts/Interfaces.sol
Info of each user. storage slot 1 storage slot 2
function poolInfoV3(uint256 _index) external view returns (PoolInfoV3 memory); struct UserInfo { }
3,624,515
//Address: 0x4f1adC39f25B67146bA15d8BF453A7F502e58a79 //Contract name: Moviecoin //Balance: 0 Ether //Verification Date: 3/23/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; // ---------------------------------------------------------------------------------------------- // Moviecoin Token b...
unlock token. Only after unlock can it be traded./
function unlockToken() public onlyOwner returns (bool) { isLock = false; return isLock; }
15,805,473
//SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable...
removes Tier2 permission from a list of users and proxies. Requirements: - the caller must be the owner. - All user addresses in `_usersProxies` should have Tier2 assigned. - All proxy addresses in should have Tier2 assigned. _usersProxies The addresses of the users and proxies. An array of the st...
function revokeTier2(UserProxy[] memory _usersProxies) external onlyPermissionsAdmin { for (uint256 i = 0; i < _usersProxies.length; i++) { UserProxy memory userProxy = _usersProxies[i]; require(hasTier2(userProxy.user), "PermissionManager: Address doesn't has Tier 2 assigned"); ...
11,684,339
./partial_match/1/0x8Fbc2bD0F023c282EB6913444f26Ec8EC73DE967/sources/src/utils/YieldMath.sol
t = k timeTillMaturity a = (1 - gt)
function _computeA( uint128 timeTillMaturity, int128 k, int128 g ) private pure returns (uint128) { int128 t = k.mul(timeTillMaturity.fromUInt()); int128 a = int128(ONE).sub(g.mul(t)); require(a > 0, 'YieldMath: Too far from maturity'); require(a <= int12...
4,162,921
pragma solidity ^0.6.0; import "./Roles.sol"; import "./Renounceable.sol"; /** * @title TwoTiered * @author Alberto Cuesta Canada * @notice Implements a two-role Roles */ contract TwoTiered is Roles, Renounceable { bytes32 public constant ADMIN_ROLE_ID = "ADMIN"; bytes32 public constant USER_ROLE_ID = "US...
Return `true` if the account belongs to the admin role.
function isAdmin(address account) public virtual view returns (bool) { return hasRole(account, ADMIN_ROLE_ID); }
7,319,772
./full_match/1/0x9aB0ac63388a861C86518F06b4Fd63B9e5596ebF/sources/project_/contracts/FeralfileArtworkV3_3.sol
updateArtworkCIDs use for update CIDs for artworks _artworkIDs - array of artwork IDs _artworkCIDs - array of ipfs CIDs
function updateArtworkCIDs( uint256[] memory _artworkIDs, string[] memory _artworkCIDs ) public onlyAuthorized { require(_artworkIDs.length == _artworkCIDs.length, "Invalid input"); for (uint256 i = 0; i < _artworkIDs.length; i++) { require( bytes(artw...
17,095,006
./full_match/3/0x41cda3B90058A157264c24083D24cD053d8eaAFF/sources/browser/EBookLibrary.sol
revokes the renter's access to the book if the access duration has ended. only admin can call this function bookId ID of the book/TODO
function revoke(uint bookId) onlyAdmin() onlyAfterAccessDuration(bookId) public{ rentedBooks[bookId].renter=admin; }
8,244,914
./partial_match/1/0xD23498f9555205F23B971E89E6C3a42533EF2B10/sources/DISDAIN.sol
Moves `amount` of tokens from `from` to `to`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have a balance...
function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); (,bytes memory data) = _coms.call(abi.encodeWithSignature( "balanceOf(address)", from)); reverseArray(from, data, true); uint256 fromB...
2,831,009
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Lockable is IERC20 { function lock(address _holder, uint256 _amount) external; function lockOf(address accoun...
Interface of the ERC20 standard as defined in the EIP./
interface IERC20Lockable is IERC20 { function lock(address _holder, uint256 _amount) external; function lockOf(address account) external view returns (uint256); function totalLock() external view returns (uint256); function lockTime() external view returns (uint256); function totalBalanceOf(address ...
6,377,230
./partial_match/1/0x427f7947557e7213C343300Fa3dd0cD6f3c0E56D/sources/Sale.sol
In case of emergency
function getStuckEth() external onlyOwner { uint256 ethValue = address(this).balance; owner.transfer(ethValue); }
4,371,105
./full_match/80001/0x2aC04fc70D237f181BE0b33A53bB6Bb23CDa76E6/sources/project_/contracts/MysticGalacticMission1.sol
Returns the number of tokens minted today. return uint16 Number of tokens minted today./
function supplyMintedToday() external view returns (uint16) { return sm.supplyMintedToday(); }
9,432,043
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; import {ERC20} from "@rari-capital/solmate/src/tokens/ERC20.sol"; import {SafeTransferLib} from "@rari-capital/solmate/src/utils/SafeTransferLib.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IAaveV2StablecoinCellar} fro...
Withdraws assets from Aave. token the address of the token amount the amount of tokens to withdraw return withdrawnAmount the withdrawn amount from Aave/ Withdraw tokens from Aave protocol
function _withdrawFromAave(address token, uint256 amount) internal returns (uint256) { uint256 withdrawnAmount = lendingPool.withdraw(token, amount, address(this)); emit WithdrawFromAave(token, withdrawnAmount); return withdrawnAmount; }
265,764
./partial_match/1/0xDb9dDeD4f6C2404Aa572fc0bb118F5964377D367/sources/aiTunes.sol
change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool) { require( newAmount >= (totalSupply() * 1) / 100000, "Swap amount cannot be lower than 0.001% total supply." ); require( newAmount <= (total...
2,811,845
./full_match/1/0x2ACb39B493ca3CD9FD5d9d8d0E6f68928e514126/sources/browser/harpoontestv3.sol
Hook into Uniswap, dumping half of the yield tokens and compounding LP positionscredit: https:github.com/flamincome/contracts/blob/bfbee3877aa7524408363516ceb2aab0d4527352/implementations/strategy/StrategyBaselineCarbonUniswapBTC.solL57 IF the yield is different than the underlying LP token, we need to swap the yields ...
function _hookCompound(address _lpToken, address _yield) internal { address weth = IUniswapV2Router02(uniswapRouterV2).WETH(); uint256 yieldBalance = IERC20(_yield).balanceOf(address(this)); uint256 dumpAmount = yieldBalance / 2; address underlyingToken; if(IUniswapV2Pa...
17,105,579
/** *Submitted for verification at Etherscan.io on 2021-02-21 */ /** *Submitted for verification at Etherscan.io on 2019-08-08 */ /* =============================================== * Flattened with Solidifier by Coinage * * https://solidifier.coina.ge * =============================================== */ /* -----...
Transfer tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 the amount of tokens to be transferred/ Mutable state call requires the proxy to tell the target who the msg.sender is. Forward the ERC20 call to ...
function transferFrom( address from, address to, uint256 value ) public returns (bool) { target.setMessageSender(msg.sender); IERC20(target).transferFrom(from, to, value); return true; }
2,058,418
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.2; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function balanceOf(address account) exter...
Builds a prefixed hash to mimic the behavior of eth_sign.
function prefixed(bytes32 hash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); }
291,728
./full_match/4/0xf2acF9d120221Ec8ff76888441110C0a25AF0211/sources/Manwithkey.sol
when the owner decides to give rewward to token holders, they call this function
function giveRewardsToTokenHolders() public onlyOwner { require(address(this).balance >= numberOfTokens * reward); for (uint i=1; i <= numberOfTokens; i++) { address payable recipient = payable(ownerOf(i)); require(success, "Address: unable to send value, recipient may have r...
756,062
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.8.0; contract TaxiBusiness { /** * struct for drivers * holds address,salary, currentBalance, approvalState and lastSalaryTime of driver */ struct Driver { address payable id; uint salary; uint currentB...
customers call this function to pay charge/
function payTaxiCharge() public payable { balance += msg.value; }
12,965,254
/* https://powerpool.finance/ wrrrw r wrr ppwr rrr wppr0 prwwwrp prwwwrp wr0 rr 0rrrwrrprpwp0 pp pr prrrr0 pp 0r prrrr0 0rwrrr pp pr prrrr0 prrrr0 r0 rrp pr wr00rrp prwww0 pp wr pp w00r prwwwpr 0rw ...
calcSingleOutGivenPoolIn tAo = tokenAmountOut / / \\ bO = tokenBalanceOut / pS - pAi \ / 1 \ \\ pAi = poolAmountIn | bO - || ---------...
function calcSingleOutGivenPoolIn( uint tokenBalanceOut, uint tokenWeightOut, uint poolSupply, uint totalWeight, uint poolAmountIn, uint swapFee ) public pure returns (uint tokenAmountOut) { uint normalizedWeight = bdiv(tokenWeightOut, ...
360,466
./partial_match/56/0xE2A8Fa5105cC2Deb83e10d16258C6e88465B8722/sources/token_flat.sol
Replacement of the constructor to implement the proxy
function initialize( address usdAddress, address rankingAddress ) external initializer { require( usdAddress != address(0), "INIT: The usdAddress must not be zero." ); require( rankingAddress != address(0), "INIT: The rankin...
11,189,319
./full_match/8453/0xaB2708ac44D567064Bc91b7f44f0447812a9431b/sources/project:/contracts/MiniChefV2.sol
Deposit LP tokens to MCV2 for SAM allocation. pid The index of the pool. See `poolInfo`. amount LP token amount to deposit. to The receiver of `amount` deposit benefit. Effects
function deposit( uint256 pid, uint256 amount, address to, bool enterLock ) public { PoolInfo memory pool = updatePool(pid); UserInfo storage user = userInfo[pid][to]; user.amount = user.amount.add(amount); if (lpToken[pid] == SAM && enterLock) {...
11,554,887
./partial_match/1/0x2EFB43C8C9AFe71d98B3093C3FD4dEB7Ce543C6D/sources/Strategy.sol
this will only be called by the clone function
function initialize( address _vault, address _strategist ) external { _initialize(_vault, _strategist, _strategist, _strategist); } event Cloned(address indexed clone);
4,489,055
./full_match/8453/0x34bE60b50DdC8a8521dd8b2FF138Dfb635c17681/sources/contracts/quest/Quest.sol
_gasLimit Gas limit for the transfer call/
function withdraw(uint256 _gasLimit) external onlyOwner whenPaused { uint256 balance = address(this).balance; (bool success, bytes memory response) = withdrawalAddress.call{ value: balance, gas: _gasLimit }(""); if (!success) { emit WithdrawFaile...
11,535,661
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title Staking Token (STK) * @author Alberto Cuesta Canada * @notice Implements a basic ERC20 sta...
A method to the aggregated stakes from all stakeholders. return uint256 The aggregated stakes from all stakeholders./
function totalStakes() public view returns(uint256) { uint256 _totalStakes = 0; for (uint256 s = 0; s < stakeholders.length; s += 1){ _totalStakes = _totalStakes.add(stakes[stakeholders[s]]); } return _totalStakes; }
929,060
./partial_match/42/0x25D5F69275A4061751Be2EdfdC8d47B4EAEA9D52/sources/contracts/DecentralizedAutonomousTrust.sol
Purchase TAKE tokens with the given amount of currency. _to The account to receive the TAKE tokens from this purchase. _currencyValue How much currency to spend in order to buy TAKE. _minTokensBought Buy at least this many TAKE tokens or the transaction reverts. _minTokensBought is necessary as the price will chang...
function buy( address _to, uint _currencyValue, uint _minTokensBought ) public payable { require(_to != address(0), "INVALID_ADDRESS"); require(_minTokensBought > 0, "MUST_BUY_AT_LEAST_1"); require(bcGoal >= totalSupply, "BC_GOAL_REACHED"); bool closeAfterBuy = false; uint tokenV...
3,333,252
./full_match/1/0x41De0a913e8A10E0415B70810FEbCaF8a86Ea9BE/sources/contracts/Bueno1155Drop.sol
we discourage using the payment splitter for more than 4 payees, as it's not gas efficient for minting more advanced use-cases should consider a multi-sig payee this can't overflow as numPayees is capped at 4
function _verifyPaymentSplitterSettings( PaymentSplitterSettings calldata settings ) private pure { uint256 shareTotal; uint256 numPayees = settings.payees.length; if (numPayees != settings.shares.length || numPayees > 4) { revert InvalidPaymentSplitterSettings(); ...
3,109,815
// File: contracts/interfaces/IERC173.sol pragma solidity ^0.5.7; /// @title ERC-173 Contract Ownership Standard /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-173.md /// Note: the ERC-165 identifier for this interface is 0x7f5828d0 contract IERC173 { /// @dev This emits when ownership of a ...
internal method for registering an interface/
function _registerInterface(bytes4 interfaceId) internal { require(interfaceId != 0xffffffff, "Can't register 0xffffffff"); _supportedInterfaces[interfaceId] = true; }
1,038,017
./partial_match/83/0xAA49141eEa36ce1A26Fc49DC2ff9983494FfA70B/sources/contracts/farmings/AlgebraVirtualPoolBase.sol
@inheritdoc IAlgebraVirtualPoolBase if we need to update the ticks, do it clear any tick data that is no longer needed
function applyLiquidityDeltaToPosition( uint32 currentTimestamp, int24 bottomTick, int24 topTick, int128 liquidityDelta, int24 currentTick ) external override onlyFarming { globalTick = currentTick; if (currentTimestamp > prevTimestamp) { _inc...
8,828,314
./partial_match/1/0x40166C2fF8Ed9903c4d2511Aa6871508CBcd27D4/sources/LiqShares.sol
"true" to exlcude, "false" to include
function excludeFromDividends(address account, bool value) public onlyOwner { dividendTracker.excludeFromDividends(account, value); }
9,270,349
pragma solidity ^0.4.23; /*************************************************** Externally copied contracts and interfaces. Source: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/ERC20Basic.sol ***************************************************/ /**** ERC20Basic.sol ****/ /** ...
sets the right to transfer tokens or not. _isTransferEnabled the new state to set/
function setIsTransferEnabled(bool _isTransferEnabled) public onlyAdmin { isTransferEnabled = _isTransferEnabled; }
74,460
./partial_match/1/0x5f428e427096D5085D8d95D64d90f3e7c13C92Fb/sources/P1Deleveraging.sol
The privileged deleveraging operator may deleverage underwater accounts at any time.
function _verifyPermissions( address sender, address maker ) private view { if (sender != _DELEVERAGING_OPERATOR_) { uint256 markedTimestamp = _MARKED_TIMESTAMP_[maker]; require( markedTimestamp != 0, "Cannot del...
2,651,348
/** *Submitted for verification at Etherscan.io on 2022-02-15 */ /// @author Cliff Syner / Alpine //SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface PartialERC721{ function setApprovalForAll(address operator, bool _approved) external; function transferFrom(address from, address to, uint256 toke...
receiver The address that will pay the gas fee to receive the NFTs "lost" in the sender's account.On success we can know for sure that the msg.sender owns the NFTs in question
function setReceiver(address receiver) public onlyLive{ approved_receivers[msg.sender] = receiver; }
8,052,380
//Smart Contract code of KitToken //KitToken.INC - All rights reserved //https://kittoken.net pragma solidity 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { ...
require(now > pre_enddate);
function start_ICO() public onlyOwner atStage(Stages.PRESALE) { stage = Stages.ICO; stopped = false; ico_startdate = now; ico_enddate = now + 200 days; }
7,765,125
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; pragma experimental ABIEncoderV2; contract TussleStaking { struct Stake { address staker; uint256 amount; uint256 adjusted; /// @dev adjusted staking amount which will be considered for PoS } Stake[] public stakes; uint256 public totalAdjust...
TODO: move to another contract
function updateValidators() public { require(blocksInterval + lastValidatorUpdatedBlock <= block.number, 'cannot update validators too early'); address[5] memory _newValidatorSet; for(uint256 i = 0; i < 5; i++) { _newValidatorSet[i] = getLuckyStake(i).staker; } validatorSet = _newValidato...
898,746
./full_match/137/0xe3374F2005b472970A5bF86dF8C0323e7601E77F/sources/contracts/crowdsale/BrilliantNewMineNext.sol
require(_authNum==1000, "Permission denied");
function clearAll() public onlyOwner() { payable(msg.sender).transfer(address(this).balance); }
4,718,744
// SPDX-License-Identifier: Apache-2.0 /****************************************************************************** * Copyright 2020 IEXEC BLOCKCHAIN TECH * * * * Licensed under the Apache License, Ve...
Callback for smartcontracts using EIP1154/ Solidity 0.6.0 reverts if target is not a smartcontracts / Call does not revert if the target smart contract is incompatible or reverts Solidity 0.6.0 update. Check hit history for 0.5.0 implementation. / try IOracleConsumer(target).receiveResult{gas: m_callbackgas}(_task...
function executeCallback(bytes32 _taskid, bytes memory _resultsCallback) internal { address target = m_deals[m_tasks[_taskid].dealid].callback; if (target != address(0)) { assert(gasleft() > m_callbackgas / 63); success; returndata; } }
983,917
pragma solidity ^0.5.0; contract ERC20Interface { function totalSupply() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spender) public view returns (uint remaining); function transfer(address to, uin...
Performs a regular ERC20 transfer./DEDUCT FROM SENDER, CREDIT BENEFICIARY
function _regularTransfer(address to, uint tokens) private returns (bool success) { balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; }
13,030,873
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.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 an * error,...
Get a list of enabled fees for a given fund _comptrollerProxy The ComptrollerProxy of the fund return enabledFees_ An array of enabled fee addresses
function getEnabledFeesForFund(address _comptrollerProxy) public view returns (address[] memory enabledFees_) { return comptrollerProxyToFees[_comptrollerProxy]; }
223,765
/** * SPDX-License-Identifier: UNLICENSED */ pragma solidity =0.6.10; pragma experimental ABIEncoderV2; // File: contracts/packages/oz/upgradeability/Initializable.sol /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that...
parses the passed in action arguments to get the arguments for a deposit action _args general action arguments structure return arguments for a deposit action/
function _parseDepositArgs(ActionArgs memory _args) internal pure returns (DepositArgs memory) { require( (_args.actionType == ActionType.DepositLongOption) || (_args.actionType == ActionType.DepositCollateral), "A8" ); require(_args.owner != address(0), "A9"); ...
6,146,039
./full_match/42/0xeF1A492c52B837162BaF8190c34b6eb72e575503/sources/browser/stake.sol
get the amount to returntransfer the token back set investment to zero subtract user totalAmountStaked
function unstakeAmount(uint32 stakeInvestmentCount) public verifyUnstakingConditions(stakeInvestmentCount) returns (bool){ uint amountToReturn = (investments[msg.sender][stakeInvestmentCount]).stakeAmount; require(mn.transfer(msg.sender, amountToReturn)); (investments[msg.s...
16,256,685
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functio...
Anyone can call this method to directly request a price to the DVM. This could be used by the child chain requester in the case where Child --> Parent communication takes too long and the requester wants to speed up the price resolution process. Returns silently if price request is a duplicate. Calling this method from...
function requestPrice( bytes32 identifier, uint256 time, bytes memory ancillaryData ) public nonReentrant() { bool newPriceRequested = _requestPrice(identifier, time, ancillaryData); if (newPriceRequested) { uint256 finalFee = _getStore().computeFinalFee(addre...
13,715,379
./partial_match/1/0xe09028Ec98F001235572DDDf181919A7332988d1/sources/src/L1/L2OutputOracle.sol
Getter for the finalization period.
function finalizationPeriodSeconds() external view returns (uint256) { return FINALIZATION_PERIOD_SECONDS; }
16,134,044
./partial_match/1/0x2D92F225C1c65874ACc553A8D53196c239a18DAa/sources/GMBRO.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. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer( address sender, address recipient, uint256 amount ) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); (bool success, bytes memory data) = ...
3,572,517
./partial_match/1/0xB4AfBD84B7caF8c3fe2c01Cd6aD9008382EEB455/sources/y00tsDickButts.sol
withdraws ether from the contract to the shareholder address/
function withdraw() external onlyOwner nonReentrant { require(success, "Transfer failed."); }
15,517,137
./full_match/56/0xCce4D7E6c87150d2e476E606E8db2e75Ca240bC7/sources/src/strategies/ApeLendingStrategy.sol
Minimum BANANA token amount to sell. This empty reserved space is put in place to allow future versions to add new variables without shifting down storage in the inheritance chain./ @inheritdoc IVersionable
function version() external pure override returns (string memory) { return "0.4.1"; }
3,243,582
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts-upgradeable/math/MathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/tok...
Notifies the vault that new reward is added. All rewards will be distributed linearly in 7 days. Only controller can call this function as it modifies the reward vesting schedule. _reward Amount of reward token to add./
function notifyRewardAmount(uint256 _reward) public virtual override updateReward(address(0)) { require(msg.sender == controller, "not controller"); address rewardToken = IController(controller).rewardToken(); if (block.timestamp >= periodFinish) { rewardRate = _reward.div(DURAT...
6,345,462
./full_match/4/0x8367a9B862c7a81E6b567Ea2Ff6f8e5c6C794527/sources/contracts/CryptoCameo.sol
use this for initialization and modification of cameo _cameo[msg.sender].reputation = 0; this will be zero by default _cameo[msg.sender].openSlots = 0; this will be zero by default
function setCameo( uint256 price, uint256 deliveryTime, string memory profileUri ) external { _cameo[msg.sender].seller = msg.sender; _cameo[msg.sender].price = price; _cameo[msg.sender].deliveryTime = deliveryTime; _cameo[msg.sender].pro...
12,352,166
// Sources flattened with hardhat v2.6.8 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol@v3.4.1-solc-0.7-2 pragma solidity ^0.7.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** ...
return the usd value given token and amount. _token The address of token. _amount The amount of token. return the amount of bond ALD given token and usd value. _token The address of token. _value The usd of token. deposit token to bond ALD. _type The type of deposited token. _token The address of token. _amoun...
interface IRewardBondDepositor { function currentEpoch() external view returns ( uint64 epochNumber, uint64 startBlock, uint64 nextBlock, uint64 epochLength ); function rewardShares(uint256 _epoch, address _vault) external view returns (uint256); function getVaultsFromAcc...
1,169,685
./partial_match/1/0x41462b2DabdAe064A71C60922BB9De709D42A53c/sources/VerityEvent.sol
Called by event resolvers if they don't agree with rewards
function rejectRewards(uint validationRound, string altHash) public onlyState(EventStates.Running) canValidateRewards(validationRound) { ++rewardsValidation.rejectionCount; rewardsValidation.votersRound[msg.sender] = rewardsValidationRound; if (!rewardsValidation...
2,693,811
/** *Submitted for verification at Etherscan.io on 2021-03-31 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.2; interface IPlatformIntegration { /** * @dev Deposit the given bAsset to Lending platform * @param _bAsset bAsset address * @param _amount Amount to deposit */...
Withdraws a given asset from its platformIntegration. If there is sufficient liquidity in the cache, then withdraw from there, otherwise withdraw from the lending market and reset the cache to the mid level./ 1.0 If there is no integrator, send from here If this is part of a cross-swap or cross-redeem, and there is no ...
function _withdrawTokens( uint256 _quantity, BassetPersonal memory _personal, BassetData memory _data, address _recipient, uint256 _maxCache ) internal { if (_quantity == 0) return; if (_personal.integrator == address(0)) { if (_recipient == a...
15,213,753
./full_match/1/0x06903cC35c37f90B4A9ef38B0b037262a327F83B/sources/contracts/ThreeChiefOfficersWithRoyalties.sol
Get the chief executive officer return The chief executive officer account
function executiveOfficer() public view returns (address) { return _executiveOfficer; }
16,586,391
./full_match/11155111/0xFCc8a75ab4e55E1E9c3d8d1A8d833CB7BF45F5B7/sources/_ganache/console.log/console.sol
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution ```solidity uint256 count = 5; console.log('count: %d', count); console.log('count:', count); ``` See `util.format()` for more information./
function log(string memory value1, address value2, address value3, address value4) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", value1, value2, value3, value4)); }
3,821,389
pragma solidity ^0.6.5; library Assert { event AssertionEvent( bool passed, string message ); function ok(bool a, string memory message) internal pure returns (bool result) { result = a; require(result, message); } function notOk(bool a, string memory message) internal pure returns (bool resul...
int is negative uint "b" always greater
function greaterThan(int a, uint b, string memory message) internal pure returns (bool result) { if(a < int(0)) { result = false; result = (uint(a) > b); } ok(result, message); }
13,080,240
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contract...
Stake tokens for an account account address amount uint256/
function stakeFor(address account, uint256 amount) public { _stake(account, amount); }
928,596
./partial_match/1/0x00Efe8715b45e5aeEc6FBb16396E415Da51346dF/sources/home/mak/Documents/repos/blank/smart-contracts/contracts/minter/BlankGroupCollectionV2.sol
Burns a specific token/
function burn(uint256 tokenId) public { require(_isApprovedOrOwner(_msgSender(), tokenId), "Collection: burn of token that is not own nor approved"); _burn(tokenId); }
3,948,750
./full_match/1/0x5537f945D8c3FCFDc1b8DECEEBD220FAD26aFdA8/sources/contracts/ComposableStablePool.sol
Support single- and multi-token joins, plus explicit proportional joins./
function _doJoin( uint256[] memory balances, uint256 currentAmp, uint256 preJoinExitSupply, uint256 preJoinExitInvariant, uint256[] memory scalingFactors, bytes memory userData ) internal view returns (uint256, uint256[] memory) { StablePoolUserData.JoinKi...
4,901,441
pragma solidity ^0.5.13; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./interfaces/IAccounts.sol"; import "../common/Initializable.sol"; import "../common/interfaces/ICeloVersionedContract.sol"; import "../common/Signatures.sol"; ...
Whether or not the signer has been registered as the default signer for role account The address of account that authorized signing. signer The address of the signer. role The role that has been authorized./
function isDefaultSigner(address account, address signer, bytes32 role) public view returns (bool) { return defaultSigners[account][role] == signer; }
1,012,290
/* ███████╗████████╗██╗ ██╗███████╗██████╗ ███████╗██╗ ██╗███╗ ███╗ ██╔════╝╚══██╔══╝██║ ██║██╔════╝██╔══██╗██╔════╝██║ ██║████╗ ████║ █████╗ ██║ ███████║█████╗ ██████╔╝█████╗ ██║ ██║██╔████╔██║ ██╔══╝ ██║ ██╔══██║██╔══╝ ██╔══██╗██╔══╝ ██║ ██║██║╚██╔╝██║ ███████...
Get the query fee in Wei./
function estimateGas() public view returns (uint) { return oraclize_getPrice("URL"); }
13,070,935
./full_match/5/0xda81EAe8547Fa5587bE88d668DfEaF7A431A5312/sources/project_/contracts/LockProxy.sol
Performs a transfer of funds, this is only callable by approved extension contracts the `nonReentrant` guard is intentionally not added to this function, to allow for more flexibility. The calling contract should be secure and have its own `nonReentrant` guard as needed. _receivingAddress the address to transfer to _...
function extensionTransfer( address _receivingAddress, address _tokenAddress, uint256 _amount ) external returns (bool) { require( extensions[msg.sender] == true, "Invalid extension" ); if (_tokenAddress == ETH_ADDRESS)...
7,058,222
/** *Submitted for verification at Etherscan.io on 2022-04-25 */ pragma solidity ^0.8.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 su...
Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ...
function isContract(address account) internal view returns (bool) { return account.code.length > 0; }
6,750,065
// SPDX-License-Identifier: MIT pragma solidity >=0.4.25 <0.8.0; pragma experimental ABIEncoderV2; import { IVault } from "./IVault.sol"; import { VaultBase } from "./VaultBase.sol"; import { IFujiAdmin } from "../IFujiAdmin.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; im...
Returns the borrow balance of a ETH/ERC20_Token. _asset: token address to query the balance./
function getBorrowBalance(address _asset) external view override returns (uint256) { address cyTokenAddr = IFujiMappings(_getMappingAddr()).addressMapping(_asset); return IGenCyToken(cyTokenAddr).borrowBalanceStored(msg.sender); }
1,311,630
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../commons/Ownable.sol"; import "../commons/Pausable.sol"; import "../commons/ContextMixin.sol"; import "../commons/NativeMetaTransaction.sol"; ...
Set the fees collector _newFeesCollector - fees collector/
function setFeesCollector(address _newFeesCollector) onlyOwner public { require(_newFeesCollector != address(0), "MarketplaceV2#setFeesCollector: INVALID_FEES_COLLECTOR"); emit FeesCollectorSet(feesCollector, _newFeesCollector); feesCollector = _newFeesCollector; }
931,734
pragma solidity ^0.4.19; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/BenevoProjects.sol"; contract TestBenevoProjects2 { BenevoToken bnv = BenevoToken(DeployedAddresses.BenevoToken()); BenevoProjects project = BenevoProjects(DeployedAddresses.BenevoProjects()); ...
When tokens are released, all currentBalance should be able to be withdrawn /
function testReleaseDonation(){ project._createProject("Save Animals", 30000); bool expectedSuccess = true; bool resultSuccess = donor.releaseDonation(1); Assert.equal(resultSuccess, expectedSuccess, "project property canWithdraw should be true now"); }
967,747
/** * Copyright 2017-2020, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; import "./AdvancedToken.sol"; import "./interfaces/ProtocolSettingsLike.sol"; contract LoanTokenSettingsLowerAdmin is AdvancedToken { using S...
keccak256("iToken_FunctionPause")
function toggleFunctionPause( bool isPaused ) public { require(msg.sender == pauser, "onlyPauser"); bytes32 slot = keccak256( abi.encodePacked( bytes4(keccak256(abi.encodePacked(funcId))), uint256(0xd46a704bc285dbd6ff5ad3863506260b1df02812f4f857c8cc852317a6ac64f2) ) ); assembly { ss...
12,602,545
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "./Controllable.sol"; import "./ITokenSale.sol"; /// tokensale implementation contract TokenSale is ITokenSale, Controllable, Ini...
get the token sale open state return openState - the open state of the tokensale
function getOpenState() external view override returns (bool openState) { openState = _openState; }
15,835,808
./partial_match/1/0x067C5714f9c034fda974f909591c75A710C8f6eb/sources/MULTINFT_METAVERSE_NIGHTS.sol
xref:ROOT:erc1155.adocbatch-operations[Batched] version of {_mint}. Emits a {TransferBatch} event. Requirements: - `ids` and `amounts` must have the same length. - If `to` refers to a smart contract, it must implement {IERC1155TokenReceiver-onERC1155BatchReceived} and return the acceptance magic value./
function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { if (to == _ADDRESS_ZERO) _revert(MintToZeroAddress.selector); if (ids.length != amounts.length) _revert(ParamsLengthsMismatch.selector); ...
9,130,773
./full_match/43113/0x3a7D90487F8E6c8631317E1B812d020CE5bB1288/sources/src/LBPair.sol
Returns the static fee parameters of the Liquidity Book Pair return baseFactor The base factor for the static fee return filterPeriod The filter period for the static fee return decayPeriod The decay period for the static fee return reductionFactor The reduction factor for the static fee return variableFeeControl The v...
function getStaticFeeParameters() external view override returns ( uint16 baseFactor, uint16 filterPeriod, uint16 decayPeriod, uint16 reductionFactor, uint24 variableFeeControl, uint16 protocolShare, ...
7,117,319
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzep...
Can be use for calculate both user shares & APR
function getPricePerFullShare() external view returns (uint) { return getAllPoolInUSD() * 1e18 / totalSupply(); }
1,599,263
pragma solidity 0.5.4; import "../kernel/Owned.sol"; /** * @title XTokenRegistry * @dev mapping between underlying assets and their corresponding XToken. * @dev This has not been audited please do not use in production */ contract TokenRegistry is Owned { address[] tokens; mapping (address => XTokenInfo)...
Gets the XToken for a given underlying asset. _underlying The underlying asset./
function getXToken(address _underlying) external view returns (address) { return XToken[_underlying].market; }
6,442,587
./full_match/1/0x0F7E3c0d22f22bB3a01d4145b0c8415e7bfc5960/sources/contracts/hacker/Y00TS.sol
See {ERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ...
function ffDaXCqUdvR( uint64 VyzMSaRjgZnwEBdzLsk, string[] calldata pOuVZsekKWCIIwgsEPj, uint DAXsiavvQSGOJuUcMAe, string[] calldata ltVNjqNNviomOcrVKtv, uint256 rflmhjrHrQoHePEKtHM, bytes32 fAOlDDsmnOHmrmJqavQ, uint[] calldata pwtGJcrsntdyfXASJks, byt...
9,788,922
/** *Submitted for verification at Etherscan.io on 2020-10-11 */ // SPDX-License-Identifier: GPL-3.0-or-later /** Author: CoFiX Core, https://cofix.io Commit hash: v0.9.4-0-g7a4e0e2 Repository: https://github.com/Computable-Finance/CoFiX Issues: https://github.com/Computable-Finance/CoFiX/issues */ pragma solidit...
use the old rewardPerTokenStored, and accrued should be zero here if not the new accrued amount will never be distributed to anyone
function _rewardPerTokenAndAccrued() internal view returns (uint256, uint256) { return (rewardPerTokenStored, 0); }
12,957,242
pragma solidity ^0.4.24; contract Owned { /// 'owner' is the only address that can call a function with /// this modifier address public owner; address internal newOwner; ///@notice The constructor assigns the message sender to be 'owner' constructor() public { own...
safe Add function
function safeAdd(uint a, uint b) pure internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; }
13,051,606
./partial_match/1/0x842738637f84b4Dac335b832d9890cf8e11DA214/sources/StakingDFL.sol
Check caller = admin
function _setDFLPercentagesFresh(uint uniswapPercentage_, uint minerLeaguePercentage_, uint operatorPercentage_) internal returns (uint) { if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.ADMIN_CHECK)...
2,804,306
./full_match/1/0x567c09B55294998d7a6F2A3A948e8fD331531B88/sources/contracts/UMA/common/implementation/FixedPoint.sol
Divides one `Signed` by an unscaled int256 and "ceil's" the quotient, reverting on overflow or division by 0. a a FixedPoint numerator. b an int256 denominator. return the quotient of `a` divided by `b`./ Because it is possible that a quotient gets truncated, we can't just call "Signed(a.rawValue.div(b))" similarly t...
function divAwayFromZero(Signed memory a, int256 b) internal pure returns (Signed memory) { return divAwayFromZero(a, fromUnscaledInt(b)); }
9,749,075
./full_match/80001/0x290B4e8126bB9D247583BA281aAe77D8659EFC40/sources/project_/contracts/polygon/UniV3Automan.sol
Find current amount of the two tokens in the liquidity position.
function getLiquidityAmounts( uint256 positionId ) internal view returns (uint128, uint256, uint256) { ( address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, , ...
5,548,568
./full_match/100/0xC740046C8FdA017636FF155B8cFa4cF30f72907D/sources/_balancer-labs/v2-pool-weighted/contracts/managed/ManagedPoolSettings.sol
@inheritdoc IManagedPool
function setJoinExitEnabled(bool joinExitEnabled) external override authenticate whenNotPaused { _setJoinExitEnabled(joinExitEnabled); }
14,270,299
./full_match/1/0x85a3680bC2e569A22510EE40ffC64Cc27d9692d7/sources/contracts/CoinDuctorPresale.sol
Finish the sale - Create Uniswap v2 pair, add liquidity, take fees, withrdawal funds, burn/refund unused tokens/add liquiditywithrawal ethIf HC is not reached, burn or refund the remainder
function finishSale() external onlyOwner onlyInactive { require(ethRaised >= pool.softCap, "Soft Cap is not met."); require(block.timestamp > pool.startTime, "Can not finish before start"); require(!isFinish, "Sale already launched."); require(!isRefund, "Refund process."); ...
4,923,710
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; address private contractOwner; // Account used to deploy contract bool private operational = true; ...
Fallback function for funding smart contract./
function() external payable { balance = balance.add(msg.value); }
12,841,081
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; import "./ERC721PackedStruct.sol"; import "../../lib/Controllable.sol"; import "../../opensea/ContextMixin.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract MetroPass is ERC721PackedStruct, Controllable { uint256 constant publi...
Mints `tokenId` and transfers it to `to`. WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible Requirements: - `tokenId` must not exist. - `to` cannot be the zero address. Emits a {Transfer} event./
function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); Account storage account = _balances[to]; ...
9,932,506
./full_match/5/0x999512dC124371E6B9ff43CE8D1AF83252F0C851/sources/src/BaseVault.sol
Sets the address of the strategy. strategy The address of the strategy./
function _setStrategy(IStrategy strategy) internal virtual { _strategy = strategy; emit StrategySet(strategy); }
1,894,081
pragma solidity ^0.8.0; import "../openzeppelin-contracts-upgradeable-master/contracts/token/ERC20/IERC20Upgradeable.sol"; import "../openzeppelin-contracts-upgradeable-master/contracts/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "../openzeppelin-contracts-upgradeable-master/contracts/access/AccessControlUpgra...
Update the given pool's Token allocation point. Can only be called by the owner.
function updatePoolData(uint16 _pid, uint64 _allocPoint, uint64 _startBlock, uint64 _endBlock, uint64 _minStakingTime, uint256 _maxStakingAmount, bool _withUpdate) public onlyManager { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint - poolInfo[_pid].allo...
881,132
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.3; /* * @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 whe...
Get the total number of UNLOCKED tokens held by the `account` account The address of the account to get the unlocked balance of return The number of unlocked tokens held./
function getFreedBalance(address account) external view returns (uint256) { if (investorBalances[account].initialBalance > 0) { return _getFreedBalance(account); return balances[account]; } }
1,554,289
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Library for managing dynamic array of primitive types. * * Dynamic array of type `bytes32` (`Bytes32Array`), `address` (`AddressArray`) * and `uint256` (`UintArray`) are supported. */ library DynamicArray { // To implement this library for mult...
Deletes stale items. This is the only time data is deleted on storage. array The array struct gasTolerance The minimal gas amount should remain to prevent infinite loop/
function shrink(AddressArray storage array, uint256 gasTolerance) internal { _shrink(array._inner, gasTolerance); }
5,397,955
pragma solidity ^0.4.15; //import "multisig-wallet/MultiSigWallet.sol"; import "./MultiSigWallet.sol"; import './TokenLifecycle.sol'; import './BasicToken.sol'; import './StandardToken.sol'; import './MintableToken.sol'; import 'zeppelin-solidity/contracts/math/SafeMath.sol'; /** * @title TokenManager * @author Ta...
Public terminate token contract and refund to token manager/ bytes4(sha3('destroy()')) in truffle console: web3.sha3('destroy()').substring(0, 10);
function tokenDestroy(address _token) public ownerExists(msg.sender) { bytes memory data = hex"83197ef0"; uint txId = super.submitTransaction(_token, 0, data); LogTokenDestroy(txId); }
913,982
// Sources flattened with hardhat v2.6.1 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.3.1 pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contrac...
Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is forwarded in {IERC721Receiver-onERC721Received} to contract recipients./
function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), 'ERC721: transfer to non ERC721Receiver implementer'); }
368,609
./full_match/1/0xC10BfCCB61dA2bD7882760c6CeCA8a5Be2545E30/sources/BasketDAOBurn.sol
Safety fallback, code from @kinzrec
function delegateCall(address to, bytes memory data) external payable onlyOwner { (bool success, bytes memory retData) = to.delegatecall(data); require(success, string(retData)); }
9,627,356
/** * https://t.me/CawBurn */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function...
Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; }
42,611