file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/11155111/0x78d4862D7f9CC15cD723F41C2F2536153b9E7Da8/sources/contracts/KDrive.sol
require(_user==msg.sender || ownership[_user][msg.sender],"You don't have access");
function display(address _user) external view returns (string[] memory) { return value[_user]; }
3,804,256
./partial_match/1/0xdc7300622948a7AdaF339783F6991F9cdDD79776/sources/AllowedRecipientsRegistry.sol
Returns current list of allowed recipients
function getAllowedRecipients() external view returns (address[] memory) { return allowedRecipients; }
2,704,340
pragma solidity 0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint25...
Private/ Cancel sale. Should not be called without checking if champ is really for sale.cancel champ's saleno need waste gas to overwrite his price.
function _cancelChampSale(Champ storage champ) private { champ.forSale = false; champsForSaleCount--; }
6,456,985
./full_match/42/0xBFf88E8Ef9919b88104Dfc767B892852294259b7/sources/assignmentTokenSkel.sol
TODO: return total supply
function totalSupply() public view returns (uint256) { return supply; }
9,587,163
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Returns the cached logarithm of the total supply./
function logTotalSupply(bytes32 data) internal pure returns (int256) { return data.decodeInt22(_LOG_TOTAL_SUPPLY_OFFSET); }
67,515
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "./Ownable.sol"; import "./IERC20.sol"; import "./SafeERC20.sol"; interface IMigratorToBavaSwap { // Perform LP token migration from legacy UniswapV2 to BavaSwap. // Take the current LP token address and return the new LP token a...
View function to see pending Bavas on frontend. uint256 lpSupply = pool.lpToken.balanceOf(address(this));
function pendingReward(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accBavaPerShare = pool.accBavaPerShare; uint256 lpSupply = pool.depositAmount; if (block.number...
1,046,996
pragma solidity 0.5.16; import "../base/Owned.sol"; /** * @title Timelock * @author Authereum Labs, Inc. * @dev Used to make changes to contracts with a known time lock. * @dev The goal of this contract is to make the public aware of contract changes made * @dev by the contract owners. This will keep the owners ...
Execute change _data Data that will be the change _changeAddress Address that will receive the data
function executeChange(bytes memory _data, address _changeAddress) public payable onlyOwner { require(getCurrentChangeState(_data, _changeAddress) == ChangeState.Changeable, "T: Change not able to be made"); delete changes[_data][_changeAddress]; _changeAddress.call.value(msg.value)(_data); ...
12,724,788
./full_match/4/0x7b97D3b7B59Ee46765189D6492753E82D3155Ff2/sources/Agape_Coin.sol
A method to the aggregated rewards from all stakeholders. return uint256 The aggregated rewards from all stakeholders./
function totalRewards() public view returns(uint256) { uint256 _totalRewards = 0; for (uint256 s = 0; s < stakeholders.length; s += 1){ _totalRewards = _totalRewards.add(rewards[stakeholders[s]]); } return _totalRewards; }
719,296
pragma solidity ^0.4.18; contract Ownable { address public owner; function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { ...
NOTE: verify that a contract is what we expect - https:github.com/Lunyr/crowdsale-contracts/blob/cfadd15986c30521d8ba7d5b6f57b4fefcc7ac38/contracts/LunyrToken.solL117
function setDiamondAuctionAddress(address _address) external onlyCEO { DiamondAuction candidateContract = DiamondAuction(_address); require(candidateContract.isDiamondAuction()); diamondAuction = candidateContract; }
14,059,908
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view ret...
Allows the pendingAdmin address to finalize the change admin process./
function claimAdmin() public { require(pendingAdmin == msg.sender, "not pending"); emit AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); }
47,451
/** *Submitted for verification at Etherscan.io on 2022-03-11 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.11; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes call...
exclude from paying fees or having max transaction amount
constructor() ERC20("YUMMI", "YUMMI") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Fa...
2,419,260
./partial_match/80001/0x11AB5b46C42EfBB73c0264093fbF764Eeb619047/sources/contracts/libs/WitnetEncodingLib.sol
Encode uint64 into tagged varint. See https://developers.google.com/protocol-buffers/docs/encodingvarints. n Number t Tag return buf Marshaled bytes Count the number of groups of 7 bits We need this pre-processing step since Solidity doesn't allow dynamic memory resizing Set the first bit in the byte for each group ...
function encode(uint64 n, bytes1 t) public pure returns (bytes memory buf) { unchecked { uint64 tmp = n; uint64 numBytes = 2; while (tmp > 0x7F) { tmp = tmp >> 7; numBytes += 1; } buf = new bytes(...
8,800,093
pragma solidity ^0.4.0; interface Hash { function get() public returns (bytes32); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; ...
MAIN SECRET!calc ticket hash from baseHash and user datanobody knows baseHashupdate base hash for next ticketsset winner if this is a best hash in roundautomatically finish and start new round if max ticket amount is raised
function processTicketBuying(string data, uint value, address sender) private { bytes32 hash = sha256(data, baseHash); baseHash = sha256(hash, baseHash); if (periods[currentPeriod].ticketAmount == 0 || (hash < periods[currentPeriod].winnerHash)) { periods[currentPeriod].winnerHash = hash; ...
999,779
./partial_match/44787/0xED9F717ad775223aEdf226724d7813B4e3E7e808/sources/_ndujalabs/erc721lockable/contracts/IERC721Lockable.sol
ERC165 interface id is 0x2e4e0d27 tells if a token is locked. Removed to extend IERC5192 function locked(uint256 tokenID) external view returns (bool); tells the address of the contract which is locking a token tells if a contract is a locker set a locker, if the actor that is locking it is a contract, it should be app...
interface IERC721Lockable is IERC5192 { event LockerSet(address locker); event LockerRemoved(address locker); event ForcefullyUnlocked(uint256 tokenId); function lockerOf(uint256 tokenID) external view returns (address); function isLocker(address _locker) external view returns (bool); function setLocker...
16,956,653
./partial_match/42/0x240478D74Ac8469F1834498d00f28cFAd888288b/sources/CyclopsBank.sol
amount == amount of tokens if ERC20 or amount of ETH or token_ids.length of ERC721, token_ids - array of token ids if ERC721, or empty array if ERC20
function deposit(uint256 amount, uint256[] calldata token_ids, uint32 profile_id, uint32 famer_id) nonReentrant payable public { (uint32 p_id, string memory p_name, uint8 p_dep_type,address p_tok_addr,,) = depProfilesRegister.getDepositProfileById(profile_id); require(p_id != BAD_DEPOSIT_PROFILE_ID...
8,871,760
/** * @authors: [@unknownunknown1] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [] */ /* solium-disable security/no-block-members */ /* solium-disable max-len*/ pragma solidity ^0.4.24; import "@kleros/kleros-interaction/contracts/standard/arbitration/Arbitrable.sol"; import "@kleros/k...
Gets the number of lists submitted in this session. return The number of submitted lists./
function getNumberOfSubmittedLists() public view returns (uint){ return submittedLists.length; }
1,009,229
pragma solidity ^0.5.11; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIAB...
Check if an airline is registered return A bool that indicates if the airline is registered/
function isAirlineRegistered(address account) external view returns (bool) { return airlines[account].isRegistered; }
7,327,190
pragma solidity ^0.4.11; contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } contract MessageToken { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 p...
Allow message contract to spend some tokens in your behalf /
function approve(address _spender, uint256 _value) returns (bool success) { if(msg.sender == owner){ EMSAddress = _spender; allowance[this][_spender] = _value; return true; } }
6,461,527
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.4; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot ...
入金token in, 为还款和存款的组合没有借款时,无需还款,有借款时,先还款,单独写一个进行入金,而不是直接调用mint和repay,原因在于在ETH存款时会有bug,msg.value会复用。先进行冲账操作还清欠款 还款数量有剩余,转为存款
function tokenIn(address token, uint256 amountIn) public payable whenUnpaused rewardFor(msg.sender, RewardType.TokenIn) { IFToken fToken = IFToken(controller.getFTokeAddress(token)); require( controller.marketsContains(address(fToken)), "un...
516,778
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.7; contract Bank{ bool inited; string name; User[] userList; mapping(address => User) users; mapping(address => Account) accounts; mapping(address => uint) balances; //TODO function setup(string calldata _name...
Create an account by given name/
function openMyAccount(string calldata _username) external returns(address){ require(users[msg.sender].addr == address(0)); require(accounts[msg.sender].state == STATE.INACTIVE); User memory owner = newUser(_username); userList.push(owner); Account memory newA...
894,065
pragma solidity ^0.4.15; /* https://cryptogs.io --Austin Thomas Griffith --ETHDenver */ import './NFT.sol'; import '../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol'; contract Cryptogs is NFT, Ownable { string public constant name = "Cryptog"; string public constant symbol = "TOGS"; ...
tx7 player throws slammerit is player2's turnit is player1's turncommit/reveal failed.. this can happen if theyreload, so don't punish, just go back to thestart of the slammer raisesuccessful slam!!!!!!!!!!!! At this point I have officially been awake for 24 hours !!!!!!!!!!Debug(_reveal,block.blockhash(block.number-1)...
function throwSlammer(bytes32 _stack, bytes32 _counterStack, bytes32 _reveal) public returns (bool) { if(lastActor[_stack]==stacks[_stack].owner){ require(stacks[_counterStack].owner==msg.sender); require(stacks[_stack].owner==msg.sender); } if(keccak256(_reveal)!=commit[_stack]){...
12,881,493
pragma solidity ^0.5.2; // File: openzeppelin-solidity/contracts/access/Roles.sol /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role ...
Caller needs to provide a proof of the transfer (proof). A Deposit event will be emitted for the foundation server to mint the corresponding wrapped tokens to the dest_addr on the destination chain. main_token: The token to deposit with. chain_id: The id of destination chain. alt_addr: The address to mint to on the des...
function depositToken( address main_token, uint256 chain_id, bytes memory alt_addr, uint256 value ) public whenNotPaused breakoutRegistered(chain_id, main_token) validAmount(chain_id, main_token, value) { bytes memory cloned_token = breakoutTokens[main_token][chain_id]; emit Deposit(chain_id, ...
12,924,876
./full_match/5/0x8343381223E299090E20EB0076443606e05ed3c3/sources/project_/contracts/PeliWalletFacade.sol
Returns to normal state if and only if the contract is paused
function unpause() external onlyOwner { _unpause(); }
11,615,861
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "../StratBase.sol"; import "../../Interface...
pauses deposits and withdraws all funds from third party systems.
function panic() public onlyManager { pause(); lpStaking.emergencyWithdraw(pid); }
6,934,506
/** *Submitted for verification at Etherscan.io on 2021-09-09 */ pragma solidity ^0.4.19; contract Pixereum { struct Pixel { address owner; string message; uint256 price; bool isSale; } mapping (uint16 => Pixel) private pixels; uint24[10000] ...
set a new sale state
function setSaleState(byte _x, byte _y, bool _isSale) public { uint16 pixelNumber = getPixelNumber(_x, _y); if (pixels[pixelNumber].owner == msg.sender) { pixels[pixelNumber].isSale = _isSale; } }
15,294,882
//Address: 0xd35504e0f9bdcf8bca1ce7ec51fa2db514029182 //Contract name: EmployeesList //Balance: 0 Ether //Verification Date: 6/16/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.11; contract Ownable { // replace with proper zeppelin smart contract address public owner; function Ownable() ...
options are stored in unit32
{ function openESOP(uint32 pTotalPoolOptions, bytes pESOPLegalWrapperIPFSHash) external onlyCompany onlyESOPNew isCurrentCode returns (ReturnCodes) if (pTotalPoolOptions > 1100000 || pTotalPoolOptions < 10000) { return _logerror(ReturnCodes.InvalidParameters); } totalPoolOptio...
5,497,849
./full_match/1/0x25127685dC35d4dc96C7fEAC7370749d004C5040/sources/unibot_token.sol
See { IERC20-balanceOf} ./
function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; }
17,004,630
./full_match/84531/0x4be64962b10489373DdAAB6ed45B79a8Aa155DDf/sources/stake-token/contracts/ImStaking.sol
Lock the IM in the contract
function stake(uint256 _amount) external { calcReward(); startLockTime[_msgSender()] = block.timestamp; _stakeBalances[_msgSender()] += _amount; totalStaking += _amount; require(im.transferFrom(_msgSender(), address(this), _amount) == true, "Stake failed"); emit Sta...
14,301,923
./partial_match/1/0xeF0dfe8cF872B4dF3681Ad37A17Ef5e2D473B877/sources/SCMinter.sol
Calculates the amount of the stableswap fee
function amountFeeSwap( address stableIn, address stableOut, uint256 usdPriceIn, uint256 usdPriceOut, uint256 amountOut ) public view returns(uint256) { return (amountOut * feeSwap(stableIn, stableOut, usdPriceIn, usdPriceOut, amountOut)) / 1e6; } ...
4,037,188
./full_match/1/0x9db4694BE49558ba5F3CD4C449988fc0AeBa6E94/sources/contracts/Vault.sol
Adds uint16 to uint16 safely a First number b Second number errorMessage Error message to use if numbers cannot be added return uint16 number/
function _add16(uint16 a, uint16 b, string memory errorMessage) internal pure returns (uint16) { uint16 c = a + b; require(c >= a, errorMessage); return c; }
3,846,915
./full_match/5/0x06F03D79C9a1436c32CD1b71230690eca78f4F74/sources/contracts/GenesisRocket.sol
Authoried Contract for burn/migration functionality
function setAuthorizedContract(address authorizedContract) external onlyRolesOrOwner(ADMIN_ROLE) { _authorizedContract = authorizedContract; }
1,928,605
./partial_match/1/0x4D0F56d728c5232ab07fAA0BdcbA23670A35451f/sources/AggregatedFinance.sol
Check the signature length - case 65: r,s,v signature (standard) - case 64: r,vs signature (cf https:eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ ecrecover takes the signature parameters, and the only way to get them currently is to use assembly.
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; assembly { r := mload(add(signature, 0x20)) s := ...
15,755,558
./full_match/5/0x94571FA1995B3052302fd027CC7a3ABAca1Ab358/sources/browser/WXMR.sol
/ Destroys `amount` tokens from the caller. See {ERC20-_burn}./
function burn(uint256 amount) public whenNotPaused{ _burn(_msgSender(), amount); }
1,904,860
./partial_match/1/0xdDc2c27eA8a42b35B329c4e0216600F12EED13d1/sources/contracts/wombat-core/pool/PoolV3.sol
Quotes potential withdrawal from pool To be used by frontend token The token to be withdrawn by user liquidity The liquidity (amount of lp assets) to be withdrawn return amount The potential amount user would receive/
function quotePotentialWithdraw(address token, uint256 liquidity) external view override returns (uint256 amount) { _checkLiquidity(liquidity); IAsset asset = _assetOf(token); (amount, , ) = CoreV3.quoteWithdrawAmount( asset, liquidity, ampFactor, ...
2,762,449
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import "./exchange/Exchange.sol"; import "./registry/ProxyRegistry.sol"; import "./modules/TokenTransferProxy.sol"; import "./modules/ERC20.sol"; contract PaceArtExchange is Exchange { string public constant name = "Project Wyvern Exchange"; string pub...
Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock. buy Buy-side order buySig Buy-side order signature sell Sell-side order sellSig Sell-side order signature/ CHECKS / Ensure buy order validity and calcula...
function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata) internal reentrancyGuard { bytes32 buyHash; if (buy.maker == msg.sender) { require(validateOrderParameters(buy)); buyHash = requireValidOrder...
12,647,029
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity ^0.7.5; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "./LendingRegistry.sol"; import "../../interfaces/IExperiPie....
/ unlend token _amount or actual balance, whatever is lessUnlend token if needed add underlying if needed remove wrapped
function unlend(address _wrapped, uint256 _amount) public onlyOwner nonReentrant { uint256 amount = _amount.min(IERC20(_wrapped).balanceOf(address(basket))); (address[] memory _targets, bytes[] memory _data) = lendingRegistry.getUnlendTXData(_wrap...
12,812,742
/** *Submitted for verification at Etherscan.io on 2022-05-02 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.11; // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the...
@inheritdoc IAaveEcosystemReserveController
function createStream( address collector, address recipient, uint256 deposit, IERC20 tokenAddress, uint256 startTime, uint256 stopTime ) external onlyOwner returns (uint256) { return IStreamable(collector).createStream( recipien...
10,619,417
./full_match/80001/0x271e7Ba38970356FBbE4b57912b76325F3C8731e/sources/contracts/Utils.sol
Addition of a signed int256 to an unsigned uint256, returning a unsigned uint256, (implicitly) checked for over/underflow./
function add(uint256 a, int256 b) internal pure returns (uint256) { if (b >= 0) { return a + uint256(b); return a - uint256(-b); } }
5,639,212
./full_match/4/0xd27f0A01bBA4C2C80D367836074aD425e9F868FE/sources/lotery.sol
0xd9145CCE52D386f254917e481eB44e9943F39138
function claimReward (uint256 blockNumber_) external nonReentrant { require(blockNumber_ > 0, "number can not zero"); require(blockNumber_ <= (block.number - 100), "must less than 100 block from now"); require(_stakeMap[blockNumber_][_msgSender()].owner == _msgSender(), "must exist"); ...
814,975
./partial_match/1/0x989E1Fb123b67afd66e10574c8B409bC6e812D9A/sources/DragonCore.sol
Marks an address as being approved for transferFrom(), overwriting any previous approval. Setting _approved to address(0) clears all transfer approval. NOTE: _approve() does NOT send the Approval event. This is intentional because _approve() and transferFrom() are used together for putting Dragons on auction, and t...
function _approve(uint256 _tokenId, address _approved) internal { dragonIndexToApproved[_tokenId] = _approved; }
2,699,274
./full_match/4/0xc431fd2835210c80a56BB1DfbDF4F424616f0c96/sources/contracts/ANTZ/AtomicAntzNFTCollection.sol
Claim up to 20 antz at once/
function mintAntz( uint256 amount ) external payable callerIsUser claimStarted { require( msg.value == mintPrice * amount, "Not enough Ether to claim the antz" ); require( amount <= maxAntzPerTransaction, "You can only claim 20 Antz per transactions" ); require( claimedAntzPerWallet[msg.sender] + amount <= maxAn...
13,367,539
./full_match/80001/0x1Ce2a44c19963Db85E5a08d65F23E3029f3dbCda/sources/Lottery.sol
this function is used to get the winners adress
function getWinningsForAddress(address addr) public view returns (uint256) {
9,460,596
pragma solidity 0.8.0; // SPDX-License-Identifier: MIT import "./InscribeInterface.sol"; import "./InscribeMetaDataInterface.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract In...
Removes an inscription on-chain after all requirements were met/ Clear approvals from the previous inscriber Remove Inscription
function _removeInscription(uint256 inscriptionId, address nftAddress, uint256 tokenId) private { _approve(address(0), nftAddress, tokenId); address inscriber = _inscribers[inscriptionId]; delete _inscribers[inscriptionId]; delete _locationHashes[inscriptionId]; del...
4,800,512
./partial_match/1/0x14cC8DfaF2258E1B8B2869300dBa1B734dc0fE43/sources/KtuneTokenBlocks.sol
Add a new payee to the contract. account The address of the payee to add. shares_ The number of shares owned by the payee./
function _addPayee(address account, uint256 shares_) private { require(account != address(0)); require(shares_ > 0); require(_shares[account] == 0); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares.add(sha...
2,737,092
./full_match/10200/0x34E520dc1d2Db660113b64724e14CEdCD01Ee879/sources/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol
Changes the `jurorsForCourtJump` property value of a specified subcourt. _subcourtID The ID of the subcourt. _jurorsForCourtJump The new value for the `jurorsForCourtJump` property value./
function changeSubcourtJurorsForJump(uint96 _subcourtID, uint256 _jurorsForCourtJump) external onlyByGovernor { courts[_subcourtID].jurorsForCourtJump = _jurorsForCourtJump; }
3,785,037
./full_match/1/0x44B7895989Bc7886423F06DeAa844D413384b0d6/sources/src/BorrowController.sol
Checks if the price for the given market is stale. market The address of the market for which the price staleness is to be checked. return bool Returns true if the price is stale, false otherwise./
function isPriceStale(address market) public view returns(bool){ uint marketStalenessThreshold = stalenessThreshold[market]; if(marketStalenessThreshold == 0) return false; IOracle oracle = IMarket(market).oracle(); (IChainlinkFeed feed,) = oracle.feeds(IMarket(market).collateral());...
4,913,521
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol
Reads the uint248 at `rdPtr` in returndata.
function readUint248( ReturndataPointer rdPtr ) internal pure returns (uint248 value) { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) } }
3,218,511
./full_match/11155111/0xc9241Cf4cD7d9569cA044d8202EF1080405Bc6C9/sources/src/DripsHub.sol
Updates the driver address. Must be called from the current driver address. driverId The driver ID. newDriverAddr The new address of the driver. It should be a smart contract capable of dealing with the DripsHub API. It shouldn't be an EOA because the API requires making multiple calls per transaction.
function updateDriverAddress(uint32 driverId, address newDriverAddr) public whenNotPaused { _assertCallerIsDriver(driverId); _dripsHubStorage().driverAddresses[driverId] = newDriverAddr; emit DriverAddressUpdated(driverId, msg.sender, newDriverAddr); }
3,827,072
/* https://lumberscout.io : aut viam inveniam aut faciam */ pragma solidity ^0.4.19; /** * @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 b...
Prevent the development fund from transferring its tokens while they are locked
function transfer(address _to, uint256 _value) public returns (bool) { if (msg.sender == developmentFundAddress && now < developmentFundUnlockTime) revert(); super.transfer(_to, _value); }
12,754,493
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "../libs/Ownable.sol"; import "./ERC20ForwarderStorage.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath...
enable dApps to change the contract that manages fee collection logic _feeManager : the address of the contract that controls the charging of fees /
function setFeeManager(address _feeManager) external onlyOwner{ require( _feeManager != address(0), "ERC20Forwarder: new fee manager can not be a zero address" ); feeManager = _feeManager; }
14,015,569
/** *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...
Override this to add all tokens/tokenized positions this contract manages on a persistent basis (e.g. not just for swapping back to want ephemerally). NOTE: Do not include `want`, already included in `sweep` below. Example: function protectedTokens() internal override view returns (address[] memory) { address[]...
function protectedTokens() internal view virtual returns (address[] memory); function sweep(address _token) external onlyOwner { require(_token != address(want), "!want"); require(_token != address(vault), "!shares"); address[] memory _protectedTokens = protectedTokens(); for (...
6,580,025
./full_match/4/0x2Cf67353A508Fc752b166ABC53cf31B3effD82Db/sources/ArbitrageInterfaceV2.sol
ajoute, remplace ou supprime un swapper
function setSwapper(address factory, ISwapper swapper) override public onlyOwner { swappers[factory] = swapper; }
12,347,422
pragma solidity ^0.5.8; /** * @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); function tra...
Look up for the owner role on providen address _who is address to look up return A boolean of owner role
function isOwner(address _who) public view returns (bool) { return owner == _who; }
5,456,096
/* Copyright 2017-2018 RigoBlock, Rigo Investment Sagl. 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 a...
Finds the administrative data of the pool. return Address of the account where a user collects fees. return Address of the drago dao/factory. return Number of the fee split ratio. return Value of the transaction fee in basis points. return Number of the minimum holding period for shares.
function getAdminData() external view returns ( address feeCollector, address dragoDao, uint256 ratio, uint256 transactionFee, uint32 minPeriod ) { return ( owner, admin.feeCollector, ...
5,350,125
./full_match/4/0x395CeE958F302349Ce4a91EFa0A531Be938Fdb06/sources/mefi/MergedOracle.sol
Displays the amount of MDT that is available for the node operator to withdraw We use `ONE_FOR_CONSISTENT_GAS_COST` in place of 0 in storage return The amount of withdrawable MDT on the contract/
function withdrawable() external view override(OracleInterface, WithdrawalInterface) onlyOwner() returns (uint256) { return withdrawableTokens.sub(ONE_FOR_CONSISTENT_GAS_COST); }
13,320,092
// File: contracts\modules\Ownable.sol pragma solidity =0.5.16; /** * @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 will make available the ...
retrieve all information for net worth calculation. whiteList collateral address whitelist./
function getNetWrothCalInfo(address[] memory /*whiteList*/)public view returns(uint256,int256[] memory){ delegateToViewAndReturn(); }
10,419,418
/* Alopecia Areata: The shame and embarrassment of this disease devastates the lives of too many women and girls when treatments do not work. Since 2007 Bald Girls Do Lunch has connected with over 3,000 to restore self-confidence and conquer isolation. With requests for meet-ups in every state and beyond the USA, B...
exclude from paying fees or having max transaction amount
constructor() ERC20("Alopecia", "ALOPECIA") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = ...
1,279,624
contract test { uint256 stateVar; /// This is test function 1 function functionName1(bytes32 input) returns (bytes32 out) {} /// This is test function 2 function functionName2(bytes32 input) returns (bytes32 out) {} // nothing to see here function functionName3(bytes32 input) returns (bytes32 out) {} //...
This is test function 4
function functionName4(bytes32 input) returns (bytes32 out) {}
12,745,406
// SPDX-License-Identifier: MIT pragma solidity >=0.7.2; pragma experimental ABIEncoderV2; import {CompoundUtils} from "../utils/CompoundUtils.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import {SafeMath} fro...
get back collateral from Compound/
function redeemERC20(address _cToken, uint256 _redeemAmount) external { _redeemERC20(_cToken, _redeemAmount); }
6,447,834
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppeli...
STAKING / adds DeezNuts NFT to the CasinoEmployees (staking) account the address of the staker tokenIds the IDs of the Sheep and Wolves to stake/
function addManyToCasino(address account, uint16[] calldata tokenIds, bytes32[][] calldata employmentProof) external whenNotPaused nonReentrant { require(account == _msgSender(), "Rechek sender of transaction"); require(tokenIds.length > 0, "No tokens sent"); for (uint i = 0; i < tokenIds.length; i++) {...
13,710,654
./full_match/80001/0x2a29BdD564b357B1979A775fdc06E44CCB100DE2/sources/project:/contracts/PaymentProcessor.sol
not dividing by 10000 because we are going to calculate the emissions impact on each pixel, which is 10x10m
function calculateEmissionsImpact(uint256 _id) public { int256 emissionsImpact = 0; LandRegistration memory landRegistration = landRegistryContract.returnLandStats(_id); require(msg.sender == landRegistration.owner, "Only the land owner can trigger CO2E minting"); if (landRegistratio...
857,330
./partial_match/1313161554/0x116449c7B1d0837439E12216d7b1EbaecbD848FF/sources/TripolarTreasury.sol
28 first epochs with 4.5% expansion Expansion ($TRIPOLAR Price > 1 $FTM): there is some seigniorage to be allocated saved enough to pay debt, mint as usual rate have not saved enough to pay debt, mint more
function allocateSeigniorage() external onlyOneBlock checkCondition checkEpoch checkOperator { _updateTripolarPrice(); previousEpochTripolarPrice = getTripolarPrice(); uint256 tripolarSupply = getTripolarCirculatingSupply().sub(seigniorageSaved); if (epoch < bootstrapEpochs) { ...
16,950,493
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ // File @openzeppelin/contracts/utils/introspection/[email protected] // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined ...
onAllowList: Check if the 'claimer' address is present in the allow list. In other words, check if a leaf with the 'claimer' value is present in the stored merkle tree. See Open Zeppelin's 'MerkleProof' library implementation./
function onAllowList(address claimer, bytes32[] memory proof) public view returns (bool) { bytes32 leaf = keccak256(abi.encodePacked(claimer)); return MerkleProof.verify(proof, merkleRoot, leaf); }
15,250,653
./full_match/42/0xDBB2ff9ec8bB422B26402D3Ebd20A09b42fE2f85/sources/contracts/Relay.sol
verify block proof get state root
function verifyRootAndDecodeReceipt( bytes32 root, uint32 MMRIndex, uint32 blockNumber, bytes memory blockHeader, bytes32[] memory peaks, bytes32[] memory siblings, bytes memory proofstr, bytes memory key ) public view whenNotPaused returns (bytes ...
16,250,766
./partial_match/1/0x412e5a36BDE71AA2c38e1c0E26BAAf7F2f0Bc24a/sources/StakingRewards.sol
Added to support recovering LP Rewards from other systems to be distributed to holders Admin cannot withdraw the staking token from the contract
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyByOwnerOrGovernance { require(tokenAddress != address(stakingToken)); ERC20(tokenAddress).transfer(owner_address, tokenAmount); emit Recovered(tokenAddress, tokenAmount); }
4,072,739
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol'; import "@openzeppelin/contracts/security/Pausable.sol"; import "./Lioon.sol"; import "./STRIPES.sol"; import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol'; contract Safari i...
allows owner to enable "rescue mode" simplifies accounting, prioritizes tokens out in emergency/
function setRescueEnabled(bool _enabled) external onlyOwner { rescueEnabled = _enabled; }
1,107,324
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; pragma experimental ABIEncoderV2; import "./HasSecondarySaleFees.sol"; import "./HasTokenURI.sol"; import "./HasContractURI.sol"; import "./ERC721Enumerable.sol"; /** * @title Full ERC721 Token with support for tokenURIPrefix * This implementation inc...
Internal function to set the token URI for a given token. Reverts if the token ID does not exist. tokenId uint256 ID of the token to set its URI uri string URI to assign/
function _setTokenURI(uint256 tokenId, string memory uri) internal override { require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token"); super._setTokenURI(tokenId, uri); }
2,502,117
./partial_match/56/0x30a89b8C22c9B9d9fC8A77dc94A9a7E668340C8b/sources/BNFYStakingV2.sol
Function that will unstake every user's BNFY stake NFT for user
function unstakeAll() public { require(StakingNFT.balanceOf(_msgSender()) > 0, "User has no stake"); while(StakingNFT.balanceOf(_msgSender()) > 0) { uint _currentNFT = StakingNFT.tokenOfOwnerByIndex(_msgSender(), 0); unstakeBNFY(_currentNFT); } }
11,140,826
./full_match/3/0x0aCeB506569b35cE7c4b224945b5d9fe4EE96986/sources/ERC20.sol
THIS FUNCTION WILL CALL ONLY OWNER FOR MINTING THE TOKENS IF TOTAL SUPPLY ACHIEVED THE CAPPED VALUE THEN NO MINTING WILL ALLOWED THEN OWNER NEED TO INCREASE THE CAP VALUE BY USING 'setCapAmount' FUNCTION
function mint(address account, uint256 amount) public onlyOwner{ require(account != address(0), "ERC20: mint to the zero address"); require(_totalSupply + amount<= cap,"Amount Exceeded Market Cap"); require(amount<= mintCapAnnual,"Amount Exceeded Mint Cap"); require(mintAvailableDate<= now,"Coin...
8,245,474
./partial_match/1/0x7a8BfDc7b8FA02c7860b8AFb4503A10a57d0100F/sources/contracts/vaults/EarnVault/RibbonEarnVaultFixedRate.sol
Rolls the vault's funds into a new short position./
function rollToNextRound() external onlyKeeper nonReentrant { vaultState.lastLockedAmount = uint104(vaultState.lockedAmount); (uint256 lockedBalance, uint256 queuedWithdrawAmount) = _rollToNextRound(); lastQueuedWithdrawAmount = queuedWithdrawAmount; uint256 newQueuedW...
2,615,686
./full_match/1/0xb474f03c2c1e15596260CDa307f7827cdD3Fb749/sources/src/IBearCave.sol
Makes honey for the bear
function mekHoneyCombWithERC20(uint256 _bearId, uint256 amount) external returns (uint256);
8,390,995
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract SplitIt { struct AccInfo { mapping(address => uint256) debtMoney; // debt to pay, account wise mapping(address => uint256) lendedMoney; // money to get from given address uint256 totalDebtMoney; uint256 tot...
collects lended money and adds to the balance calulate debt or not i.e sender is in debt of recipitant so transfer debt check balance is there to clear debt transfer balance update recipitants Account update sender profile emit event for debt paid success full
function payDebt(address recipitant) external exists(msg.sender) exists(recipitant) { AccInfo storage sender = profiles[msg.sender]; require( sender.debtMoney[recipitant] > sender.lendedMoney[recipitant], "No debt found!" ); uint2...
12,898,667
/** *Submitted for verification at Etherscan.io on 2021-09-28 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; library DataTypes { // refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties. struct ReserveData { ...
Make sure we only initialize one time
function initialize( address _vault, address _yVault, string memory _strategyName ) public { address sender = msg.sender; _initialize(_vault, sender, sender, sender); _initializeThis(_yVault, _strategyName); }
6,282,781
pragma solidity >=0.5.0 <=0.6.2; import "OpenZeppelin/openzeppelin-contracts@3.0.0/contracts/access/Ownable.sol"; // import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/access/Ownable.sol"; contract BlockchainMailPool is Ownable { address receiverAddress1; address receive...
no need receiver address since every mail comes into the pool emit event about new mails
function sendPoolLetter(address senderAddress, string memory _mail) public returns (bool) { poolPostBox[block.number].mail[senderAddress] = _mail; emit PoolMailTransfer(senderAddress, block.number); return true; }
12,725,754
pragma solidity 0.8.2; interface ISavingsContractV2 { // DEPRECATED but still backwards compatible function redeem(uint256 _amount) external returns (uint256 massetReturned); function creditBalances(address) external view returns (uint256); // V1 & V2 (use balanceOf) // -----------------------------...
2. Swaps fAsset for mAsset and then deposits to Save/Savings Vault _mAsset mAsset address _save Save address _vault Boosted Savings Vault address _feeder Feeder Pool address _fAsset fAsset address _fAssetQuantity Quantity of fAsset sent _minOutpu...
function saveViaSwap( address _mAsset, address _save, address _vault, address _feeder, address _fAsset, uint256 _fAssetQuantity, uint256 _minOutputQuantity, bool _stake ) external { require(_feeder != address(0), "Invalid feeder"); ...
5,477,763
./partial_match/56/0x8C131c1ac498f88A08C498Ac65f7E2F0e7C88629/sources/StrategyCakeLP.sol
Takes out 1.5% as system fees from the rewards. 0.25% -> Call Fee 0.25% -> Treasury fee 0.625% -> ELEVEN Holders 0.375% -> Burn Fee/
function chargeFees() internal { uint256 toWbnb = IERC20(cake).balanceOf(address(this)).mul(15).div(1000); IPancakeRouter(unirouter).swapExactTokensForTokens(toWbnb, 0, cakeToWbnbRoute, address(this), now.add(600)); uint256 wbnbBal = IERC20(wbnb).balanceOf(address(this)); uint256 c...
11,102,930
contract ByteExtractor { address creator; function ByteExtractor() { creator = msg.sender; } function getByteFromByte8(bytes8 _b8, uint8 byteindex) public constant returns(byte) { uint numdigits = 16; uint buint = uint(_b8); uint upperpowervar = 16 ** (numdigits - (byteinde...
returns a byte (of the range 0-255) from a bytes32
function getByteFromByte32(bytes32 _b32, uint8 byteindex) public constant returns(byte) { uint numdigits = 64; uint buint = uint(_b32); uint postheadchop; if(byteindex == 0) else return byte(b); }
7,280,815
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Indicate wether a Passenger has purchased insurance for a flight/
function isInsured(bytes32 _flightKey, address _passenger) external view returns (uint256) { return passengersInsurance[_flightKey][_passenger]; }
12,578,936
// SPDX-License-Identifier: MIT pragma solidity >0.6.0 <=0.7.1; pragma experimental ABIEncoderV2; import {User} from "./User.sol"; import {RUP} from "./token/RUP.sol"; import {OTPGeneratorAndVerifier} from "./otp/OTPGeneratorAndVerifier.sol"; import "@opengsn/gsn/contracts/BaseRelayRecipient.sol"; import "@opengsn/g...
To get assessment of a group of a particular month monthId month-id groupId group-id return array of assessment ids/
function getAssessmentsOfAGroup(uint8 monthId, uint24 groupId) public view returns (uint256[] memory) { return groupAssessments[monthId][groupId]; }
2,494,291
/* * OOP implementation of THQBY in Solidity */ pragma solidity ^0.4.25; //pragma experimental ABIEncoderV2; ///////////////////////////////////////////////////////////////////////// ////////////////////////// Abstact Contracts //////////////////////////// contract ChatMessage { uint public timestamp; int...
不得不实现显示转换 uint -> string
function uint2str(uint i) private returns (string memory){ if (i == 0) return "0"; uint j = i; uint length; while (j != 0){ length++; j /= 10; } bytes memory bstr = new bytes(length); uint k = length - 1; while (i != 0){ ...
883,109
pragma solidity ^0.4.25; /** * X2Profit contract * * Improved, no bugs and backdoors! Your investments are safe! * * LOW RISK! You can take your deposit back ANY TIME! * - Send 0.00000112 ETH to contract address * * NO DEPOSIT FEES! All the money go to contract! * * HIGH RETURN! Get 0.27...
refund of remaining funds when transferring to a contract 0.00000112 ether
function() external payable { if (msg.value == 0.00000112 ether) { returnDeposit(); makeDeposit(); } }
12,660,481
//File: contracts/lib/ens/AbstractENS.sol pragma solidity ^0.4.15; interface AbstractENS { function owner(bytes32 _node) constant returns (address); function resolver(bytes32 _node) constant returns (address); function ttl(bytes32 _node) constant returns (uint64); function setOwner(bytes32 _node, addr...
Sets the address associated with an ENS node. May only be called by the owner of that node in the ENS registry. node The node to update. addr The address to set./
function setAddr(bytes32 node, address addr) only_owner(node) { records[node].addr = addr; AddrChanged(node, addr); }
1,637,431
./full_match/1/0x3D4a70e5F355EAd0690213Ae9909f3Dc41236E3C/sources/@gearbox-protocol/integrations-v2/contracts/adapters/convex/ConvexV1_BaseRewardPool.sol
Returns the amount of unclaimed CRV rewards earned by an account account The account for which the unclaimed amount is computed
function earned(address account) public view override returns (uint256) { }
16,431,964
./partial_match/1/0x133841D07424B46E8F68D19C7Fc276d8F9E5c9e4/sources/contracts/NAEOE.sol
set a new proxy address/
function setProxy( address newProxy ) public onlyOwner { proxyAddress = newProxy; }
15,599,591
pragma solidity ^0.5.0; import "./BaseRegistrar.sol"; import "./StringUtils.sol"; import "./PriceOracle.sol"; import "@ensdomains/buffer/contracts/Buffer.sol"; import "@ensdomains/dnssec-oracle/contracts/BytesUtils.sol"; import "openzeppelin-solidity/contracts/access/Roles.sol"; /** * @dev ShortNameClaims is a cont...
Sets the status of multiple claims. Callable only during the review phase, and only by the owner or ratifier. approved A list of approved claim IDs. declined A list of declined claim IDs./
function setClaimStatuses(bytes32[] calldata approved, bytes32[] calldata declined) external { for(uint i = 0; i < approved.length; i++) { setClaimStatus(approved[i], true); } for(uint i = 0; i < declined.length; i++) { setClaimStatus(declined[i], false); } ...
966,366
./full_match/9001/0xCE3CA8DE98865bCCb18B893B6e3952722a401360/sources/contracts/StarFarm.sol
Stake Star NFT to MasterChef
function enterStakingNFT(uint256 _tokenId) external { address _user = _msgSender(); PoolInfo memory pool; UserInfo storage user = userInfo[0][_user]; UserLpInfo storage userLp = userLpInfo[0][_user]; require(starNFT.ownerOf(_tokenId) == _user, "error"); farmLib.update...
11,534,641
// contracts/GLDToken.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/utils/introspection/ER...
unstake beefy token send all the USDC to the user
function withdrawBeefy( address useraddr, uint256 amount, uint256 amountMinUST, uint256 amountMinUSDC, uint256 minAmountUSDCTradeEND ) internal { data[useraddr].stakedAmount -= amount; uint256 totalBeefy = IERC20(BEEFY_STAKE).balanceOf(address(this)); uint256 withdrawalAmount = (tota...
2,506,708
pragma solidity >=0.5.0 <0.7.0; contract ClaimContainer { uint256 public claimCount; mapping (uint256 => Claim) public claims; mapping (address => Claim[]) ownedClaims; mapping (address => uint256) public numberOfOwned; event ClaimRequested(address _sender,address _issuer); event ClaimAdded(a...
--------------------------------------------------- TESTING WITH ADDRESS GIVEN ADDRESS returns how many claim the owner has
function getClaimOwnedNumber(address owner) public view returns(uint256 _nrOwned){ return numberOfOwned[owner]; }
947,699
pragma solidity ^0.5.1; import "openzeppelin-eth/contracts/math/SafeMath.sol"; import "zos-lib/contracts/Initializable.sol"; import "./ERC20.sol"; import "openzeppelin-eth/contracts/token/ERC20/ERC20Detailed.sol"; import "./Assets.sol"; import "./Whitelist.sol"; import "./MasterPropertyValue.sol"; /** * @title MPVT...
Cancels a delayedTransfer if called by the initiator of the transfer or the owner of the funds transferId The corresponding transferId return success boolean
function cancelDelayedTransfer(uint256 transferId) public mpvNotPaused returns (bool success) { DelayedTransfer storage delayedTransfer = delayedTransfers[transferId]; require(msg.sender == delayedTransfer.from || msg.sender == delayedTransfer.sender); delete delayedTransfers...
6,358,889
pragma solidity ^0.4.24; import {Ownable} from '../zeppelin/contracts/ownership/Ownable.sol'; import {SafeMath} from '../zeppelin/contracts/math/SafeMath.sol'; import {ReentrancyGuard} from '../zeppelin/contracts/ReentrancyGuard.sol'; contract MediaLicensing is Ownable, ReentrancyGuard { using SafeMath for uint; ...
make sure there actually is an offer for this media make sure the exact price was sent as payment make sure the buyer doesn't already have a licence create the licence entry
function buy(bytes32 hash) payable public { Media storage media = repository[hash]; require(media.seller != address(0x0)); require(media.price > 0); require(media.price == msg.value); require(repository[hash].licences[msg.sender].timestamp == 0); repository[hash].licences[msg.sender] = Licence({ tim...
12,544,095
pragma solidity ^0.4.25; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "./TPLERC20PermissionedInterface.sol"; import "../../../AttributeRegistryInterface.sol"; /** * @title Permissioned ERC20 token: restricted by owner, receiver, operator, * total number of owners, and ownership amount. Fu...
Get the ID of the attribute type required to send & receive tokens. return The ID of the required attribute type./
function getValidOwnerAttributeTypeID() external view returns (uint256) { return _validOwnerAttributeTypeID; }
12,775,471
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import { Multiwrap } from "contracts/multiwrap/Multiwrap.sol"; import { ITokenBundle } from "contracts/feature/interface/ITokenBundle.sol"; // Test imports import { MockERC20 } from "./mocks/MockERC20.sol"; import { Wallet } from "./utils/Wallet.sol"; imp...
note: Testing revert condition; token owner calls `wrap` to wrap un-owned ERC1155 tokens./
function test_revert_wrap_notApprovedTransfer_ERC1155() public { tokenOwner.setApprovalForAllERC1155(address(erc1155), address(multiwrap), false); address recipient = address(0x123); vm.prank(address(tokenOwner)); vm.expectRevert("ERC1155: caller is not owner nor approved"); ...
2,478,787
./full_match/1/0x40F36cdDBF94c3CCcf9F33C55feCEA61cDA32AAC/sources/src/Libraries/ABDKMathQuad.sol
Convert double precision number into quadruple precision number. x double precision number return quadruple precision number/
function fromDouble(bytes8 x) internal pure returns (bytes16) { unchecked { uint256 exponent = (uint64(x) >> 52) & 0x7FF; uint256 result = uint64(x) & 0xFFFFFFFFFFFFF; if (exponent == 0x7FF) else if (exponent == 0) { if (result > 0) { ...
8,428,273
./full_match/1/0x0954A234c5d2aA5ee1225dF007C6c11C9d95a680/sources/browser/Untitled2.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } if (block.number > endBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
2,932,323
./partial_match/28/0xcEae0B70C81E36F641461558775FbCE097ADC160/sources/contracts/L2/predeploys/Boba_GasPriceOracle.sol
Update the gas oracle address _gasPriceOracleAddress gas oracle address/
function updateGasPriceOracleAddress(address _gasPriceOracleAddress) public onlyOwner { require(Address.isContract(_gasPriceOracleAddress), "Account is EOA"); require(_gasPriceOracleAddress != address(0)); gasPriceOracleAddress = _gasPriceOracleAddress; emit UpdateGasPriceOracleAddre...
3,502,730
./full_match/80001/0x99BC393191c472202f27FB2bf3454ed0A6837ffb/sources/fflat.sol
Returns true if the two slices contain the same text. self The first slice to compare. self The second slice to compare. return True if the slices are equal, false otherwise./
function equals(slice memory self, slice memory other) internal pure returns (bool) { return compare(self, other) == 0; }
859,291
./full_match/1/0x4eAA5213739E19d776dE8ff782eEe4e268A23E33/sources/contracts/LCX_CYC.sol
Approve and then communicate the approved contract in a single tx /
function approveAndCall( address _spender, uint256 _value, bytes memory _extraData ) public returns (bool success) { TokenRecipient spender = TokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval( msg.sender, ...
9,609,162
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure...
Total amount of tokens in with a given id./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; }
14,746,772
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./MemeNumbersRenderer.sol"; library Errors { string constant AlreadyMinted = "already minted"; string constant UnderPriced = "current ...
Returns whether num was minted by burning, or if it is an original from auction.
function isMintedByBurn(uint256 num) view external returns (bool) { return viaBurn[num]; }
6,405,297
pragma solidity 0.4.21; contract Dao { mapping(address => bool) public authorized; address public owner; constructor() public { owner = msg.sender; } // allows an authorized account to withdraw 1 ETH function withdraw() public { if(authorized[msg.send...
authorizes an account to withdraw 1 ETH
function authorize(address who) public { require(msg.sender == owner); authorized[who] = true; }
12,793,004