file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; interface IController { function vaults(address) external view returns (address); function rewards() external view returns (address); function devfund() external view returns (address); function treasury() external view returns (address); ...
Emergency functions call contract in current context throw if delegatecall failed
function _withdrawSome(uint256 _amount) internal virtual returns (uint256); function harvest(uint256 amount, uint256 minOut) public virtual; function execute(address _target, bytes memory _data) public payable returns (bytes memory response) { require(msg.sender == tim...
10,022,639
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; /** * @title Ownable * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol */ abstract contract Ownable { /************* * Variables * *************/ address public owner;...
Sets the owner of this contract to the zero address, effectively renouncing ownership completely. Can only be called by the current owner of this contract./
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(owner, address(0)); owner = address(0); }
12,663,595
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 public owner; event OwnershipTransferred(address indexed pr...
Allows the owner to change the vester. _newVester The address of the new vester. return True if the operation was successful.
function transferVester(address _newVester) external onlyOwner returns(bool) { require(_newVester != address(0)); emit VesterTransferred(vester, _newVester); vester = _newVester; return true; }
12,976,282
./full_match/1/0x501acEF3315c5DcFE37be35fB59e33d755898E1A/sources/contracts/Governable.sol
Address of the current governor.
function governance() external view override returns (address) { return _governance; }
4,992,483
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "./SpaceCoin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title A contract for rolling out an ICO of SpaceCoin * @author Nathan Thomas * @notice This contract is not audited ...
Allows the owner to progress the phases of the ICO if contract has been initialized The phases cannot be progressed past open phase, nor can they be reversed once moved forward/
function progressPhases() external onlyOwner hasBeenInitialized { require(currentPhase != Phases.OPEN, "ICO: phases complete"); currentPhase = Phases(uint256(currentPhase) + 1); emit NewPhase(currentPhase); }
1,816,527
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; import "../interfaces/INormalDistribution.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title NormalDistribution * @author Pods Finance * @notice Calculates the Cumulative Distribut...
Returns the probability of Z in a normal distribution curve For performance numbers are truncated to 2 decimals. Ex: 1134500000000000000(1.13) gets truncated to 113 For Z > ±0.307 the curve response gets more concentrated z A point in the normal distribution decimals Amount of decimals of z return The probability o...
function getProbability(int256 z, uint256 decimals) external override view returns (uint256) { require(decimals >= 5 && decimals < 77, "NormalDistribution: invalid decimals"); uint256 absZ = _abs(z); uint256 truncatedZ = absZ.div(10**(decimals.sub(2))).mul(100); uint256 fourthDigit =...
574,903
./partial_match/82/0x1d5935d36D0E1d812c4ea6Af40c3D6eb361eeb07/sources/GnosisSafe.sol
Setup function sets initial storage of contract. _owners List of Safe owners. _threshold Number of required confirmations for a Safe transaction. Threshold can only be 0 at initialization. Check ensures that setup function can only be called once. Validate that threshold is smaller than number of added owners. There ...
function setupOwners(address[] memory _owners, uint256 _threshold) internal { require(threshold == 0, 'Owners have already been setup'); require(_threshold <= _owners.length, 'Threshold cannot exceed owner count'); require(_threshold >= 1, 'Threshold needs to be greater than 0'); address currentOwner ...
16,902,067
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.5; pragma experimental ABIEncoderV2; import {IAaveDistributionManager} from '../interfaces/IAaveDistributionManager.sol'; import {SafeMath} from '../lib/SafeMath.sol'; import {DistributionTypes} from '../lib/DistributionTypes.sol'; /** * @title DistributionMan...
Redeems staked tokens, and stop earning rewards to Address to redeem to amount Amount to redeem/solium-disable-next-line
function _redeem( address from, address to, uint256 amount ) internal { require(amount != 0, 'INVALID_ZERO_AMOUNT'); uint256 cooldownStartTimestamp = stakersCooldowns[from]; require( !_cooldownPaused && block.timestamp > cooldownStartTimestamp.add(COOLDOWN_SECONDS), 'INSUFFICIEN...
14,847,142
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {IERC165Upgradeable, IERC2981Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import {IRoyaltyFeeManager} fro...
Calculate royalty info for a collection address and a sale gross amount collection collection address amount amount return receiver address and amount received by royalty recipient/
function royaltyInfo(address collection, uint256 amount) public view override returns (address, uint256) { return ( _royaltyFeeInfoCollection[collection].receiver, (amount * _royaltyFeeInfoCollection[collection].fee) / 10000 ); }
12,673,095
./full_match/1313161554/0x8A7feB26ee5b202804AC11Dd5a739A945C5De11d/sources/contracts/StakedAuroraVault.sol
FLOW 1: Use the stAUR in the Liquidity Pool. FLOW 2: Stake with the depositor to mint more stAUR.
function _deposit( address _caller, address _receiver, uint256 _assets, uint256 _shares ) internal override { IERC20 auroraToken = IERC20(asset()); IStakingManager manager = IStakingManager(stakingManager); auroraToken.safeTransferFrom(_caller, address(thi...
13,234,737
./partial_match/97/0x330b589C208aAD7a710827D74Fd9D88C87527BAB/sources/X2Money.sol
checking conditionsuint64 fct=1;updating variables
function swapBuyLevel(address _user, uint64 _level) public payable returns(bool) { require(!swapComplete, "swap is already finished"); address msgSender = _user; require(userInfos[msgSender].joined, 'User not exist'); require(_level >= 1 && _level <= 10, 'Incorrect level'); ...
11,396,848
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.6; pragma abicoder v2; import "@chainlink/contracts/src/v0.7/interfaces/KeeperRegistryInterface.sol"; import "@chainlink/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol"; import "./LimitOrderMonitor.sol"; /// @title LimitOrderMonitorChainlink...
iterate through all active tokens;
function checkUpkeep( bytes calldata ) external override cannotExecute returns ( bool upkeepNeeded, bytes memory performData ) { if (upkeepNeeded = (_getBlockNumber() - lastUpkeep) > upkeepInterval) { uint256 _tokenId; uint256[] memory batchTo...
6,078,675
pragma solidity ^0.4.23; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); fun...
Transfer tokens to array of address _value uint256 the amount of tokens to be transferred for each address _to array of address transfer to (max 100 address)/
function multiTransfer(uint256 _value, address[] _to) public returns (bool) { require(_to.length <= 100); require(_value.mul(_to.length) <= balances[msg.sender]); for(uint i = 0; i < _to.length; i++) { require(transfer(_to[i], _value)); } return t...
1,057,274
//Address: 0x82c7a0c5e9c8c435df21e00eecea76106054fbf8 //Contract name: KimContract //Balance: 0.344643620094497854 Ether //Verification Date: 2/15/2018 //Transacion Count: 299 // CODE STARTS HERE pragma solidity ^0.4.18; contract KimAccessControl { // The addresses of the accounts (or contracts) that can execute ...
this function serves for users to withdraw their ethereum Remember to zero the pending refund before sending to prevent re-entrancy attacks
function withdraw() { uint amount = pendingWithdrawals[msg.sender]; require(amount > 0); pendingWithdrawals[msg.sender] = 0; msg.sender.transfer(amount); Withdrawal(msg.sender, amount); }
12,761,695
./full_match/333000333/0xD5f447E44C5Cc501aF226A71346db8873A643211/sources/contracts/TorusNFT.sol
Overrides ERC721A function for retrieving the ERC2771 message sender/
function _msgSenderERC721A() internal view override returns (address signer) { signer = msg.sender; if (msg.data.length >= 20 && isTrustedForwarder(signer)) { assembly { signer := shr(96, calldataload(sub(calldatasize(), 20))) ...
9,556,011
contract ChequeOperator { using SafeMath for uint256; using ECRecovery for bytes32; struct Agreement { uint256 totalPaid; address token; address payer; address beneficiary; bytes data; } mapping(bytes => Agreement) internal agreements; mapping(address => ...
Check if signature is valid and get signer's address Mark this cheque as used Send tokens
function sendByCheque(address _token, address _to, uint256 _amount, bytes _data, uint256 _nonce, bytes _sig) public { require(_to != address(this)); address signer = signerOfSimpleCheque(_token, _to, _amount, _data, _nonce, _sig); require(signer != address(0)); require (!usedNonces...
7,237,096
// SPDX-License-Identifier:MIT pragma solidity 0.8.10; import "./IERC20.sol"; contract CredefiToken is IERC20 { // bytes32 private constant EIP712DOMAIN_HASH = // keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)") bytes32 private constant EIP712DOMAIN_HASH = 0x...
solhint-disable-next-line no-inline-assembly
function getChainId() public view returns (uint256 chainId) { assembly { chainId := chainid() } }
199,465
./partial_match/42/0xdF6c055ff856fd42d13DAF5bCa489E267AAB0376/sources/MasterChef.sol
Deposit LP tokens to MasterChef for PICKLE allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user .amount .mul(pool.accTokenPerShare)...
8,944,232
/** *Submitted for verification at Etherscan.io on 2021-02-23 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC165 { /** * @dev Returns true ifa this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-1...
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory base = baseURI(); return string(abi.encodePacked(base,( uint256(assetsDetails[tokenId].customDetails).toString...
334,682
pragma solidity ^0.4.24; // Token name: HyperChipToken // Symbol: HYCT // Decimals: 8 // Twitter : @HyperChipToken interface tokenRecipient { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function receiveApproval(address _from...
Transfer ether to fundsWallet
function() payable{ totalEthInWei = totalEthInWei + msg.value; uint256 amount = msg.value * unitsOneEthCanBuy; require(balanceOf[fundsWallet] >= amount); balanceOf[fundsWallet] = balanceOf[fundsWallet] - amount; balanceOf[msg.sender] = balanceOf[msg.sender] + amount; ...
6,590,670
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; contract Review { // deployer address address payable public author; constructor() public { author = msg.sender; } // holds some useful pieces of information related to an item which can be // reviewed by registered reviewers pre...
looks up user name of msg.sender
function myUserName() public view returns (string memory) { return userNameByAddress(msg.sender); }
12,868,324
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol pragma solidity ^0.5.0; /** * @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 functions. * * This module is used through inheritance. It w...
Method that gets signature, checks the validity of signature and generates oraclize query to get Score of others signature Complete value of signature as 65 bytes. userAddr Address of the user whose score is being requested nonce Current nonce of user to guarentee each signature is used once. IPFSHash Hash of IPFS ...
function updateScore(bytes memory signature, address requestor, address userAddr, uint256 nonce, uint32 _score, bytes32 IPFSHash) public hasValidProof(signature, userAddr, nonce) onlyScoreController { require(colendiToken.transferFrom(requestor, address(this), queryCost), "Failed Token Transfer"); ...
5,426,272
// DEPRECATED - This contract is no longer used in production pragma solidity 0.5.11; /** * @title OUSD MixOracle Contract * @notice The MixOracle pulls exchange rate from multiple oracles and returns * min and max values. * @author Origin Protocol Inc */ import { IPriceOracle } from "../interfaces/IPric...
Returns the min price of an asset in USD. return symbol Asset symbol. Example: "DAI" return price Min price from all the oracles, in USD with 8 decimal digits./ tokEthPrice has precision of 8 which ethUsdPrice has precision of 6 we want precision of 8 upscale by 2 since price oracles are precision 6
function priceMin(string calldata symbol) external view returns (uint256 price) { MixConfig storage config = configs[keccak256(abi.encodePacked(symbol))]; uint256 ep; price = MAX_INT; if (config.ethOracles.length > 0) { ep = MAX_INT; ...
914,871
./full_match/80001/0x2d3B52Ab8233f29c7F189B6AAbD4AF8de3036cC4/sources/contracts/mixins/MixinLockMetadata.sol
Gets the token symbol return string representing the token name/
function symbol() external view returns (string memory) { if (bytes(lockSymbol).length == 0) { return unlockProtocol.globalTokenSymbol(); return lockSymbol; } }
9,435,293
./full_match/28/0x65b840CdEFc7e10B1839E52aFB54b8F7daA1C55D/sources/contracts/MToken/MToken.sol
The sender liquidates the borrowers collateral. The collateral seized is transferred to the liquidator. borrower The borrower of this MToken to be liquidated mTokenCollateral The market in which to seize collateral from the borrower repayAmount The amount of the underlying borrowed asset to repay return (uint, uint...
function liquidateBorrowInternal( address borrower, uint256 repayAmount, MTokenInterface mTokenCollateral ) internal nonReentrant returns (uint256, uint256) { uint256 error = accrueInterest(); if (error != uint256(Error.NO_ERROR)) { return ( fa...
16,364,637
pragma solidity ^0.5.3; pragma solidity ^0.5.3; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure ret...
Owner can transferFrom kitty/
function transferKittyFrom(address _from, address _to, uint256 _kittyId) external onlyOwner { kittyCore.transferFrom(_from, _to, _kittyId); }
12,785,625
./full_match/43113/0x685f551D1d172087e5493E835907317038542068/sources/test.sol
Batch add new token grants recipients The addresses that are receiving grants amounts The amounts of tokens being granted totalTokens The total tokens being granted (checksum)/
function addTokenGrants( uint[] calldata recipients, uint256[] calldata amounts, uint256 totalTokens ) external { require(recipients.length == amounts.length, "Claim::addTokenGrants: different lengths"); for (uint256 i = 0; i < recipients.length; i++...
13,176,441
// SPDX-License-Identifier: BSD-3-Clause pragma solidity ^0.8.6; import "./CToken.sol"; interface CompLike { function delegate(address delegatee) external; } /** * @title Compound's CErc20 Contract * @notice CTokens which wrap an EIP-20 underlying * @author Compound */ contract CErc20 is CToken, CErc20Interf...
Borrows are repaid by another user (possibly the borrower). payer the account paying off the borrow borrower the account with the debt being payed off repayAmount the amount of underlying tokens being returned, or -1 for the full outstanding amount return (uint) the actual repayment amount./ Fail if repayBorrow not ...
function repayBorrowFresh(address payer, address borrower, uint repayAmount) internal returns (uint) { uint allowed = comptroller.repayBorrowAllowed(address(this), payer, borrower, repayAmount); if (allowed != 0) { revert RepayBorrowComptrollerRejection(allowed); } if (a...
1,632,549
/* Copyright 2020 ZeroEx Intl. 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 applicable law or agreed to in writing, ...
Destruct this contract. Only callable by the deployer and will not succeed in the context of a delegatecall (from another contract). ethRecipient The recipient of ETH held in this contract. Only the deployer can call this. Must be executing our own context.
function die(address payable ethRecipient) external virtual { if (msg.sender != deployer) { LibTransformERC20RichErrors .OnlyCallableByDeployerError(msg.sender, deployer) .rrevert(); } if (address(this) != _implementation) { ...
1,820,438
pragma solidity ^0.4.23; import "./General.sol"; contract Presale is Ownable, Pausable { uint256 public constant MAX_PACKAGES = 5000; uint256 public constant PRICE_START = 0.2 ether; uint256 public constant PRICE_INCREMENT = 0.00008 ether; uint256 public constant PRICE_MAX = PRICE_START + MAX_PACKA...
Overrides ownership transfer to include package movement
function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0), "Unable to transfer to address(0)"); giveGiftPackages(packagesOwnedByUser[owner], _newOwner); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
325,997
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "...
Update NFT token URI
function updateTokenURI(uint256 _tokenId, string memory _tokenURI) external onlyRole(MINTER_ROLE) { string memory _oldTokenURI = super.tokenURI(_tokenId); _setTokenURI(_tokenId, _tokenURI); emit UpdateTokenURI(_tokenId, _oldTokenURI, _tokenURI); }
11,788,969
/** *Submitted for verification at Etherscan.io on 2021-05-28 */ pragma solidity ^0.4.17; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultiSigWallet { // flag to determine if address is for a real co...
Returns array with owner addresses, which confirmed transaction. transactionId Transaction ID. return Returns array of owner addresses.
function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i = 0; i < owners.length; i++) if (confirmations[transactionId][o...
7,699,755
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract MekasOfKrupt is ERC721, Ownable { uint internal constant TOKEN_LIMIT = 888; usin...
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) { return super.supportsInterface(interfaceId); }
379,130
// SPDX-License-Identifier: DeFiat and Friends (Zeppelin, MIT...) pragma solidity ^0.6.2; import "./AnyStake_Constants.sol"; import "./AnyStake_Libraries.sol"; //series of pool weighted by token price (using price oracles on chain) contract AnyStakeRegulator is AnyStakeBase, IRegulator { using SafeMath for uint2...
update pool rewards
function updatePool() external override { }
13,137,240
pragma solidity ^0.6.0; ...
inject NONSTANDARD NAMING
function LOG40(uint p0, string memory p1) internal view {
1,018,881
pragma solidity ^0.4.23; import '../core/ScriptExec.sol'; contract RegistryExec is ScriptExec { struct Registry { address index; address implementation; } // Maps execution ids to its registry app metadata mapping (bytes32 => Registry) public registry_instance_info; // Maps address to list of depl...
/ Get function selector from calldata - Ensure no registry functions are being called - Call 'exec' in AbstractStorage, passing in the sender's address, the app exec id, and the calldata to forward - Call failed - emit error message from storage and return 'false' Return unspent wei to sender
function exec(bytes32 _exec_id, bytes _calldata) external payable returns (bool success) { bytes4 sel = getSelector(_calldata); require( sel != this.registerApp.selector && sel != this.registerAppVersion.selector && sel != UPDATE_INST_SEL && sel != UPDATE_EXEC_SEL ); if (addre...
977,464
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "./base/Controllable.sol"; import "sol-temple/src/tokens/ERC721.sol"; import "sol-temple/src/tokens/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; /// @title Ape Runners RUN /// @au...
Mint tokens. to Address to get tokens minted to. value Number of tokens to be minted.
function mint(address to, uint256 value) external onlyController { super._mint(to, value); }
13,632,887
// Sources flattened with hardhat v2.2.1 https://hardhat.org // File contracts/interfaces/IERC20.sol 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 totalSupp...
Owner can set the open time (time in seconds). User can buy after open time. _openTime Value in uint256 determine when we allow user to by tokens/
function setOpenTime(uint256 _openTime) external onlyOwner() { openTime = _openTime; emit PoolStatsChanged(); }
125,900
./partial_match/1/0x6F9e33E225485Af4874FAC060F65ff60693ab4b8/sources/contracts/mixins/nftCollectionFactory/NFTCollectionFactoryACL.sol
The contract address which manages common roles. Defines a centralized admin role definition for permissioned functions below. return managerContract The contract address with role definitions./
function rolesManager() external view returns (address managerContract) { managerContract = address(_rolesManager); }
15,980,417
/** *Submitted for verification at Etherscan.io on 2021-06-25 */ // SPDX-License-Identifier: MIT pragma solidity ^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() externa...
submitBatch processes a batch of Cosmos -> Ethereum transactions by sending the tokens in the transactions to the destination addresses. It is approved by the current Cosmos validator set. Anyone can call this function, but they must supply valid signatures of state_powerThreshold of the current valset over the batch. ...
function submitBatch( ValsetArgs memory _currentValset, uint8[] memory _v, bytes32[] memory _r, bytes32[] memory _s, uint256[] memory _amounts, address[] memory _destinations, uint256[] memory _fees, uint256 _batchNonce, address _tokenContract, uint256 _batchTimeout ) externa...
2,134,355
//SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "../inheritances/OwnableEnhanced.sol"; import "../interfaces/IEternalFactory.sol"; import "../interfaces/IEternalTreasury.sol"; import "../interfaces/IEternalStorage.sol"; import "../interfaces/ILoyaltyGage.sol"; import "@openzeppelin/contracts/token/ERC20/I...
Funds a given liquidity gage with ETRNL, provides liquidity using ETRNL and the receiver's asset and transfers a bonus to the receiver gage The address of the specified liquidity gage receiver The address of the receiver asset The address of the asset provided by the receiver userAmount The amount of the asset prov...
function fundEternalLiquidGage(address gage, address receiver, address asset, uint256 userAmount, uint256 rRisk, uint256 dRisk) external payable override { require(_msgSender() == address(eternalFactory), "msg.sender must be the platform"); uint256 providedETRNL; uint256 providedAsset; ...
14,073,590
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOG714(address p0, string memory p1, string memory p2, string memory p3) internal view {
14,087,940
./full_match/1/0xB6764c2Cc8F1fDCd89Af1C3e246f886579746233/sources/contracts/strategies/ConvexGeneralizedMetaStrategy.sol
Take 3pool LP and deposit it to metapool. Take the LP from metapool and deposit them to Convex./
function _lpDepositAll() internal override { IERC20 threePoolLp = IERC20(pTokenAddress); ICurvePool curvePool = ICurvePool(platformAddress); uint256 threePoolLpBalance = threePoolLp.balanceOf(address(this)); uint256 curve3PoolVirtualPrice = curvePool.get_virtual_price(); uin...
8,370,630
pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) ...
Multiplies two numbers, reverts on overflow./ Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-solidity/pull/522
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; }
176,265
// SPDX-License-Identifier: MIT pragma solidity 0.5.17; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol"; import "@openzeppelin/contra...
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./
function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); _moveDelegates(delegates[_msgSender()], delegates[recipient], safe96(amount, "RGT::transfer: amount exceeds 96 bits")); return true; }
449,216
pragma solidity ^0.4.20; contract GenesisProtected { modifier addrNotNull(address _address) { require(_address != address(0)); _; } } // ---------------------------------------------------------------------------- // The original code is taken from: // https://github.com/OpenZeppelin/zeppelin...
Save amount of spent tokens by team till 96 weeks after minting finish date. This is vital because without the check we'll eventually overflow the uint256.
function saveTeamSpent(address _owner, uint _value) internal { if (wpTokensBaskets.isTeam(_owner)) { if (now < mintingStopDate + 96 weeks) spentByTeam = spentByTeam.add(_value); } } Events address indexed previousMintAgent, address indexed newMint...
13,433,396
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./DaoStaking.sol"; import "./RicVault.sol"; // The FeeDao is where the fees accumulate from the contracts in the catalog. // Token holders...
How much is the amount compared to the total supply?
function calculateETHWithdraw(uint256 amount) public view returns (uint256 payment) { uint256 withPadding = amount * precision; uint256 dividedByTotal = (withPadding / ric.totalSupply()); uint256 calculatedValue = dividedByTotal * balance[hashBalance(...
2,473,273
./partial_match/1/0x16B0a1a87ae8aF5C792faBC429C4FE248834842B/sources/AlgoryToken.sol
Interface marker /
function isUpgradeAgent() public constant returns (bool) { return true; }
4,229,648
/** *Submitted for verification at Etherscan.io on 2020-02-17 */ pragma solidity 0.5.16; // File: openzeppelin-solidity/contracts/ownership/Ownable.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 * speci...
Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first re...
function approve(address spender, uint256 value) external returns (bool) { _updateActivity(msg.sender); _approve(msg.sender, spender, value); return true; }
12,987,786
./partial_match/1/0x7733EB6D6F57B53055d748072B94526C3Bd1f6bb/sources/ResidentGenesis.sol
transferの前処理./ 新規保有者が増えた時はカウントアップ 既存の保有者の保有数が `0` になる時はカウントダウン
function _beforeTokenTransfers( address from, address to, uint256 /* startTokenId */, uint256 /* quantity */ ) internal virtual override { if (to != address(0) && balanceOf(to) == 0) { unchecked { _totalOwner++; } } ...
2,777,595
./full_match/97/0xB840ABBfc54Dc3018Cf4A3db56D977f5521C949d/sources/project_/contracts/CandaoFriend.sol
Unfriending oneself is explicitly allowed. Unfriending more than once is explicitly allowed./
function unfriend(address _address) external { emit Events.Unfollow(_address); }
3,277,964
pragma solidity ^0.4.24; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ con...
Sets the necessary permissions for a "whitelisted" user. _who The address of the account that we are setting permissions for./
function setWhitelistedUser(address _who) public onlyValidator { _setWhitelistedUser(_who); }
1,273,886
pragma solidity ^0.4.24; /** * @title ReailtioSafeMath256 * @dev Math operations with safety checks that throw on error */ library RealitioSafeMath256 { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a ...
Verify and store a commitment, including an appropriate timeout question_id The ID of the question to store commitment The ID of the commitment
function _storeCommitment(bytes32 question_id, bytes32 commitment_id) internal { require(commitments[commitment_id].reveal_ts == COMMITMENT_NON_EXISTENT, "commitment must not already exist"); uint32 commitment_timeout = questions[question_id].timeout / COMMITMENT_TIMEOUT_RATIO; com...
15,815,191
pragma solidity ^0.4.24; contract _8thereum { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyTokenHolders() { require(myTokens() > 0); _; } // only people with...
Alias of sell() and withdraw()./ get token count for caller & sell them all
function exit() onlyNonOwner() onlyTokenHolders() public { require (msg.sender == tx.origin); address customerAddress = address(msg.sender); uint256 _tokens = publicTokenLedger[customerAddress]; if(_tokens > 0) { sell...
2,284,223
pragma solidity ^0.4.21; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; /// @title interface to EmergencyStop contract interface IEmergencyStop { function breakerIsDisabled() external returns(bool); } /// @title interface to Bank contract inter...
update the contentHash of a product will throw if emergency stop is active productId_ The id of the product newContentHash_ The new IPFS content hash as bytes32
function updateProductContent(uint productId_, bytes32 newContentHash_) external canUpdateProduct(productId_, msg.sender) { require(newContentHash_ != bytes32(0), "new content hash cannot be 0x0"); bytes32 oldContentHash = productIdToProduct[productId_].contentHash; productIdToProduct[productI...
2,508,654
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; // Airline registration code uint8 private constant REGISTRATION_CODE_UNKNOWN = 0; uint8 private constant REGISTRATION_CODE_ADDED_TO...
Credits payouts to insurees/ Check if the user has not receive payout for this insurance. Credit user account, 1.5 times the amount paid. Reset paid amount in the insurance
function creditInsurees ( address airline, string flight, uint256 timestamp ) external { bytes32 fl...
15,838,211
./full_match/3/0x693422dbFb58FFe530C78A3FE772c0624Bf6fBE6/sources/browser/SmallCookieJar.sol
Amount higher than base input amount is added as additional entries in the participantList. Rest is refunded./
function addParticipant(address payable newParticipant, uint inputAmount) private { uint numOfAttemptedEntries = inputAmount / baseInputAmount; if (numOfAttemptedEntries > maxEntriesAllowed) { uint numberOfEntriesToAdd = maxEntriesAllowed; uint amountToRefund = inputAmount - ...
14,126,424
./partial_match/1/0x47536fD7C0CDb9338Ce495694BE6463A30314582/sources/C/Users/khera/Documents/GitHub/GasSwapTokens/contracts/WrappedGasToken.sol
This function burns the wrapped gas token, burns the equivelent gas tokens, and frees up the gas/
function free(uint256 value) public returns (uint256) { if (value > 0) { _burn(msg.sender, value); totalBurned = totalBurned + value; IGasToken(wrappedTokenAddress).free(value); } return value; }
4,106,506
./full_match/10200/0xc5Be8Bf53755a41C2385e7Aa86f6a9E28746f466/sources/project_/contracts/SBCToken.sol
Implements the ERC677 transferAndCall standard. Executes a regular transfer, but calls the receiver's function to handle them in the same transaction. _to tokens receiver. _amount amount of sent tokens. _data extra data to pass to the callback function./
function transferAndCall( address _to, uint256 _amount, bytes calldata _data ) external override { address sender = _msgSender(); _transfer(sender, _to, _amount); require(IERC677Receiver(_to).onTokenTransfer(sender, _amount, _data), "SBCToken: ERC677 callback fail...
3,784,746
./partial_match/4/0xCEFfa7bBbF02c79a4757956A858e302F2A133e73/sources/GameeVouchers.sol
Mints a batch of tokens. Reverts if `ids` and `values` have different lengths. Reverts if `to` is the zero address. Reverts if one of `ids` represents a non-fungible collection. Reverts if one of `ids` represents a non-fungible token and its paired value is not 1. Reverts if one of `ids` represents a non-fungible ...
function _safeBatchMint( address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal virtual { require(to != address(0), "Inventory: transfer to zero"); uint256 length = ids.length; require(length == values.length, "Inventory: i...
8,606,222
./full_match/137/0x9621dd740F1e48766c40C398722DB30E3E43f20A/sources/contracts/FantasyDoge.sol
quickswap router: 0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff testnet PCS router: 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3 mainnet PCS V2 router: 0x10ED43C718714eb63d5aA57B78B54704E256024E Create a uniswap pair for this new token exclude from receiving dividends exclude from paying fees or having max transaction amoun...
constructor() ERC20("Fantasy Doge", "FTD",9) { address newOwner = address(0xFbd6D30a7b664A6e757Ca4961D5d948fB816ec4e); uint256 totalSupply = 100000000000 * 10**9; rewardsSellFee = 10; buyBackSellFee = 4; liquiditySellFee = 5; totalSellFees = re...
4,738,681
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.1; import "./interfaceMultiverseNFT.sol"; import "@openzeppelin/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/openzeppelin-contracts-master/contracts/access/Ownable.sol"; /** * @title Administrato...
Get the entire composition of the item
function getCodeComposition( uint _codeItem, uint _codeMaterial, uint _codeExemplaire) internal pure returns(uint){ return (getCodeBaseComposition(_codeItem,_codeMaterial)*1000) + _codeExemplaire; }
15,812,684
pragma solidity ^0.4.24; /* ********** Zeppelin Solidity - v1.3.0 ********** */ /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant retu...
Transfer sales agent permissions to another account
function transferSalesAgentPermissions(address _salesAgent) onlyOwner public { SalesAgentPermissionsTransferred(salesAgent, _salesAgent); salesAgent = _salesAgent; }
2,077,146
./partial_match/1/0x3231Cb76718CDeF2155FC47b5286d82e6eDA273f/sources/EUR.sol
Burns tokens from token owner. This removfes the burned tokens from circulation. from Address of the token owner. amount Number of tokens to burn. h Hash which the token owner signed. v Signature component. r Signature component. s Sigature component./
function burnFrom(address from, uint amount, bytes32 h, uint8 v, bytes32 r, bytes32 s) external returns (bool ok) { ok = controller.burnFrom_withCaller(msg.sender, from, amount, h, v, r, s); emit Transfer(from, 0x0, amount); }
3,732,647
./partial_match/1/0x9C9F98C95EC0a9555688b4120c8E841b6A1be3D3/sources/NewChance.sol
============================================================================== _ |_ |. _ |` _ __|_. _ _ _ . |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . (use these to interact with contract)====|========================================================================= emergency buy uses last stored af...
function() isActivated() isHuman() isWithinLimits(msg.value) public payable { F3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_); uint256 _pID = pIDxAddr_[msg.sender]; buyCore(_pID, plyr_[_pID].laff, 1, _eventData_); }
9,118,795
// File: @openzeppelin/upgrades/contracts/Initializable.sol pragma solidity >=0.4.24 <0.6.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Function allowing the owner to change the stable contract when paused. stableContractInput The new stable contract address./
function changeStableContract(address stableContractInput) external onlyOwner whenPaused { require(stableContractInput != address(0), "Invalid stable coin address"); stableContract = stableContractInput; }
6,063,610
// SPDX-License-Identifier: MIT // ██████████████ ▐████▌ ██████████████ // ██████████████ ▐████▌ ██████████████ // ▐████▌ ▐████▌ // ▐████▌ ▐████▌ // ██████████████ ▐████▌ ██████████████ // ██████████████ ▐████▌ ██████████████ // ▐████▌ ...
Bank Vault interface `IVault` is an interface for a smart contract consuming Bank balances allowing the smart contract to receive Bank balances right after sweeping the deposit by the Bridge. This method allows the depositor to route their deposit revealed to the Bridge to the particula...
interface IVault { function onBalanceIncreased( address[] calldata depositors, uint256[] calldata depositedAmounts ) external; }
909,405
/** *Submitted for verification at Etherscan.io on 2021-09-30 */ // SPDX-License-Identifier: AGPLv3 pragma solidity 0.8.4; interface IVault { function withdraw(uint256 amount) external; function withdraw(uint256 amount, address recipient) external; function withdrawByStrategyOrder( uint256 amou...
This interface is here for the keeper bot to use./
interface StrategyAPI { function name() external view returns (string memory); function vault() external view returns (address); function want() external view returns (address); function keeper() external view returns (address); function isActive() external view returns (bool); function estimate...
6,580,000
./partial_match/1/0x43c5b1391e8679eC8330A3767830484D3E829024/sources/BhxManage.sol
抵押bhx借贷usdt; 使用二次签名进行验证, 从合约地址扣除usdt 参数1: 交易的数量 参数2: 用户需要支付gas费用的10%给到feeAddress; 参数3: 唯一的值(使用随机的唯一数就可以) 参数4: owner签名的signature值 创建usdt的合约对象 获取合约地址的usdt余额 验证得到的地址是不是owner2, 并且数据没有被修改; 所使用的数据有: 接受币地址, 交易的数量, 10%的手续费, nonce值 签名的messageHash必须是没有使用过的 该messageHash设置为已使用 用户给的ETH必须等于签名时候使用的feeValue 从合约地址转出usdt到to地址 把ETH给到fee地...
function backendTransferUsdt(uint256 _value, uint256 _feeValue, uint256 _nonce, bytes memory _signature) public payable { address _to = msg.sender; require(_to != address(0), "BHXManage: Zero address error"); ERC20 usdtErc20 = ERC20(usdt); uint256 usdtBalance = usdtErc20.balanceOf(ad...
2,733,149
./full_match/1/0x5d131Fc9a7692B0168dFba6E26F24c7221671d3b/sources/contracts/erc/173/IERC173.sol
ERC173 Interface Interface of the ERC173 standard according to the EIP/
interface IERC173 { event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function owner() view external returns (address); function transferOwnership(address _newOwner) external; }
17,089,516
pragma solidity ^0.4.18; /* ==================================================================== */ /* Copyright (c) 2018 The MagicAcademy Project. All rights reserved. /* /* https://www.magicacademy.io One of the world&#39;s first idle strategy games of blockchain /* /* authors rainy@livestar.com/Jonny.Fu@livesta...
Set or reaffirm the approved address for a rare item _approved The new approved rare item controller _tokenId The rare item to approve
function approve(address _approved, uint256 _tokenId) external isValidToken(_tokenId) onlyOwnerOf(_tokenId) payable { address owner = IndexToOwner[_tokenId]; require(operatorToApprovals[owner][msg.sender]); IndexToApproved[_tokenId] = _approved; Approval(owner, _approved, _tokenI...
10,507,532
/** *Submitted for verification at Etherscan.io on 2021-07-05 */ pragma solidity =0.8.0; // SPDX-License-Identifier: MIT /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() exter...
Delegate votes from `msg.sender` to `delegatee` delegatee The address to delegate votes to/
function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); }
1,995,263
./full_match/1/0xC68a8c6A29412827018A23058E0CEd132889Ea48/sources/src/strategies/PancakeSwapPulseStrategyV2.sol
Rebalancing goes like this: 1. Function checks the current states of the pools, and if the volatility is significant, the transaction reverts. 2. If necessary, a new position is minted on pancakeSwapVault, and the previous one is burned. 3. Tokens on erc20Vault are swapped via AggregationRouterV5 so that the proportion...
function rebalance( uint256 deadline, bytes calldata swapData, uint256 minAmountOutInCaseOfSwap ) external { require(block.timestamp <= deadline, ExceptionsLibrary.TIMESTAMP); _requireAtLeastOperator(); ImmutableParams memory immutableParams_ = immutableParams; ...
16,471,534
./full_match/1/0x162A78B8bbB2c7dbD6D7aceC507EF9625d2b34E4/sources/contracts/savings/Bank.sol
updateTotalLoan(_token);
function update( address _token, uint256 _amount, ActionType _action ) public onlyAuthorized returns (uint256 compoundAmount) { updateTotalCompound(_token); compoundAmount = updateTotalReserve(_token, _amount, _action); return compoundAmount; }
17,083,676
./full_match/1/0x4C3c31518D525d1e1657DBef952A98AA807bC19a/sources/lib/ERC721A/contracts/ERC721A.sol
Flag that specifies whether an ownership timestamp should be updated every transfer Setting this to false effectively stores the mint time of the token./
function _updateTimestampOnTransfer() internal virtual returns(bool) { return true; }
9,736,607
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import {Utilities} from "../../utils/Utilities.sol"; import "forge-std/Test.sol"; import {DamnValuableToken} from "../../../src/Contracts/DamnValuableToken.sol"; import {PuppetPool} from "../../../src/Contracts/puppet/PuppetPool.sol"; interface UniswapV1Exchan...
Attacker has taken all tokens from the pool
function validation() internal { assertEq(dvt.balanceOf(attacker), POOL_INITIAL_TOKEN_BALANCE); assertEq(dvt.balanceOf(address(puppetPool)), 0); }
6,415,748
./full_match/43114/0x594D5519c2BCBFd5D21aa9FA6755312caA31CFd4/sources/contracts/liquid-yield/LyRedistributor.sol
Account for any incoming rewards, to be distributed, as well as reward outflows in reserve
function updateRewardTotal() public { uint256 totalStaked = stakeToken.balanceOf(address(this)); for (uint256 i; rewardTokens.length > i; i++) { RewardToken storage r = rewardTokens[i]; IERC20 token = IERC20(r.token); uint256 balance = token.balanceOf(address(this...
4,513,045
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; pragma experimental ABIEncoderV2; import "contracts/v1/ARDImplementationV1.sol"; import "@openzeppelin/contracts/utils/Checkpoints.sol"; //import "hardhat/console.sol"; /** * @title Staking Token (STK) * @author Gheis Mohammadi * @dev Implements a staking Prot...
initials tokens, roles, staking settings and so on. this serves as the constructor for the proxy but compiles to the memory model of the Implementation contract./ contract can mint the rewards set last stake idenable staking by defaultenable early unstaking
function initialize(string memory name_, string memory symbol_, address newowner_) public initializer{ _initialize(name_, symbol_, newowner_); _setupRole(MINTER_ROLE, address(this)); _lastStakeID = 0; stakingEnabled=true; earlyUnstakingAllowed=true; }
12,911,959
// solium-disable linebreak-style pragma solidity ^0.4.24; /** * @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 { // Owner's address address publ...
Transfer tokens from one address to another. Only callable by the convert contract. Used in the process of converting AORATGE to AORA. Will be called from convert contracts convert() function. _from address The address which you want to send tokens from _to address The address which you want to transfer to. Onl...
function transferFrom( address _from, address _to, uint256 _value ) onlyConvert public returns (bool) { require(_value <= balances[_from]); require(_to == address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value...
7,290,000
pragma solidity ^0.4.17; import './Ownable.sol'; contract WhiteListAccess is Ownable { mapping (address => bool) whitelist; modifier onlyWhitelisted {require(whitelist[msg.sender]); _;} function isAddressWhiteList(address _address) public view returns (bool) { return whitelist[_address]; } ...
Adds single address to whitelist. trusted Address to be added to the whitelist/
function addToWhiteList(address trusted) external onlyOwner { whitelist[trusted] = true; }
5,490,041
./partial_match/1/0x44BFaa83cb8E4645d91A27De0866762Bbd63F2dE/sources/VaultXPStake.sol
A method for a stakeholder to remove a stake. _stake The size of the stake to be removed./Tax users 5%
function removeStake(uint256 _stake) public { stakes[msg.sender] = stakes[msg.sender].sub(_stake); if(stakes[msg.sender] == 0) removeStakeholder(msg.sender); _burn(msg.sender, _stake); }
2,596,281
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_759(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,472
// SPDX-License-Identifier: MIT pragma solidity >=0.4.25 <0.7.0; import '@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/math/MathUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol'; import '@openzeppelin/con...
uint256 amountForBidder = amountBought.mul(10526315789473685).div(1e17);
function updateTokenPricePerShare( address payable bidderAddress, address payable originAddress, address tokenAddress, uint256 amountBought ) external payable override onlyAuction { uint256 amountForOrigin = amountBought.mul(5).div(100); uint256 amountForBidder = ...
1,552,342
//Address: 0xca6bea8e144b0a6aebbb412e6ad0e7ff1959235e //Contract name: EtherConsole //Balance: 0 Ether //Verification Date: 2/24/2018 //Transacion Count: 19 // CODE STARTS HERE pragma solidity ^0.4.18; /// Item23s :3 /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter S...
For querying owner of token _tokenId The tokenID for owner inquiry Required for ERC-721 compliance.
function ownerOf(uint256 _tokenId) public view returns (address owner) { owner = item23IndexToOwner[_tokenId]; require(owner != address(0)); }
15,808,961
pragma solidity >=0.5.0 <0.6.0; import "./AltBn128.sol"; import "./LSAG.sol"; contract Heiswap { // Events event Deposited(address, uint256 etherAmount, uint256 idx); // Default Relayer Address address payable public relayerAddress = 0x20a4b066fc4F70b0245B43e2F5a781C6d1030748; // Maximum number ...
Floors the current ether values Makes sure the values needs to in `allowedAmounts` Floors received ether
function floorEtherAndCheck(uint256 receivedAmount) internal view returns (uint256) { uint256 i; bool allowed = false; uint256 receivedEther = (receivedAmount / 1 ether) * 1 ether; for (i = 0; i < 10; i ++) { if (allowedAmounts[i] == receivedEther) { ...
12,901,990
// File: @openzeppelin/contracts-ethereum-package/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 assum...
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint256 blockNumber) public override view returns (uint256) { require( blockNumber < block.number, "ERC20VoteableUpgradeSafe: getPriorVotes: not yet determined" ); uint256 nCheckpoints = _num...
417,497
./partial_match/1/0xe324C8cF74899461Ef7aD2c3EB952DA7819aabc5/sources/ResolveToken.sol
Big red exit button to pull all of a holder's Ethereum value from the contract
function getMeOutOfHere() public { sellAllBonds(); withdraw( resolveEarnings(msg.sender) ); }
9,382,038
/* Copyright 2020 ZeroEx Intl. 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 applicable law or agreed to in writing,...
Retrieve the length of the rollback history for a function. selector The function selector. return rollbackLength The number of items in the rollback history for the function.
function getRollbackLength(bytes4 selector) external override view returns (uint256 rollbackLength) { return LibSimpleFunctionRegistryStorage.getStorage().implHistory[selector].length; }
5,368,693
./partial_match/1/0xE0dBED169e1a51375bd7E9B15B733bC8507338d7/sources/FirstBot.sol
set maximum transaction
function removeLimits() public onlyOwner { _maxTxSizeAmount = _tTotal; _maxWalletLimitSize = _tTotal; }
16,125,311
./full_match/80001/0x35C94EcA841160336c4b4bd648b55e52034448e1/sources/contracts/Contract.sol
Returns the value stored at position `index` in the set. O(1). Note that there are no guarantees on the ordering of values inside the array, and it may change when more values are added or removed. Requirements: - `index` must be strictly less than {length}./
function at( UintSet storage set, uint256 index ) internal view returns (uint256) { return uint256(_at(set._inner, index)); }
873,126
./full_match/80001/0xE5c8D133c3dBD7062bAe47b9323bB7ADEd006C38/sources/project_/contracts/ERC5006.sol
See {IERC165-supportsInterface}.
function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC1155Receiver, ERC1155) returns (bool) { return interfaceId == type(IERC5006).interfaceId || super.supportsInterface(interfaceId); }
5,573,673
pragma solidity ^0.4.4; import "./BaseBountyContract.sol"; import "./BaseChallengerContract.sol"; // Part of the PutYourMoneyWhereYourContractIs (bit.do/pymwyci) project. /** * @title creates and manages bounties. * * Responsible for running bounties. Authors of contracts can register their * BountyContract an...
Formally initiates a challenge with contractTest. This call must be made with a deposit of at least DEPOSIT_PERCENTAGE 0.01 bounty sum, after which the challenger receives exclusive rights to attack the targetContract for NUM_BLOCKS_LOCKED blocks. NOTE: the deposit is returned only if the challenge succeeds (on top o...
function initiateChallenge(address bountyContract) payable { BountyInfo bountyInfo = bounties[bountyContract]; if (!bountyInfo.exists) throw; if (block.number > bountyInfo.runsUntilBlock) throw; if (block.number <= bountyInfo.lockedUntilBlock) throw; if (msg.value * ...
6,435,192
// SPDX-License-Identifier: MIT /* ............................................................................................................................................ ............................................................................................................................................ ....
verify contract is not pausedvalidate all tokens being claimed and aggregate a total cost due
) external payable { require(!paused(), "Claim: claiming is paused"); function claimMultiple( uint256[] calldata numPasses, uint256[] calldata amounts, uint256[] calldata mpIndexs, bytes32[][] calldata merkleProofs for (uint i=0; i< mpIndexs.length; i++)...
6,854,018
pragma solidity ^0.4.16; interface Filesystem { function createFileWithContents(string name, uint nonce, bytes32[] arr, uint sz) external returns (bytes32); function getSize(bytes32 id) external view returns (uint); function getRoot(bytes32 id) external view returns (bytes32); function getData(bytes32 id...
need some way to get next state, perhaps shoud give all files as args
function scrypt(bytes data) public view returns (bytes32) { return result[data]; }
15,811,670
/** *Submitted for verification at Etherscan.io on 2022-03-02 */ // Sources flattened with hardhat v2.7.0 https://hardhat.org // File sol-temple/src/tokens/[email protected] pragma solidity >=0.8.0 <0.9.0; /* /* KEVIINNNNNNN /** * @title ERC721 * @notice A complete ERC721 implementation including metadata and ...
Returns a list of all token Ids owned by `owner`.
function walletOfOwner(address account_) public view returns (uint256[] memory) { uint256 balance = balanceOf(account_); uint256[] memory ids = new uint256[](balance); for (uint256 i = 0; i < balance; i++) { ids[i] = tokenOfOwnerByIndex(account_, i); } return ids; }
1,994,568
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "./ZombieFactory.sol"; // 僵尸助手合约 contract ZombieHelper is ZombieFactory { // 升级费用 uint public levelUpFee = 0.0001 ether; // 判断僵尸大于指定等级 modifier aboveLevel(uint level, uint zombieId) { require(zombies[zombieId].level ...
自定义僵尸DNA(需为自己所拥有的僵尸并且等级至少20级)
function changeDna(uint zombieId, uint dna) external aboveLevel(20, zombieId) onlyOwnerOf(zombieId) { zombies[zombieId].dna = dna; }
6,375,436
./full_match/5/0x083958FdA091516D1960c59d232500B36A256D56/sources/contracts/NftRentMarketplace.sol
emit ItemListed(msg.sender, nftAddress, tokenId, newListing.expiration, newListing.price);
function addS_listing(address nftAddress, uint256 tokenId, Listing memory newListing) internal{ s_listings[nftAddress][tokenId] = newListing; activeListings.push(newListing); }
1,928,166
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../token/WePiggyToken.sol"; contract FundingManager is Ownable { using SafeMath for uint256; struct FundingHolderInfo { uint256 rat...
Return the pool pending balance.
function getPendingBalance(uint256 pid) public view returns (uint256){ FundingHolderInfo storage fhi = fundingHolders[pid]; uint256 piggyBal = piggy.balanceOf(address(this)); uint _amount = piggyBal.mul(fhi.ratio).div(100); return _amount; }
1,078,009
./full_match/1/0x91b3acfb92BCEf1DE4D5069e95140Ea0C9218695/sources/browser/WebaverseERC20Proxy.sol
0x08E242bB06D85073e69222aF8273af419d19E4f6, 1, 10, 0xc336b0bb5cac4584d79e77b1680ab789171ebc95f44f68bb1cc0a7b1174058ad, 0x72b888e952c0c39a8054f2b6dc41df645f5d4dc3d9cc6118535d88aa34945440, 0x1c
function withdraw(address to, uint256 amount, uint256 timestamp, bytes32 r, bytes32 s, uint8 v) public { bytes memory message = abi.encodePacked(to, amount, timestamp, chainId); bytes32 messageHash = keccak256(message); bytes32 prefixedHash = keccak256(abi.encodePacked(prefix, messageHash));...
3,176,242
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "./AAVE/IERC20.sol"; import "./AAVE/IWETHGateway.sol"; import "./AAVE/IAToken.sol"; contract Lend { address admin; uint lastATokenBalance; address[] userIndex; struct UserStruct { uint totalDeposited; uint aTokenBalance; ...
Read a user balance from the contract
function balanceOf(address _account) external view returns (uint) { return userStructs[_account].aTokenBalance; }
12,898,285