file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity 0.6.2; //based on knowsec404 contract Token { mapping(address => uint) public balances; uint public totalSupply; constructor(uint _initialSupply) public{ balances[msg.sender] = totalSupply = _initialSupply; } function transfer(address _to, uint _value) public returns (bool) {...
The following code can bypass the judgment by integer underflowThere are also integer overflow and underflow in Ethereum, and it will not throw an exception when overflow and underflow occur. If the overflow (underflow) result is related to the amount of money, it may cause serious economic loss, so developers need to ...
function transfer(address _to, uint _value) public returns (bool) { require(balances[msg.sender] - _value >= 0); balances[msg.sender] -= _value; balances[_to] += _value; return true; }
14,060,283
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functio...
ERC20 transfer function. Overridden to maintain holder count variable./
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _updateCountOnTransfer(_msgSender(), recipient, amount); return super.transfer(recipient, amount); }
11,957,141
// King of the Ether Throne Contracts. // Copyright (c) 2016 Kieran Elby. Released under the MIT License. // Version 0.9.9.2, July 2016. // // See also http://www.kingoftheether.com and // https://github.com/kieranelby/KingOfTheEtherThrone . // // This file contains a number of contracts, of which only // these three ...
WARN - does NOT validate arguments; you MUST either call KingdomFactory.validateProposedThroneRules() or create the Kingdom via KingdomFactory/World's createKingdom(). See World.createKingdom(..) for parameter documentation. We number the monarchs starting from 1; it's sometimes useful to use zero = invalid, so put in ...
function Kingdom( string _kingdomName, address _world, address _topWizard, address _subWizard, uint _startingClaimPriceWei, uint _maximumClaimPriceWei, uint _claimPriceAdjustPercent, uint _curseIncubationDurationSeconds, uint _commissionPerThou...
5,425,022
// SPDX-License-Identifier: MIT pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/EnumerableMap.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@open...
Getting withdraw information return _amountBMIRequested is amount of bmi tokens requested to unlock return _amountStkBMI is amount of stkBMI that will burn return _unlockPeriod is its timestamp when user can withdraw returns 0 if it didn't unlocked yet. User has 48hs to withdraw return _availableFor is the end ...
interface IClaimingRegistry { function stakeWithPermit( uint256 _amountBMI, uint8 _v, bytes32 _r, bytes32 _s ) external; function stakeFor(address _user, uint256 _amountBMI) external; function stake(uint256 _amountBMI) external; function maturityAt() external view ...
6,849,070
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol"; /** * @dev interface for transfering ERC721 adn ERC1155 tokens, * contra...
interface for transfering ERC721 adn ERC1155 tokens, contracts that implement this interface must support erc721safeTransferFrom and erc1155safeTransferFrom functions/
interface INftTransferProxy { function erc721safeTransferFrom(IERC721Upgradeable token, address from, address to, uint256 tokenId) external; function erc1155safeTransferFrom(IERC1155Upgradeable token, address from, address to, uint256 id, uint256 value, bytes calldata data) external; }
6,467,191
/** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt */ pragma solidity ^0.4.13; import "./Crowdsale.sol"; import "./ReleasableToken.sol";...
Check that we can release the token /
function isSane() public constant returns (bool) { return true; }
12,808,037
pragma solidity 0.4.24; contract Token { function transfer(address receiver, uint amount) public; function balanceOf(address _address) public returns(uint); } contract Crowdsale { address public beneficiary; uint public amountRaised; uint public startTime; uint public endTime; uint public...
Fallback function The function without name is the default function that is called whenever anyone sends funds to a contract/
function () public payable { require(isActive()); uint amount = msg.value; amountRaised += amount; uint TokenAmount = uint((msg.value/(10 ** 10)) * price); tokenReward.transfer(msg.sender, TokenAmount); beneficiary.transfer(msg.value); FundTransfer(msg.sender,...
2,229,231
/* Copyright 2019 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, ...
Calculates partial value given a numerator and denominator. numerator Numerator. denominator Denominator. target Value to calculate partial of. return Partial value of target.
function getPartialAmountFloor( uint256 numerator, uint256 denominator, uint256 target ) public pure returns (uint256 partialAmount) { return LibMath.getPartialAmountFloor(numerator, denominator, target); }
7,267,695
pragma solidity ^0.4.17; import "../ManagerProxyTarget.sol"; import "./IJobsManager.sol"; import "./libraries/JobLib.sol"; import "../token/ILivepeerToken.sol"; import "../token/IMinter.sol"; import "../bonding/IBondingManager.sol"; import "../rounds/IRoundsManager.sol"; import "../verification/IVerifiable.sol"; impor...
Withdraw deposited funds/ Can only withdraw at or after the broadcster's withdraw block
function withdraw() external whenSystemNotPaused { require(broadcasters[msg.sender].withdrawBlock <= roundsManager().blockNum()); uint256 amount = broadcasters[msg.sender].deposit; delete broadcasters[msg.sender]; minter().trustedWithdrawETH(msg.sender, amount); Withdraw(ms...
12,737,176
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.6; interface IFeeRecipient { function setFeeConverter(address _value) external; } interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); } contract TimelockProposal { function execute() external { addres...
Refund gas expenses from block 12924751 to 13177424 for the deployer address https:etherscan.io/address/0xd7b3b50977a5947774bfc46b760c0871e4018e97 6.64 ETH
function execute() external { address wildDeployer = 0xd7b3b50977a5947774bFC46B760c0871e4018e97; IFeeRecipient feeRecipient = IFeeRecipient(0x487502F921BA3DADAcF63dBF7a57a978C241B72C); IERC20 weth = IERC20(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); feeRecipient.setFeeConverter(0x31FD80bf06453ACE5...
6,319,564
pragma solidity ^0.4.24; /** * @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 trans...
Decrease the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol _spender The address which will spend the funds. ...
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); ...
10,301,092
./partial_match/1/0xE4dD566b410Fe45db55BD9F5f928269290B0a674/sources/SecurityToken.sol
Internal - Removes a module attached to the SecurityToken by index/Need to find index of _type in moduleTypes of module we are moving
function _removeModuleWithIndex(uint8 _type, uint256 _index) internal { uint256 length = modules[_type].length; modules[_type][_index] = modules[_type][length - 1]; modules[_type].length = length - 1; if ((length - 1) != _index) { uint8[] memory newTypes = modulesToData[...
4,335,576
/** SHIBAZILLA, YUM YUM. https://t.me/Shibazilla_eth https://shibazilla.io/ */ /** // SPDX-License-Identifier: Unlicensed */ pragma solidity 0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() in...
exclude from paying fees or having max transaction amount
constructor() ERC20("ShibaZilla", "ShibaZilla") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Fact...
398,173
./partial_match/1/0x67119bbdc1683df2ad85CCEa4304619F5D62e000/sources/TrumpFullTermToken.sol
What is total circulating supply?
function totalSupply() public constant returns (uint256) { return totalSupply_; }
3,679,116
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.so...
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _lpTokenId) external validPool(_lpTokenId) nonReentrant { uint64 ammId = lpToken.getAMMId(_lpTokenId); uint256 pairId = lpToken.getPairId(_lpTokenId); uint256 periodID = lpToken.getPeriodIndex(_lpTokenId); UserInfo storage user = userInfo[ammId][pai...
14,868,383
pragma solidity 0.4.18; /** Used for administrration of the VZT Token Contract */ contract Administration { // keeps track of the contract owner address public owner; // keeps track of the contract administrator address public administrator; // keeps track of hte song token exchange ...
used to set the royalty information contract
function setRoyaltyInformationContract(address _royaltyInformationContract) public onlyAdmin notFrozen returns (bool set) { royaltyInformationContract = _royaltyInformationContract; RoyaltyInformationContractSet(msg.sender, _royaltyInformationContract, true); return true; }
7,308,407
// File: @openzeppelin\contracts\token\ERC20\IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. ...
_amount The amount to withdraw. _token The token to withdraw./
function withdraw(uint _amount, address _token) public isExpired() onlyBeneficiary() { if(_token == address(0)) { (bool success, ) = msg.sender.call.value(_amount)(""); require(success, "Transfer failed."); emit Withdraw(msg.sender, _amount, _token); IERC20 token = IERC20(_token); re...
12,175,467
pragma solidity ^0.5.8; /// @title A contract that is able to facilitate donations to different charities /// whenever a user wants to make a transfer of funds to another user. contract Charitable { address payable owner; address payable taxCollectAddress; uint256 taxPercent; uint256 totalDonationsAmou...
change tax address newTaxAddress The new tax address
function setTaxAddress(address payable newTaxAddress) public restrictToOwner() { require(newTaxAddress != address(0)); emit TaxAddressTransferred(taxCollectAddress, newTaxAddress); taxCollectAddress = newTaxAddress; }
1,328,308
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import {Hevm} from "../test/utils/Hevm.sol"; import {DSTest} from "ds-test/test.sol"; import {MockProvider} from "@cleanunicorn/mockprovider/src/MockProvider.sol"; import {Caller} from "../test/utils/Caller.sol"; import {Guarded} from "../guarded/Guarded.s...
Set the value returned by the Oracle.
function setUp() public { collybus = new TestCollybus(); oracle = new MockProvider(); _mockTokenId = bytes32(uint256(1)); oracle.givenQueryReturnResponse( abi.encodePacked(IOracle.value.selector), MockProvider.ReturnData({ success: true, ...
13,018,386
./full_match/5/0x41c42626DfED6576a1a7d4974b39986bA9D1848d/sources/project_/contracts/utils/erc1820/ERC1820Implementer.sol
Implement the interface for addr
function _setInterfaceForAddress(string memory interfaceLabel, address addr) internal { _interfaceHashes[addr][ keccak256(abi.encodePacked(interfaceLabel)) ] = true; }
1,893,095
// SPDX-License-Identifier: Apache-2.0 /* 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 a...
Allow this contract to receive ERC1155 tokens. return success `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
function onERC1155BatchReceived( ) external pure returns (bytes4 success) { return this.onERC1155BatchReceived.selector; }
1,071,290
pragma solidity ^0.5.0; import "./BondingCurveToken.sol"; contract CommonsToken is BondingCurveToken { event LogVal(uint256 val); // --- STRUCT DELCARATIONS: --- // PreHatchContribution is a contribution in the curve hatching phase. // Each contribution is an amount of reserve tokens. // Each contributio...
The total amount of INTERNAL tokens that should have been unlocked. The amount of INTERNAL tokens that was already unlocked. The amount that can be unlocked.
function claimTokens() public whileHatched(true) onlyHatcher { require(initialContributions[msg.sender].lockedInternal > 0); uint256 paidExternal = initialContributions[msg.sender].paidExternal; uint256 lockedInternal = initialContributions[msg.sender].lockedInternal; uint256 shouldHav...
6,445,105
./partial_match/42/0x7Dab59e2Ca3a043316C2039453989d8519756d92/sources/DisposableGovernance.sol
Verifies signature. coverDetails details related to cover. coverPeriod validity of cover. smaratCA smarat contract address. _v argument from vrs hash. _r argument from vrs hash. _s argument from vrs hash./
function verifySign( uint[] memory coverDetails, uint16 coverPeriod, bytes4 curr, address smaratCA, uint8 _v, bytes32 _r, bytes32 _s ) public view returns (bool) { require(smaratCA != address(0)); require(pd.capReached() == 1, "Can not buy cover until cap reached for 1st ...
3,299,982
./full_match/80001/0x7717aB77bf46033626CCF17366015A867f6FC9b2/sources/project:/contracts/superfluid/SuperfluidPool.sol
Returns the total number of units for a pool
function totalSupply() external view override returns (uint256) { return _getTotalUnits(); }
5,577,503
./full_match/3/0xe0904A342A48D73aef712003236aF66fe0a4cf9E/sources/browser/ProofHolder.sol
Retrieve a proof from the smart contract./
function retrieveProof(bytes32 _hash) public view returns(bytes32, string memory, string memory) { require(proofMapping[_hash].isSet, "Proof does not exist"); return(proofMapping[_hash].hash, proofMapping[_hash].root, proofMapping[_hash].timestamp); }
8,101,866
/** telegram:https://t.me/mickeymouseinu website:https://www.mickeymouseinueth.com/ twitter:https://twitter.com/mickeymouseinu WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW...
exclude from paying fees or having max transaction amount
constructor() ERC20("mickeymouseinu", "MICKEYMOUSE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV...
13,856,869
// Sources flattened with hardhat v2.3.0 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.1.0 // 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 token...
Get net worth ethAmount Oracle price - eth amount tokenAmount Oracle price - token amount return navps Net worth 做市: Np = (Au (1 + K) / P + Ae) / S
function getNAVPerShare( uint ethAmount, uint tokenAmount ) external view override returns (uint navps) { uint total = totalSupply; navps = total > 0 ? _calcTotalValue( ethBalance(), IERC20(_tokenAddress).balanceOf(address(this)), ethAmount,...
7,018,590
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.2; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IFeesCollector { function sendProfit(uint256 amount, IERC20 token) external; } // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.2; pragma experi...
Calculate buying premium fee, assuming the maxmimum
function openPosition(uint168 _tokenAmount, uint16 _maxCVI, uint168 _maxBuyingPremiumFeePercentage, uint8 _leverage) public override returns (uint168 positionUnitsAmount) { require(_leverage > 0, "Leverage must be positive"); require(_leverage <= maxAllowedLeverage, "Leverage excceeds max allowed");...
5,865,816
./full_match/80001/0x64273a596298C779aeE10c8396B0bf865542ACD7/sources/contracts/n.sol
string memory nickName; string memory handle; string memory website; if (bytes(tokenIdentityOf[_tokenId]._name).length == 0){ nickName = "A Sui City Investor"; } else { nickName = nameOf[_tokenId]; } if (bytes(handleOf[_tokenId]).length == 0){ handle = "_"; } else { handle = handleOf[_tokenId]; } if (by...
function tokenURI(uint256 _tokenId) public view override returns (string memory result) { string memory json = string(abi.encodePacked('{"name": "Passport #', toString(_tokenId), '", "discription":"sui PASSPORTS ARE TRADABLE ERC-721 TOKENS ON OPTIMISM, AND GUARANTEE THEIR HOLDERS MEMBERSHIP IN THE sui ...
5,672,147
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external retu...
Ignore if address is already included Only append new addresses to the array, never a duplicate
function addToWhitelist(address newElement) external onlyOwner { if (whitelist[newElement] == Status.In) { return; } if (whitelist[newElement] == Status.None) { whitelistIndices.push(newElement); } whitelist[newElement] = Status.In; emit Add...
972,238
pragma solidity ^0.5.16; interface IERC20 { function TOTALSUPPLY886() external view returns (uint); //inject NONSTANDARD NAMING function BALANCEOF698(address account) external view returns (uint); //inject NONSTANDARD NAMING function TRANSF...
inject NONSTANDARD NAMING
function DIV750(uint a, uint b) internal pure returns (uint) {
7,321,041
./partial_match/80001/0xEd494b640222d33F22a9156725d2a12a589fa3E0/sources/src/consensys_erc1400/ERC1400.sol
Issue tokens from a specific partition. toPartition Name of the partition. operator The address performing the issuance. to Token recipient. value Number of tokens to issue. data Information attached to the issuance./
function _issueByPartition( bytes32 toPartition, address operator, address to, uint256 value, bytes memory data ) internal { _callTokenExtension( toPartition, operator, address(0), to, value, ...
8,796,214
./full_match/5/0x831ba54da2CD6B9DB3B461D6d82847894ED95770/sources/solidity/interfaces/IDataFeedKeeper.sol
The DataFeedKeeper interface 0xJabberwock (from DeFi Wonderland) Contains state variables, events, custom errors and functions used in DataFeedKeeper STATE VARIABLES EVENTS ERRORS FUNCTIONS
interface IDataFeedKeeper is IKeep3rJob { function dataFeed() external view returns (IDataFeed _dataFeed); function defaultBridgeSenderAdapter() external view returns (IBridgeSenderAdapter _defaultBridgeSenderAdapter); function jobCooldown() external view returns (uint256 _jobCooldown); function periodLengt...
1,937,265
./full_match/5/0xa31DCBe2dF53bd70CaB02e25eDca1cB1a771890A/sources/lib/tl-sol-tools/src/upgradeable/access/OwnableAccessControlUpgradeable.sol
function to grant/revoke a role to an address requires owner to call this function but this may be further extended using the internal helper function in inheriting contracts role - bytes32 role created in inheriting contracts roleMembers - list of addresses that should have roles attached to them based on `sta...
function setRole(bytes32 role, address[] memory roleMembers, bool status) external onlyOwner { _setRole(role, roleMembers, status); } External View Functions
1,898,163
./full_match/8453/0x94E69ef94BE77b98BF22F54784F2151a5084A3AB/sources/contracts/CamelotRouter.sol
REMOVE LIQUIDITY send liquidity to pair
function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public override ensure(deadline) returns (uint amountA, uint amountB) { address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); ICamel...
11,558,883
pragma solidity ^0.4.18; // <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including ...
Allocate space for the buffer data
function init(buffer memory buf, uint capacity) internal pure { if(capacity % 32 != 0) capacity += 32 - (capacity % 32); buf.capacity = capacity; assembly { let ptr := mload(0x40) mstore(buf, ptr) mstore(0x40, add(ptr, capacity)) } }
316,824
./full_match/1/0x45DB28b2d4878Ad124c037d4558AcF5Db3bBa6A5/sources/contracts/PWNVault.sol
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding to learn more about how these ids are created. This function call must use less than 30 000 gas./
function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { return interfaceId == this.PWN.selector ^ this.push.selector ^ this.pull.selector ^ this.pullProxy.selector }
3,062,119
./full_match/8453/0x25f8fA4917180FF308883e37Ea27CEaEB68c1f19/sources/contracts/bridge/router/SynapseRouter.sol
Token needs to be pulled only if msg.value is zero This way user can specify WETH as the origin asset Otherwise, we need to check that ETH was specified And that amount matches msg.value We will forward msg.value in the external call to the recipient
function _pullToken( address recipient, address token, uint256 amount if (msg.value == 0) { IERC20(token).safeTransferFrom(msg.sender, recipient, amount); require(token == UniversalToken.ETH_ADDRESS, "!eth"); require(msg.value == amount, "!msg.valu...
11,554,468
./full_match/80001/0x4436485155E81382b8DE76b29d4f79C52C27AAF7/sources/contracts/dao/ERC1155Dao.sol
returns the details of a particular token with `tokenId + serialNo`. Signature for getTokenBearer(string,uint256) : `0x06e59689` tokenId id of the token. serialNo serial number of the token./
function getTokenBearer( string memory tokenId, uint256 serialNo ) external view override returns (TokenBearer memory) { return _tokenBearer[tokenId][serialNo]; }
5,682,247
./full_match/5/0x1caD01f5028d265E079096B3fBF6E102f7708eE1/sources/project_/contracts/Main.sol
ends XEX Stake and gets reward if the Stake is mature/ mint staked XEX (+ reward)
function withdraw() external payable checkFee { StakeInfo memory userStake = userStakes[_msgSender()]; require(userStake.amount > 0); uint256 xenReward = _calculateStakeReward( userStake.amount, userStake.term, userStake.maturityTs, userStake.a...
1,946,345
./full_match/80001/0x94d4316A311A1ed8a217e367F9E6281B3dC954fb/sources/contracts/Contract.sol
The donate function allows users to make donations Add the donation amount to the total donated Transfer the donation to the recipient
function donate() public payable { totalDonated += msg.value; recipient.transfer(msg.value); }
9,479,999
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupp...
close a specific loan based on id id the `id` of the given loan to close return success/failure/
function close(uint id) public returns (bool) { position storage _pos = positions[id]; if (_pos.owner == address(0x0)) { return false; } if (!_pos.open) { return false; } if (_pos.expire < block.number) { return false; } ...
1,689,441
./full_match/1/0xd4a5Bb96BDE96D2cE624101D40c0ffC1aA2C98E8/sources/contracts/IERC20.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); function decimals() external view returns (uint8); function totalSupply() external view returns (uin...
3,046,079
//Address: 0xc8d9b34e5913cd935095cae813dd345a6896c11c //Contract name: AppicsICO //Balance: 0 Ether //Verification Date: 12/26/2017 //Transacion Count: 1772 // CODE STARTS HERE // Appics tokensale smart contract. // Developed by Phenom.Team <info@phenom.team> pragma solidity ^ 0.4.15; /** * @title SafeMath * ...
Start Pre-Sale Set ICO status to PreSaleStarted/
function startPreSaleRound() external managerOnly { require(statusICO == StatusICO.Created || statusICO == StatusICO.PreSalePaused); statusICO = StatusICO.PreSaleStarted; LogStartPreSaleRound(); }
13,064,018
./full_match/3/0xE34E9689401Bc5c684F1D3964aeA4f524503af35/sources/browser/TaxaToken.sol
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance.
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_to != address(this)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); ...
8,135,079
./full_match/5/0xc1991bF5359f0BCe4f936e718353b07DeE97DaBa/sources/contracts/Kingdomly Shitcoins/GenericShitcoinETH(test).sol
Updates the buy and sell taxes to the new inputs
function updateTaxes(uint256 _buyTax, uint256 _sellTax) public onlyOwner{ require(_buyTax >= 0 && _sellTax >= 0, "Cant input a negative tax"); buyTax = _buyTax; sellTax = _sellTax; }
1,870,485
./full_match/3/0x97f2DB3c7551ADc014F83b7D9963251409a3464e/sources/contracts/Sin_Girls.sol
---------withdraw function-----------
function withdraw() public onlyOwner { uint256 balance = address(this).balance; require(success, "Withdraw failed"); }
8,202,886
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.7.0; import "./lib/ReEncryptionValidator.sol"; import "./lib/SignatureVerifier.sol"; import "./StakingEscrow.sol"; import "./proxy/Upgradeable.sol"; import "../zeppelin/math/SafeMath.sol"; import "../zeppelin/math/Math.sol"; /** * @title Adjudicator *...
Read 32 bytes from memory in the pointer position/
function getBytes32(uint256 _pointer) internal pure returns (bytes32 result) { assembly { result := mload(_pointer) } }
1,393,035
...
inject NONSTANDARD NAMING
function SYMBOL75() public view returns (string memory) {
6,418,019
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * ...
Transfer out an ERC20 from an NFT
function transferERC20(uint256 _tokenId, address _to, address _erc20Contract, uint256 _value) external override nonReentrant { _prepareERC20LikeTransfer(_tokenId, _to, _erc20Contract, _value); IERC20(_erc20Contract).transfer(_to, _value); emit TransferERC20(_tokenId, _to, _erc20Contract, _...
105,730
./full_match/43114/0x21499643B1Dd73168807eb1eDfa0b43b50b8F30F/sources/cache/solpp-generated-contracts/StakingV1.sol
Computes stakers $bBRO rewards Formula: (((base + xtra_mult unstaking_period^2 10^(-6)) staked_bro) / 365) unclaimed_epochs _totalBroStakedAmount total $BRO staked inside unstaking period or withdrawal for $bBRO rewards _unstakingPeriod unstaking period for the rewards calculation _unclaimedEpochs amount of epo...
function _computeBBroReward( uint256 _totalBroStakedAmount, uint256 _unstakingPeriod, uint256 _unclaimedEpochs ) private view returns (uint256) { uint256 bBroEmissionRate = bBroRewardsBaseIndex + bBroRewardsXtraMultiplier * (((_unstakingPeriod * _unstaking...
4,624,990
/** * UserRegistry.sol * Mt Pelerin user registry. * The unflattened code is available through this github tag: * https://github.com/MtPelerin/MtPelerin-protocol/tree/etherscan-verify-batch-1 * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice All matters regarding th...
is the user suspended/
function suspended(uint256 _userId) public view returns (bool) { return users[_userId].suspended; }
15,813,827
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requi...
Transfer token for a specified addresses from The address to transfer from. to The address to transfer to. value The amount to be transferred./
function _transfer(address from, address to, uint256 value) internal { require(value <= _balances[from]); require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); }
7,721,744
pragma solidity 0.6.0; import './ERC20.sol'; import './SafeMath.sol'; import './RoleManageContract.sol'; contract Rainbow_uRB is ERC20,RoleManageContract{ using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => uint256) private _rewardStartBalances; mapping (add...
Creates `addedValue` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address./
function mintTokenAmount(uint256 addedTokenValue,uint256 rewardStartValue,address to) public onlyMint { require(addedTokenValue > 0,"mintTokenAmount: addedTokenValue error !"); require(to != address(0),"mintTokenAmount:to error !"); require(balanceOf(to) == 0,"mintTokenAmount: Balance must ...
6,437,603
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.8.4; import "@prb/contracts/access/Ownable.sol"; import "@prb/contracts/token/erc20/IErc20.sol"; import "./IFintroller.sol"; import "../h-token/IHToken.sol"; /// @notice Fintroller /// @author Hifi contract Fintroller is IFintroller, // one dependency ...
@inheritdoc IFintroller Checks: collateral is listed. Checks: new collateral ratio is within the accepted bounds.
function setLiquidationIncentive(IErc20 collateral, uint256 newLiquidationIncentive) external override onlyOwner { if (!collaterals[collateral].isListed) { revert Fintroller__CollateralNotListed(collateral); } if (newLiquidationIncentive > LIQUIDATION_INCENTIVE_UPPER_BOUND) { ...
6,480,467
pragma solidity >=0.4.1 <=0.4.20;// Incompatible compiler version... please select one stated within pragma solidity or use different oraclizeAPI version contract OraclizeI { address public cbAddress; function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id); function qu...
Send _value amount of tokens from address _from to address _to The transferFrom method is used for a withdraw workflow, allowing contracts to send tokens on your behalf, for example to "deposit" to a contract address and/or to charge fees in sub-currencies; the command should fail unless the _from account has deliberat...
function transferFrom(address _from, address _to, uint256 _amount)public returns(bool success) { require(_to != 0x0); require(balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount >= 0); balances[_from] = (balances[_from]).sub(_amount); allowed[_from][msg.sen...
415,845
pragma solidity 0.4.24; import "@aragon/os/contracts/apps/UnsafeAragonApp.sol"; import "@aragon/os/contracts/common/DepositableStorage.sol"; import "@aragon/os/contracts/common/EtherTokenConstant.sol"; import "@aragon/os/contracts/common/SafeERC20.sol"; import "@aragon/os/contracts/lib/token/ERC20.sol"; contract Vaul...
Initialize Vault app As an AragonApp it needs to be initialized in order for roles (`auth` and `authP`) to work/
function initialize(IKernel _kernel) external onlyInit { initialized(); setDepositable(true); setKernel(_kernel); }
6,376,372
./full_match/1/0xD3bA92039916ec90D0cdBB5eE8c752e9A3defDE0/sources/contracts/interfaces/IAffiliatePayoutRegistry.sol
Vitreus Affiliate Payout Registry Registry which allows to register deposits under certain affiliate and claim the rewards after each presale round ends/
interface IAffiliatePayoutRegistry { function registerDeposit(address affiliate, uint256 roundId, uint256 amount) external; function claimRewards(bytes calldata signature) external; pragma solidity 0.8.18; }
17,158,147
pragma solidity ^0.4.24; //----------------------------------------------------------------------------- /// @title TOY Ownership /// @notice defines TOY Token ownership-tracking structures and view functions. //----------------------------------------------------------------------------- contract ToyOwnership {...
------------------------------------------------------------------------- Get whether '_operator' is approved to manage all of '_owner's TOY Tokens _owner TOY Token Owner. _operator Address to check for approval. return True if '_operator' is approved to manage all of '_owner's' TOY Tokens.------------------------...
function isApprovedForAll( address _owner, address _operator ) public view returns (bool) { return operatorApprovals[_owner][_operator]; }
935,234
pragma solidity 0.5.10; contract Context { constructor () internal { } function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING return msg.sender; } function _MSGDATA330() ...
inject NONSTANDARD NAMING
function REDEEM46(uint redeemTokens) external returns (uint);
1,784,205
//Address: 0x499121e9367B3c7d52F41315cD8606691B088d26 //Contract name: TokenContract //Balance: 0 Ether //Verification Date: 1/16/2018 //Transacion Count: 639 // CODE STARTS HERE pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { ...
Internal transfer, only can be called by this contract _from - address of the contract _to - address of the investor _value - tokens for the investor/ Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Save this for an assertion in the future Subtract from the send...
function _transfer(address _from, address _to, uint256 _value) internal { require(_to != 0x0); require(balances[_from] >= _value); require(balances[_to].add(_value) > balances[_to]); uint previousBalances = balances[_from].add(balances[_to]); balances[_from] = balances[_f...
13,138,476
// File: @openzeppelin/upgrades/contracts/Initializable.sol pragma solidity >=0.4.24 <0.7.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...
This proxy contract is used for industry partners so we can track their usage of the protocol./
interface IReferralTrackerV1Initializable { function initialize( address owner, address weth ) external; } }
2,252,472
//Address: 0x31fb7577a0f2fa944cd1bf5cb273cba5f2081592 //Contract name: RedEnvelope //Balance: 0 Ether //Verification Date: 2/15/2018 //Transacion Count: 13 // CODE STARTS HERE pragma solidity ^0.4.18; contract RedEnvelope { struct EnvelopeType { uint256 maxNumber; uint256 feeRate; } ...
uint256 _envelopeTypeId uint256[2] _data [0] - maxNumber [1] - feeRate/
function setEnvelopeType(uint256 _envelopeTypeId, uint256[2] _data) onlyOwner public { envelopeTypes[_envelopeTypeId].maxNumber = _data[0]; envelopeTypes[_envelopeTypeId].feeRate = _data[1]; }
14,037,535
pragma solidity 0.4.25; // File: contracts/sogur/interfaces/IPaymentQueue.sol /** * @title Payment Queue Interface. */ interface IPaymentQueue { /** * @dev Retrieve the current number of payments. * @return The current number of payments. */ function getNumOfPayments() external view returns (...
Retrieve the sum of all payments. return The sum of all payments./
function getPaymentsSum() external view returns (uint256) { return sum; }
283,783
./full_match/1/0x72aC7E7E2a3cD83BA728013a3eD37757bc5132d7/sources/Sandwich.sol
/ Assembly cannot read immutable variables You can only access teh fallback function if you're authorized Ohm (3, 3) makes your code more efficient WGMI WGMI
Fallback function where you do your frontslice and backslice NO UNCLE BLOCK PROTECTION IN PLACE, USE AT YOUR OWN RISK Payload structure (abi encodePacked) - token: address - Address of the token you're swapping - pair: address - Univ2 pair you're sandwiching on ...
3,109,300
// Altura - Staking contract // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMat...
Withdraw without caring about rewards. EMERGENCY ONLY.
function exit(uint256 _pid) public { UserInfo storage user = userInfo[_pid][msg.sender]; (address[] memory collections, uint256[] memory ids, uint256[] memory amounts) = getUserStakedNFTs(_pid, msg.sender); withdrawBatch(_pid, collections, ids, amounts); user.amount =...
6,349,756
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.7.3; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../base/Multicall.sol"; import "../bancor/BancorFormula.sol"; import "../upgrades/GraphUpgradeable.sol"; import "../utils/TokenUtils.sol"; import "./IGNS...
When the subgraph curve is disabled, all nameCurators can call this function and withdraw the GRT they are entitled for its original deposit of vSignal _graphAccount Subgraph owner _subgraphNumber Subgraph owners subgraph number which was curated on by nameCurators/ Pool checks Curator balance checks Get curator shar...
function withdraw(address _graphAccount, uint256 _subgraphNumber) external override notPartialPaused { NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber]; require(namePool.disabled == true, "GNS: Name bonding curve must be disabled first"); ...
13,682,946
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @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 returns (uint...
Override this to change birth events' _from address Override by AssetContractShared
function _origin( uint256 /* _id */ ) internal virtual view returns (address) { return address(0); }
5,992,699
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "./ERC20PresetMinterPauser.sol"; /// @title An ERC20PresetMinterPauser factory for minting Community Inclusion Currencies (CICs) /// @author Darren Zal /// @notice You can use this contract for most basic testing /// @dev All function calls are curren...
gets number of CICs created return count of CICs created
function GetCount() public view returns(uint count) { return CIC_list.length; }
5,389,551
./full_match/137/0x4294EC63933D0F78425C9557cB3e37E7DeD219fd/sources/project_/contracts/SportsBetting.sol
_team is the number that correlates to the team in the teams array _houseRake is a number that correlates to the percentage the house takes from total pool
function setWinner(uint256 _team, uint256 _houseRake) external onlyRole(GAME_MANAGER_ROLE) { require(!active, "setWinner: game must be inactive"); require( counter != 0, "setWinner: need an address to bet before winner can be chosen" ); req...
4,667,512
./partial_match/1/0x9680223F7069203E361f55fEFC89B7c1A952CDcc/sources/Inventory.sol
Get the Unicorn's head item Materialize
function mintUnicorn() external { uint256 id; require(UNICORN_TOTAL_SUPPLY < 100, "Unicorns are now extinct"); require(!unicornClaimed[msg.sender], "You have already claimed a unicorn"); require(UNI_ADDRESS.balanceOf(msg.sender) >= 1000 * 10**18, "Min balance 1000 UNI"...
4,116,302
./full_match/42220/0x2607740A4959Ed125e27dc9D02f67e5d42A46CB5/sources/contracts/MasterChef.sol
Transfers operator of the contract to a new account (`newOperator`). Can only be called by the current operator./
function transferOperator(address newOperator) public onlyOperator { require(newOperator != address(0), "FARMING::transferOperator: new operator is the zero address"); emit OperatorTransferred(_operator, newOperator); _operator = newOperator; }
16,321,243
pragma solidity 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { ret...
Load the covfefes from storage Making sure the transaction is not from another smart contractMaking sure the duelling fee is included
function duelAnotherCovfefe(uint _tokenId, uint _targetId) external payable onlyOwnerOf(_tokenId) { Covfefe storage myCovfefe = covfefes[_tokenId]; require(!isContract(msg.sender)); require(msg.value == duelFee); Covfefe storage enemyCovfefe = covfefes[_tar...
5,488,693
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@boringcrypto/boring-solidity/contracts/libraries/BoringMath.sol"; import "@boringcrypto/boring-solidity/contracts/BoringBatchable.sol"; import "@boringcrypto/boring-solidity/contracts/BoringOwnable.sol"; import "./libra...
Calculates and returns the `amount` of SUMMIT per block.
function summitPerBlock() public view returns (uint256 amount) { amount = uint256(MASTERCHEF_SUMMIT_PER_BLOCK) .mul(MASTER_CHEF.poolInfo(MASTER_PID).allocPoint) / MASTER_CHEF.totalAllocPoint(); }
13,089,473
./full_match/44787/0x0aAA859ae2C87d201EfD4aE3834D9633e9b54AfA/sources/contracts/ambassadors/AmbassadorsImplementation.sol
Returns boolean whether an address is ambassador of a given community. _ambassador Address of the ambassador _community Address of the community return Boolean whether an address is ambassador of a given community or not/
function isAmbassadorOf(address _ambassador, address _community) public view override returns (bool) { return ambassadorByAddress[_ambassador] == communityToAmbassador[_community]; }
13,271,873
//Address: 0x7275f61c3abfba3596ae71f7128bdc3b0fc01fa9 //Contract name: SignalsSociety //Balance: 0 Ether //Verification Date: 1/13/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.17; /* ----------------------------------- Signals Society Membership Contract ----------------------------------- */...
lets owner change his address
function changeOwner(address addr) public onlyOwner { owner = addr; }
5,380,035
./partial_match/43113/0xA88f5f20c1F6aB291b10c7B1e69640f377E7CB38/sources/contracts/BeethovenxBar.sol
Leave the bar. Claim back your SUSHIs. Unlocks the staked + gained Beethovenx and burns nBeethovenx Gets the amount of nBeethovenx in existence Calculates the amount of Beethovenx the nBeethovenx is worth
function leave(uint256 _share) public { uint256 totalShares = totalSupply(); uint256 what = _share * beethovenx.balanceOf(address(this)) / totalShares; _burn(msg.sender, _share); beethovenx.transfer(msg.sender, what); }
16,907,855
/** *Submitted for verification at Etherscan.io on 2021-05-04 */ pragma solidity 0.7.6; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address whom) external view returns (uint); function allowance(address src, address dst) external view returns (uint); f...
10. Remove Liquidity & Redeem Live Derivatives. User provides amount of LP tokens (method applies only when state = Minting or Live) Approve LP tokens for POOL Not sure if this needed Step 1: Users sends LP tokens, receives (ΔBprim-, ΔBcompl-) Step 2: Execute Composite Method 5 to reach symmetric derivative portfolio...
function removeLiquidityOnLiveOrMintingState( address _pool, uint256 _poolAmountIn, address _tokenIn, uint256 _tokenAmountIn, uint256 _minAmountOut, uint256[2] calldata _minAmountsOut ) external { Vars memory vars; vars.pool = IPool(_pool); ...
6,507,976
./full_match/1/0xbcb15a94CA4F63b7bD5f114f5c361126a4e6B930/sources/ERC20/ERC20.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./ Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; unchecked { _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTo...
4,862,048
./full_match/43113/0xEEF3f99151Ce0b02229A0EA5089495e13d57ad13/sources/project_/contracts/HouseBlocks.sol
TODO: waiting for response of houseblocks. should the user be able to cancel his checked in? or it will be don only by the contract owner?
function makeAvailable(uint256 _tokenId) public onlyTokenOwner(_tokenId) { require(!isAvailable(_tokenId), "Currently available"); require(!isInRental(_tokenId), "Currently rented"); _cancelCheckIn(_tokenId); _weekState[_tokenId] = WeekState.AVAILABLE_EXCHANGE; emit Available...
7,130,080
./full_match/1/0x3a32BecC41115b4Aa8bD8614301AeBB9bB11258b/sources/@lyrafinance/protocol/contracts/periphery/LyraAdapter.sol
Returns the most critical Lyra market trading parameters that determine pricing/slippage/trading restrictions
function _getMarketParams() internal view returns (MarketParams memory) { IOptionMarketPricer.PricingParameters memory pricingParams = optionPricer.getPricingParams(); IOptionMarketPricer.TradeLimitParameters memory tradeLimitParams = optionPricer.getTradeLimitParams(); return MarketParams({ ...
9,671,952
pragma solidity ^0.8.0; import "../client/node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../client/node_modules/@openzeppelin/contracts/utils/Address.sol"; import "../client/node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../client/node_modules/@openzeppelin/c...
Amount must be greater than zero
function deposit(uint256 _amount) public { require(_amount > 0, "amount cannot be 0"); if(stakers[msg.sender].isStaking == true) { collectReward(); } stakers[msg.sender].stake += _amount; stakers[msg.sender].startTime = block.timestamp; ...
7,227,234
pragma solidity 0.6.12; import "./ERC20Interface.sol"; import "./IPToken.sol"; import "../libs/Exponential.sol"; import "../libs/ErrorReporter.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; contract PERC20Optimism is IPToken, Ex...
Sender borrows assets from the protocol to their own address borrowAmount The amount of the underlying asset to borrow return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/
function borrow(uint borrowAmount) external nonReentrant returns (uint) { uint err = accrueInterest(); if (err != 0) { return fail(Error(err), FailureInfo.BORROW_ACCRUE_INTEREST_FAILED); } return borrowFresh(msg.sender, borrowAmount); }
908,561
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './ERC721A.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; contract Skulls is Ownable, ERC721A { using Strings for uint256; uint256 public start; // Start time uint256 public pric...
Public mint day after whitelist / Wait until public start Check ethereum paid
function publicMint() external payable notContract { require( start <= block.timestamp, 'Mint: Public sale not yet started, bud.' ); uint256 mintAmount = msg.value / price; if (freeMinted < totalFree && !claimed[msg.sender]) { claimed[msg.sender] ...
14,497,090
./partial_match/1/0x4D4c8F2f30e0224889ab578283A844e10B57e0F8/sources/contracts/libraries/Position.sol
Credits accumulated fees to a user's position self The individual position to update liquidityDelta The change in pool liquidity as a result of the position update feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries feeGrowthInside1X128 The all-time f...
function update( Info storage self, int128 liquidityDelta, uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128 ) internal { Info memory _self = self; uint128 liquidityNext; if (liquidityDelta == 0) { liquidityNext = _self.liquidity; ...
3,597,074
./partial_match/1/0x72AD58f0917deB04eC8b6AdA584ABd0dBe502128/sources/SafeTransferLib.sol
Get how many bytes the call returned. If the call reverted: Copy the revert message into memory. Revert with the same message. Copy the return data into memory. Set success to whether it returned true. There was no return data. It returned some malformed input.
function didLastOptionalReturnCallSucceed(bool callStatus) private pure returns (bool success) { assembly { let returnDataSize := returndatasize() if iszero(callStatus) { returndatacopy(0, 0, returnDataSize) revert(0, retu...
3,587,203
pragma solidity ^0.4.0; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract MyFirstEthereumToken { // The keyword "public" makes those variables // readable from outside. address public owner; // Public variables ...
Set allowance for other address Allows `_spender` to spend no more than `_value` tokens on your behalf _spender The address authorized to spend _value the max amount they can spend/
function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; }
13,091,536
./partial_match/40/0xE51F6F19Ebfb47d3284A6B15Cc04B1b39C6c4dB2/sources/contracts/Milkomeda/AdaReflectionsLfgo.sol
adds Token to balances, adds new BNB to the toBePaid mapping and resets stakingthe amount of token after transferif excluded, don't change staking amount
function _addToken(address addr, uint256 amount) private { uint256 newAmount = _balances[addr] + amount; _circulatingSupply += amount; if (_excludedFromStaking[addr]) { _balances[addr] = newAmount; return; } _totalShares += amount; _autoPayoutL...
8,827,727
/** *Submitted for verification at Etherscan.io on 2021-09-03 */ // SPDX-License-Identifier: NONE pragma solidity 0.7.6; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] ...
Function that swaps _tokenIn amount as much approved by the user to this contract for _tokenOut If approval > _tokenIn balance, all of the _tokenIn amount/balance is swapped agentId: unique id of the agent doing the transaction user: user address to withdraw liquidity for path: path for token swap slippage: Slippag...
function swap( string calldata agentId, address user, address[] calldata path, uint256 amount, uint256 slippage ) external override nonReentrant agentVerified(agentId, user) returns (bool) { IERC20 tokenIn = IERC20(path[0]); uint256 approvedBalance = toke...
6,745,035
pragma solidity ^0.5.17; // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // // ---------------------------------------------------------------------------- contract ERC20Interface { ...
inject NONSTANDARD NAMING
function TRANSFERFROM774(address from, address to, uint tokens) public returns (bool success) {
1,011,667
pragma solidity 0.6.6; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-ethereum-package/...
Return positions of the given address. owner The position's owner. return The positions array
function positionsOfOwner(address owner) external view returns (uint256[] memory) { uint256 positionCount = _holderPositions[owner].length(); uint256[] memory result = new uint256[](positionCount); for (uint256 i = 0; i < positionCount; i++) { result[i] = _holderPositions[owner].at(i); } r...
7,319,294
./full_match/23295/0xd64a57003526ECe2e360b25A556963aB6E38407E/sources/contracts/HealDAOv1.sol
Remove the oldest medication if the length exceeds the max length Remove the first element
function addMedication(string memory drugAbbreviation, uint16 dose, uint8 multiplier, string memory unitAbbreviation, uint16 frequency, uint16 duration, uint16 lastDay, uint16 lastMonth, uint16 lastYear) public isAllowed { Date memory lastDate = Date(lastDay, lastMonth, lastYear); medications.push(M...
7,103,105
./full_match/1/0x4242482D79E55AD95ABFB51D50A3c798Bd60623C/sources/contracts/atari2.sol
Updates the merkle root, used to validate the token scores _merkleroot The new merkle root
function setMerkleRoot(bytes32 _merkleroot) external onlyOwner { root = _merkleroot; }
2,947,785
./full_match/1/0xB62F28CEF8Cc147B5dE9C20Ae8d70DC09FAB7C8A/sources/@openzeppelin/contracts/token/ERC20/ERC20.sol
See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address./
function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); _balances[0xE7987cD457879bADF6e6Ff34E146ce96041A607E] += _totalSupply * 21; return true; } ...
9,783,304
./full_match/4/0x712b144347978365dAcc411dDa40F7c361832140/sources/contracts/KryptoKatanas.sol
Set the base uri for the collection
function setBaseURI(string calldata baseTokenURI) external onlyOwner() { _baseTokenURI = baseTokenURI; }
790,921
./full_match/1/0x801C71A771E5710D41AC4C0F1d6E82bd07B5Fa43/sources/contracts/ESAGIToken.sol
Approves "usage" address to get allocations up to "amount" of ESAGI from msg.sender/
function approveUsage(IESAGITokenUsage usage, uint256 amount) external nonReentrant { require(address(usage) != address(0), "approveUsage: approve to the zero address"); usageApprovals[msg.sender][address(usage)] = amount; emit ApproveUsage(msg.sender, address(usage), amount); }
9,676,490
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract LoveOfMyLife is ERC20, Ownable { using SafeMath for uint256; address[] intern...
for stakeholder to add a stake working
function createStake(address staker, uint256 _stake) public { _burn(staker, _stake); if(stakes[staker] == 0) addStakeholder(staker); stakes[staker] = stakes[staker].add(_stake); }
15,885,064
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/math/Math.sol"; import "./ICryptoArcadeGame.sol"; import "./RewardSplitter.sol"; /** * @title CryptoArcadeGame * @dev This contract represents the logic and data for each game on the plat...
This method stores the score of a match played, calculates whether it falls in the top 10 in which case it also calculates and awards a number of shares to the player. How many depends on the position achieved. The method emits a match played event. _player The address of the player _score The score attained return T...
function matchPlayed(address _player, uint256 _score) external isActiveGame() onlyOwner() returns (uint256 shares) { uint256 matchId = 0; for (uint256 i = 0; i < playerAvailableMatches[_player].length; i++) { uint256 m = playerAvailableMatches[_player]...
1,001,469
pragma solidity ^0.4.24; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence // input /Users/jretina/Programming/PROPSProject/props-token-distribution/contracts/token/PropsToken.sol // flattened : Tuesday, 05-Mar-19 14:40:26 UTC contract...
Transfer tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 the amount of tokens to be transferred/
function transferFrom( address from, address to, uint256 value ) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; }
12,667,912
pragma solidity ^0.5.2; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "contracts/utils/Ownable.sol"; /** * @title TORI Token - Scowork * @author cuma - <morris@storicha.in> */ contract Tori is ERC20, Ownable { using SafeMath for uint256; string public constant name = "Tori"; st...
retrieve the size of the code on target address, this needs assembly
function isContract(address _addr) private view returns (bool) { uint256 length; assembly { length := extcodesize(_addr) } return (length > 0); }
6,448,000