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/1/0x83797D8608aA53dFcC77D350081383dF021ee5Bc/sources/contracts/base/ERC721.sol
See {IERC721-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 tokenId ) external override { require(tokenId >= _idShift, 'ERC721: operator query for nonexistent token'); tokenId = tokenId - _idShift; require(_isApprovedOrOwner(_msgSender(), tokenId), 'ERC721: tran...
17,008,120
./partial_match/1/0xD06337A401B468657dE2f9d3E390cE5b21C3c1C0/sources/MonStaker2.sol
award existing doom update to total amount ensure the total is less than max stake update stake records transfer tokens to contract
function addStake(uint256 amount) public { require(whitelistChecker.whitelist(address(this)), "Staker not whitelisted!"); require(amount > 0, "Need to stake nonzero"); awardDoom(msg.sender); uint256 newAmount = stakeRecords[msg.sender].amount.add(amount); require(newAmount <= maxStake, "Exceed...
9,229,310
pragma solidity ^0.4.24; import "zeppelin/ownership/Ownable.sol"; /** * @title Ticket Sale * This contract contains the sale logic. Mainly methods for * the owner to manipulate the sale, mappings with the necessary * information to keep track of the owners, parameters of the * sale and a function for cust...
Buys _nTickets for msg.sender Throws if: - the total number of tickets overflows maxTickets (uint32) _nTickets the number of tickets to add to the sale/ check possible overflow of maxTickets
function addMoreTickets(uint32 _nTickets) external onlyOwner { require(maxTickets + _nTickets <= 2**32 - 1); maxTickets += _nTickets; }
12,870,193
./full_match/3/0xB957ECe54D432C4cF76a2187274008db07f3F07D/sources/verified-sources/0x7fe33f447267f50aa30b0777b85e7e63bb3bde55/sources/Student_Transcripts.sol
The below functions are getters.
function getFirstName()public view returns(string memory) { return FirstName; }
8,143,550
./full_match/5/0x16E561f0b13b80671Cd6Eb5091dA20403647dF70/sources/contracts/SygnumERC721.sol
Function returning the URI to access token metadata tokenId The token ID return string The corresponding URI in string format/
function uri(uint256 tokenId) external view virtual returns (string memory) { if (!_exists(tokenId)) revert SygnumERC721InvalidTokenID(); string memory baseURI = baseUri; return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), ".json")) : ""; }
7,043,498
/** *Submitted for verification at Etherscan.io on 2022-01-06 */ /** --------------------------------------------------------------------- BATMOON Token T.me/BATMOONERC BATMOON aspires to establish a decentralized project where the investor is an active contributor to the project. All investors in the pack will be w...
exclude from paying fees or having max transaction amount
constructor() ERC20("BATMOON", "BATMOON") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_u...
10,940,753
pragma solidity ^0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than a...
Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful.
function mint(address _to, uint256 _amount) public onlyMinter returns (bool) { uint256 available = availableTokens(); require(_amount <= available); leftOnLastMint = available.sub(_amount); require(token.mint(_to, _amount)); return true; }
6,763,542
//Address: 0xd11797a6fbeb97e388b1ce73bc40903508a0ab3c //Contract name: SetStepFunctionWrapper //Balance: 0 Ether //Verification Date: 2/7/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; contract PermissionGroups { address public admin; address public pendingAdmin; mapping(addres...
check all x for buy are positive and y are positive as well check all x for sell are negative and y are positive
function setImbalanceStepFunction(ERC20 token, int[] xBuy, int[] yBuy, int[] xSell, int[] ySell) public onlyOperator { uint i; for( i = 0 ; i < xBu...
2,528,695
pragma solidity ^0.4.19; import './libraries/SafeMath.sol'; import './libraries/CryptoDollarStorageProxy.sol'; import './libraries/CryptoFiatStorageProxy.sol'; import './libraries/RewardsStorageProxy.sol'; import './interfaces/ProofTokenInterface.sol'; import './interfaces/RewardsInterface.sol'; import './interfaces/C...
Currently the oraclizeFee is withdrawn after receiving the tokens. However, what happens when a user sells a very small amount of tokens ? Then the contract balance decreases (the total value sent to the user is also 0) which is problematic. The workarounds are: - Add a transaction fee that corresponds to the transacti...
function sellCryptoDollar(uint256 _tokenAmount) public payable { uint256 oraclizeFee = oraclize_getPrice("computation"); uint256 tokenBalance = cryptoDollar.balanceOf(msg.sender); require(_tokenAmount >= 0); require(_tokenAmount <= tokenBalance); if (feed == Feed.ORACL...
6,385,755
./partial_match/1/0x8510211a852F0c5994051dd85EaEF73112A82Eb5/sources/ApprovedTransfer.sol
Changes the daily limit. The change is immediate. _wallet The target wallet. _newLimit The new limit./
function changeLimit(address _wallet, uint256 _newLimit) external onlyWalletFeature(_wallet) onlyWhenUnlocked(_wallet) { uint128 targetLimit = LimitUtils.safe128(_newLimit); ILimitStorage.Limit memory newLimit = ILimitStorage.Limit(targetLimit, targetLimit, LimitUtils.safe64(block.timestamp)); ...
3,971,315
./partial_match/4/0xB5c78B1091b67cBbf54db3527b5145af4106907E/sources/beyondExProx.sol
uint256 collatteralValueInBYN;
function burnUSDbToReleaseCollateral (address _beneficiary, uint256 _value) onlyContract external returns(uint256){ require (start == true,"Exchange not started"); uint256 collatteralRatioUpdated; getBeyondTokenValue(); (, /*collatteralValueInBYN*/, , , co...
8,647,306
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/introspection/IERC165.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/con...
Method for accepting the offer _nftAddress NFT contract address _tokenId TokenId _creator Offer creator address
function acceptOffer( address _nftAddress, uint256 _tokenId, address _creator ) external nonReentrant offerExists(_nftAddress, _tokenId, _creator) { _acceptOffer(_nftAddress, _tokenId, _creator, ""); }
14,679,213
// Dependency file: @openzeppelin/contracts/utils/Address.sol // pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [// importANT] * ==== * It is unsafe to assume that an a...
Calculate trade size and whether trade is buy. Trade size is the minimum of the max size and components left to trade. Reverts if target quantity is already met. Target unit is adjusted based on ratio of position multiplier when target was defined and the current positionMultiplier./
function _calculateTradeSizeAndDirection(address _component) internal view returns (bool isBuy, uint256) { uint256 totalSupply = index.totalSupply(); uint256 componentMaxSize = assetInfo[_component].maxSize; uint256 currentPositionMultiplier = index.positionMultiplier().toUint256(); ...
1,340,306
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; // BottlenoseToken w...
Returns the address is excluded from blackList or not./
function isBlackListed(address _account) public view returns (bool) { return blackList[_account]; }
12,787,099
./full_match/80001/0x5fCd22D34Daf62Db18e20323d9689Cd2001f90DC/sources/project_/contracts/MysticGalacticMission1.sol
Returns the current price for minting a token in MATIC. return The current price in Matic./
function getCurrentPrice() public view returns (uint256) { return Util.convertUSDtoMATIC(usdPrice, priceFeed); }
9,442,780
./partial_match/1/0x2b99bEdE91684F28D9e9D04EF7558643e4EdD4D0/sources/@gearbox-protocol/core-v2/contracts/core/ACL.sol
Returns true if an address has configurator rights account Address to check
function isConfigurator(address account) external view override returns (bool) { }
15,998,326
// Sources flattened with hardhat v2.6.4 https://hardhat.org // File contracts/Ethereum/libraries/LibAppStorage.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.1; struct Aavegotchi { address owner; } struct AppStorage { mapping(uint256 => bool) itemTypeExists; uint256[] itemTypes; mapping(ad...
This function is used by transfer functions
function internalTransferFrom( address _sender, address _from, address _to, uint256 _tokenId ) internal { require(_to != address(0), "ER721: Can't transfer to 0 address"); address owner = s.aavegotchis[_tokenId].owner; require(owner != address(0), "ERC721:...
561,438
./partial_match/100/0x3A7083E709BCCd0Fc5fb53cC0Ce9DBd3b5a82DcB/sources/XDaiGsnDeployer.sol
acceptanceBudget - Paymaster expected gas budget to accept (or reject) a request This a gas required by any calculations that might need to reject the transaction, by preRelayedCall, forwarder and recipient. See value in BasePaymaster.PAYMASTER_ACCEPTANCE_BUDGET Transaction that gets rejected a...
function addRelayWorkers(address[] calldata newRelayWorkers) external; function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external; function depositFor(address target) external payable; function withdraw(uint256 amount, address payable dest) external; ...
16,643,546
./partial_match/42/0x526dBb7270DcE7982a957f5C159177f2474342aB/sources/DFG.sol
address pair = uniswapFactory.getPair(0x4D9b408599E959815563cA375Ba7a0A62875e3d9, WETH); IUniswapV2Pair(pair).swap(amountOut, 0, address(this), "");
function addEthLiquidityLGETEST222() public payable { address WETH = uniswapRouterV2.WETH(); uint256 ethForMarketBuyRFI = 200000000000000000; uint256 amountOut = getEstimatedRFIforETHTEST(ethForMarketBuyRFI); IERC20(RFIaddress).approve(addr...
3,297,639
./full_match/4/0xf5A75c51a5Eec837feA1F0e774969acb2CBbBe9F/sources/contracts/features/token/ERC1155/base/ERC1155BaseInternal.sol
burn given batch of tokens held by given address account holder of tokens to burn ids token IDs amounts quantities of tokens to burn/
function _burnBatch( address account, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); require( ids.length == amounts.length, "ERC1155: ids and amounts length...
813,688
./full_match/1/0x000000a56Aaca3e9a4C479ea6b6CD0DbcB6634F5/sources/contracts/smart-account/BaseSmartAccount.sol
return the entryPoint used by this account. subclass should return the current entryPoint used by this account./ sends to the entrypoint (msg.sender) the missing funds for this transaction. subclass MAY override this method for better funds management (e.g. send to the entryPoint more than the minimum required, so that...
function entryPoint() public view virtual returns (IEntryPoint); function _payPrefund(uint256 missingAccountFunds) internal virtual { if (missingAccountFunds != 0) { payable(msg.sender).call{ value: missingAccountFunds, gas: type(uint256).max }(""...
2,908,064
./partial_match/1/0x0569168709a869e7f4Ba142c49BFF7faA14f76C8/sources/@violetprotocol/mauve-core/contracts/interfaces/callback/IMauveMintCallback.sol
Callback for IMauvePoolActionsmint Any contract that calls IMauvePoolActionsmint must implement this interface
interface IMauveMintCallback { function mauveMintCallback( uint256 amount0Owed, uint256 amount1Owed, bytes calldata data ) external; pragma solidity >=0.5.0; }
9,350,743
pragma solidity =0.6.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "./libraries/TransferHelper.sol"; import "./interfaces/IPancakeRouter02.s...
Writes an address into a specific position in a byte array. b Byte array to insert address into. index Index in byte array of address. input Address to put into byte array.
{ function writeAddress( bytes memory b, uint256 index, address input ) internal pure if (b.length < index + 20) { LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichErrorsV06.InvalidByteOperationE...
600,807
pragma solidity =0.5.16; interface IBoxswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) exte...
this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) { uint balance0 = IERC20(_token0).balanceOf(address(this)); uint balance1 = IERC20(_token1).balanceOf(address(this)); uint liquidity = balanceOf[address(this)]; bool feeOn = _mintFee(_reserve0, _reserve1); ...
5,902,707
/** *Submitted for verification at Etherscan.io on 2021-12-20 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }...
Migrate LP and pair with new OHM/ Since we are adding liquidity, any existing balance should be excluded Fetch the treasury balance of the given liquidity pair Remove the V1 liquidity Migrate the V1 OHM to V2 OHM Add the V2 liquidity Send any leftover balance to the governor
function migrateLP( address pair, IUniswapV2Router routerFrom, IUniswapV2Router routerTo, address token, uint256 _minA, uint256 _minB, uint256 _deadline ) external onlyPolicy { uint256 initialNewOHMBalance = newOHM.balanceOf(address(this)); uint256 oldLPAmount = IERC20(pair).bala...
15,115,007
./partial_match/56/0xC3489Ed8bAdF4d03f5B0CF776f8AFbB9bBaD560F/sources/FlaskProtector.sol
File: contracts\@interface\IFlaskProtector.sol
interface IFlaskProtector{ function buybackFlask(address _router,address flask,uint256 cp,address token0,address token1) external ; }
11,130,218
./partial_match/42/0xeA5176160b4076635B78c9434A62715263D668Bb/sources/Clock.sol
this kicks off the request and returns through fulfill_random
function getRandomNum() private { RandomnessInterface(governance.randomness()).getRandom(lotteryId, lotteryId); }
3,382,930
./full_match/1/0x84524bAa1951247b3A2617A843e6eCe915Bb9674/sources/contracts/WiseLending.sol
Allows to give permission for onBehalf function execution, allowing 3rd party to perform actions such as borrowOnBehalf and withdrawOnBehalf with amount limit/
function approve( address _spender, address _poolToken, uint256 _amount ) external { allowance[msg.sender][_poolToken][_spender] = _amount; emit Approve( _spender, _poolToken, msg.sender, _amount, bl...
8,497,203
// SPDX-License-Identifier: MIT pragma solidity >=0.7.5; pragma abicoder v2; import "./interfaces/IOracle.sol"; import "./libraries/SafeMath.sol"; import "./libraries/LibraryV2Oracle.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory...
produces the cumulative price using counterfactuals to save gas and avoid a call to sync. if time has elapsed since the last update on the pair, mock the accumulated price values subtraction overflow is desired addition overflow is desired counterfactual counterfactual
function currentCumulativePrices(address pair) internal view returns ( uint256 , uint256 , uint32 ) { uint32 blockTimestamp = currentBlockTimestamp(); uint256 price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast(); ...
5,802,513
./full_match/1/0x2c75A27616117C680AD289590D278C8294fCFE9e/sources/contracts/PolygonZkEVM.sol
Function to update the batch fee based on the new verified batches The batch fee will not be updated when the trusted aggregator verifies batches newLastVerifiedBatch New last verified batch/ Load sequenced batchdata Check if timestamp is below the verifyBatchTimeTarget update currentBatch The rest of batches will be ...
function _updateBatchFee(uint64 newLastVerifiedBatch) internal { uint64 currentLastVerifiedBatch = getLastVerifiedBatch(); uint64 currentBatch = newLastVerifiedBatch; uint256 totalBatchesAboveTarget; uint256 newBatchesVerified = newLastVerifiedBatch - currentLastVerified...
4,995,563
/* HABEO - (share around) ---------------------- HABEO is the teoken that will change the way we use crypto. We'll make it easy to use and easy to understand so everyone can take advantage of it. This code is fully commented so everyone can learn from it. The comments are only in english for practical purposes but i...
Standard transactions are the easiest. Two regular wallets trading tokens. Very low fee. 2% total. (1% tax rate) Standard transfers have a tax rate of 1 so we hardcode it to save gas. Remove the reflections from the sender Add the reflections (minus taxes) to the recipient. Now, take care of the liquidity and fees Show...
function transferStandard(address sender, address recipient, uint256 tAmount) private { uint256 rAmount; uint256 rTransferAmount; uint256 rFee; uint256 tTransferAmount; uint256 tFee; (rAmount, rTransferAmount, rFee, tTransferAmount, tFee) = getValues(tAmount, 1); ...
12,583,465
pragma solidity ^0.5.10; /** @title BitcoinSPV */ /** @author Summa (https://summa.one) */ import {BTCUtils} from "../BTCUtils.sol"; contract BTCUtilsTest { /* ***** */ /* UTILS */ /* ***** */ /// @notice Determines the length of a VarInt in bytes /// @dev A VarInt of >1 byte...
Converts big-endian bytes to a uint Traverses the byte array and sums the bytes _b The big-endian bytes-encoded integer return The integer representation
function bytesToUint(bytes memory _b) public pure returns (uint256) { return BTCUtils.bytesToUint(_b); }
7,218,429
// TODO compile // SPDX-License-Identifier: UNLICENSED pragma solidity =0.7.6; pragma abicoder v2; import './OracleTest.sol'; contract OracleEchidnaTest { OracleTest private oracle; bool private initialized; uint32 private timePassed; constructor() { oracle = new OracleTest(); } fun...
compute the time weighted tick, rounded towards negative infinity
function checkTimeWeightedAveragesAlwaysFitsType(uint32 secondsAgo) external view { require(initialized); require(secondsAgo > 0); uint32[] memory secondsAgos = new uint32[](2); secondsAgos[0] = secondsAgo; secondsAgos[1] = 0; (int56[] memory tickCumulatives, uint160[...
882,631
./full_match/4/0x21f44849d9490749c9EC9b49Fba383Bc4e5240d9/sources/pugzilla1.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
734,881
./full_match/80001/0x7adD12A71d1A5C783FEE47E9805Cd90347EA13f9/sources/contracts/PurchaseHook.sol
Function that is called at the begining of the `purchase` function on the Public Lock contract. It is expected to return the price that has to be paid by the purchaser (as a uint256). If this reverts, the purchase function fails./
function keyPurchasePrice( address /* from */, address /*recipient */, address /* referrer */, bytes calldata /* data */ ) external view returns (uint256 minKeyPrice) { if ( !walletHoldsToken( msg.sender, 0x2f52Bff6c0c844dE979b4...
867,221
./full_match/137/0xEC7790B5Fe55BFe7F09f9f463A4B39f415d40181/sources/contracts/MutantPandaFatClub.sol
1. Override the claim function to ensure a few things: - They own an NFT from the BAYClone contract - They own an NFT from the SerumClone contract
function verifyClaim(address _claimer, uint256 _quantity) public view virtual override { require(panda.balanceOf(_claimer) >= _quantity, "You don't own enough panda NFTs"); require(serum.balanceOf(_claimer, 1) >= _quantity, "You don't own enough Serum NFTs"); ...
3,747,171
./partial_match/3/0x703dBe8dAA54BbD6C46D13a5134461C39b40fa4D/sources/Nexon.sol
Function to get Rewards on the stake id stake id for the stake/
function getRewardsDetailsOfUserById(uint256 id) public view returns(uint256){ uint256 bpDay = calculateBigPayDayReward(_stakingEndTime[id], _usersTokens[id]); if(_stakingEndTime[id] > now){ return (((now - _stakingStartTime[id])/86400) * (_rewardPercentage) * _usersTokens[id])/1000 + bpDay; ...
5,098,915
// contracts/EarthFundVesting.sol // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); ...
Returns the vesting schedule id at the given index. return the vesting id/
function getVestingIdAtIndex(uint256 index) external view returns(bytes32){ require(index < getVestingSchedulesCount(), "EarthFundVesting: index out of bounds"); return vestingSchedulesIds[index]; }
1,009,705
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the on...
sets contract uri newURI the new uri
function setContractURI(string memory newURI) external onlyOwner { _setContractURI(newURI); }
495,799
./full_match/4/0x18Be7dB1a84062eE9e7361A686495d7b3Fc97a26/sources/contracts/TradingContract.sol
The buy function will swap the baseToken to pairedToken. The _ratio is the fraction of the total availablebaseToken which shall be traded. The _slippage is the fraction of the price which will be accepted as a minimalreturn for the swap.
function buy(uint256 _ratio, uint256 _slippage) external onlyOwner checkSufficientGasOwner { require(totalInvested > invested[deployer], 'Not enough funds to trade'); accumulatedFees = accumulatedFees.add(getAmountOutMin(WETHAddress, baseTokenAddress, IBalanceLogicContract(masterContract.getBalance...
658,664
pragma solidity ^0.4.17; contract ERC20 { function totalSupply() public view returns (uint supply); function balanceOf( address who ) public view returns (uint value); function allowance( address owner, address spender ) public view returns (uint _allowance); function transfer( address to, uint...
指定したユーザに対し、送付操作が許可されているトークンの分量を返す addr {address} - 資金源となるユーザのアドレス spender {uint} - 送付操作を許可しているユーザのアドレス return {uint} 許可されているトークンの分量を返す/
function allowance(address addr, address spender) public constant returns (uint) { return implementation.allowance(addr, spender); }
6,415,995
pragma solidity ^0.4.21; contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf(address _owner) public view returns (uint256 balance); function implementsERC721() public pure returns (bool); function ownerOf(uint256 _tokenId) public view ret...
Check for token ownership
function _owns(address claimant, uint256 _tokenId) private view returns (bool) { return claimant == countryIndexToOwner[_tokenId]; }
1,971,171
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Requirements: `user` User wallet address returns user staking data/
function userDeposits(address user) external view returns ( uint256, uint256, uint256, uint256 ) { if (hasStaked[user]) { return ( deposits[user].depositAmount, deposits[user].depo...
6,873,611
pragma solidity ^0.4.18; contract VotingContract { uint public PriceToAdd; uint public PriceToVote; address[] Voters; mapping (address => uint) public votes; address[] public Candidates; uint public numberOfCandidates; function VotingContract(address[] FirstCandidates, uint priceToVote, uint priceToA...
require(!HasVoted(msg.sender));
function voteForCandidate(address Candidate) public payable { require(msg.value == PriceToVote); require(CandidateExists(Candidate)); votes[Candidate] += 1; Voters.push(msg.sender); }
12,572,136
./full_match/44787/0x6B21Af6aA0F656A4ea1b2Db85A676cF33E67711E/sources/src/SpiralsStaking.sol
For updating with validator group we stake with. Performs some simple checks to make sure address given is an eligible validator group (limited to 1 for now).
function setValidatorGroup(address _newValidatorGroup) external onlyOwner { require( getValidators().isValidatorGroup(_newValidatorGroup), "NOT_VALIDATOR_GROUP" ); require( getElection().getGroupEligibility(_newValidatorGroup), "NOT_ELIGIBLE_VG...
13,246,286
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; /// @title Stores packed 32 bit timestamp values /// @notice Contains methods for working with a mapping from tick to 32 bit timestamp values, specifically seconds /// spent outside the tick. /// @dev The mapping uses int24 for keys since ticks are represen...
Computes the position of the least significant bit of the 32 bit seconds outside value for a given tick tick the tick for which to compute the position tickSpacing the spacing between usable ticks return wordPos the key in the mapping containing the word in which the bit is stored return shift the position of the lea...
function position(int24 tick, int24 tickSpacing) private pure returns (int24 wordPos, uint8 shift) { require(tick % tickSpacing == 0); int24 compressed = tick / tickSpacing; wordPos = compressed >> 3; shift = uint8(compressed % 8) * 32; }
12,556,912
pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ ...
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if ((address(sender) == creator) && (burma == false)) { buthan =...
1,675,556
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol
Reads the bytes28 at `mPtr` in memory.
function readBytes28( MemoryPointer mPtr ) internal pure returns (bytes28 value) { assembly { value := mload(mPtr) } }
3,218,640
./partial_match/1/0x5BB837766F98dF4e761E63e33ea5C46292d6fA82/sources/contracts/AriaLand.sol
Function to start/stop public sale/
function enablePublicSale() external onlyOwner { isFfSaleActive = false; isPublicSaleActive = true; isWhitelistSaleActive = false; }
3,539,644
pragma solidity 0.5.6; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "./interfaces/I...
calculate user reward
function claimReward() external { address sender = msg.sender; uint256 rewardForLiquidity; uint256 userLiquidity = _lp.balanceOf(sender); if (totalLiquidity == 0) { rewardForLiquidity = 0; rewardForLiquidity = totalReward.mul(userLiquidity).div(totalLiquidity...
6,445,322
./partial_match/3/0x665b3FA6c5D2E3A787485B46AFC3f9c990f8bA08/sources/Airdrop.sol
messageHash can be used only onceVerifes signatureTransfer
function claim(uint256 deadline, bytes calldata signature) public constractStatus { require(!userStatus[tx.origin], "Claim: Duplicate "); require(deadline > now, "Claim:Time Expired" ); uint256 _amount = IERC20(sam).balanceOf(tx.origin); bytes3...
5,116,228
pragma solidity ^0.4.18; import "./LinkedListLib.sol"; contract LinkedListTestContract { using LinkedListLib for LinkedListLib.LinkedList; uint256 constant NULL = 0; uint256 constant HEAD = 0; bool constant PREV = false; bool constant NEXT = true; LinkedListLib.LinkedList list; event LogNotice(string ...
Can be used before `insert` to build an ordered list _node an existing node to search from, e.g. HEAD. _value value to seek _direction direction to seek in return next first node beyond '_node' in direction `_direction`
function getSortedSpot(uint256 _node, uint256 _value, bool _direction) view public returns (uint256 next) { return list.getSortedSpot(_node,_value,_direction); }
12,995,904
pragma ton-solidity ^0.37.0; pragma AbiHeader expire; pragma AbiHeader time; pragma AbiHeader pubkey; import "./Auction.sol"; import "./Certificate.sol"; import "./interfaces/IRootAuction.sol"; import "./interfaces/IRootManagement.sol"; import "./utils/Stash.sol"; import "./interfaces/IRoot.sol"; /** * ██████╗ ...
/ Certificate.receiveRegistrationInfo() callback / Deployment. If the auction has already deployed, the transaction will be aborted //
function onReceiveRegistrationInfo(uint128 rHash, uint32 expirationTime) public hashExists(rHash) validHashSource(rHash) canBePutUpForAuction(expirationTime) { AuctionParameters parameters = _unpack(rHash); address auctionAddress ...
6,382,720
pragma solidity ^0.5.0; contract GgwpToken { //ERC-20 Token Standard: function name() public view returns (string) string public name = "GGWP Token"; //ERC-20 Token Standard: function symbol() public view returns (string) string public symbol = "GGWP"; //ERC-20 Token Standard: function...
ERC-20 Token Standard: function totalSupply() public view returns (uint256)
function totalSupply() public view returns (uint256) { return totalGGWP; }
1,783,864
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/helpers/PointerLibraries.sol
Reads the uint24 at `cdPtr` in calldata.
function readUint24( CalldataPointer cdPtr ) internal pure returns (uint24 value) { assembly { value := calldataload(cdPtr) } }
4,300,216
// File: openzeppelin-solidity/contracts/access/Roles.sol pragma solidity ^0.5.2; /** * @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 ...
Returns amount of time passed since start/
function vestedTime() public view returns (uint) { uint currentTime = block.timestamp; return currentTime.sub(start); }
986,391
/** *Submitted for verification at Etherscan.io on 2022-01-25 */ // ((((((((((((((((((. // ((((((((((((((((((((((((((* // /(((((((((((((((((((((((((((((((* // ((((((...
Required interface of an ERC721 compliant contract./
interface IERC721Supply is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); funct...
10,555,982
pragma solidity ^0.4.24; /* * Wall Street Market presents...... .______ __ __ __ _______ ______ __ __ __ .______ _______ ___ .___ ___. _______ | _ \ | | | | | | | ____| / || | | | | | | _ \ / _____| / \ | \/ | | ____...
Seperate function to handle internal purchases for the 82 Group data setup no point in continuing execution if OP is a poorfag russian hacker prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world (or hackers) and yes we know that the safemath function automatically ...
{ uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, dividendFee_), 100); uint256 _referralBonus = SafeMath.div(_undividedDividends, 3); uint256 _fundPayout = SafeMath.div(SafeMath.mul(_incomingEthereum, fundFee_ + altFundFee_), 100); uint256 _dividends = Safe...
1,798,677
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; //To generate unique token IDs import "@openzeppelin/contracts/utils/Counters.sol"; //For security control and it prevents a contract from calling itself, directly or indirectly import "@openzeppelin/co...
Fetching the NFTs created by a user /
function fetchItemsCreated() public view returns (MarketItem[] memory) { uint256 totalItemCount = _itemIds.current(); uint256 itemCount = 0; uint256 currentIndex = 0; for (uint256 i = 0; i < totalItemCount; i++) { if (idToMarketItem[i + 1].seller == msg.sender) { ...
7,211,359
/** *Submitted for verification at Etherscan.io on 2020-04-16 */ pragma solidity 0.6.2; pragma experimental ABIEncoderV2; /** * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer. * `CREATE2` can be used to compute in advance the address where a smart * contract will be deployed, which allows...
Returns the address where a contract will be stored if deployed via {deploy} from a contract located at `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}./
function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) { bytes32 _data = keccak256( abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash) ); return address(bytes20(_data << 96)); }
2,555,963
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./inte...
all whitelist mints take place during the presale phase, no need to check for other prices. verify merkle proof
function whitelistMintCommit(uint256 index, uint256 a, uint256 amount, bytes32[] calldata merkleProof, bool stake) external payable whenNotPaused nonReentrant requireEOA { require(_pendingCommitId[_msgSender()] == 0, "Already have pending mints"); require(_whitelistClaims[_msgSender()] + amount <= 2, "ex...
5,845,926
// Copyright 2022 Cartesi Pte. Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by ...
this function can be called to check the number of claims that's redeemable for the validator ds pointer to FeeManager's diamond storage _validator address of the validator underflow checked by default with sol0.8 which means if the validator is removed, calling this function will either return 0 or revert
function numClaimsRedeemable(DiamondStorage storage ds, address _validator) internal view returns (uint256) { require(_validator != address(0), "address should not be 0"); LibValidatorManager.DiamondStorage storage validatorManagerDS = LibValidatorManager.dia...
2,553,728
./full_match/80001/0xCEB333c393AA3273ea71C03C7347A474FE562770/sources/contracts/ExtendedDrop.sol
インデックスにする 対応するカテゴリのトークンIDを見つける トークンをclaimする インクリメント すべてのトークンがclaimされた場合、次のトークンカウントを0に設定する 次のトークンインデックスを更新する
function claim( address _receiver, uint256 _category, uint256 _quantity, address _currency, uint256 _pricePerToken, AllowlistProofWithCategory calldata _allowlistProof, bytes memory _data ) public payable override { uint256 nextTokenIndex = _nextTokenArr...
849,704
// SPDX-License-Identifier: (c) Armor.Fi DAO, 2021 pragma solidity ^0.6.12; interface IArmorMaster { function registerModule(bytes32 _key, address _module) external; function getModule(bytes32 _key) external view returns(address); function keep() external; } /** * @title Ownable * @dev The Ownable cont...
Main function to withdraw Ether from ClaimManager, exchange, then transfer to arNXM Vault. _ethAmount Amount of Ether (in Wei) to withdraw from ClaimManager. _minNxm Minimum amount of NXM we will accept in return for the Ether exchanged./
function buyNxm(uint256 _ethAmount, uint256 _minNxm) external onlyExchanger { _requestFunds(_ethAmount); INXMPool pool = INXMPool(NXM_MASTER.getLatestAddress("P1")); _transferNXM(); }
12,218,654
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/drafts/Counter.sol"; contract BountyApp { using SafeMath for uint256; using Counter for Counter.Counter; address public owner; bool public stopped = false; /** ...
Activate the emergency mode (Circuit Breaker design patter) Only the owner of the smart contract can do it/
function activateCircuitBreaker() onlyOwner public { stopped = true; }
12,945,443
// File: contracts\lib\TransferHelper.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.6; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) intern...
To support open-zeppelin/upgrades nestGovernanceAddress INestGovernance implementation contract address
function setConfig(Config calldata config) external; function getConfig() external view returns (Config memory); function setApplication(address addr, uint flag) external; function checkApplication(address addr) external view returns (uint); function carveETHReward(address ntokenAddress) externa...
52,622
./partial_match/4/0xB5E35D93b77F544F4CF29c031c5d4d6Aa131976E/sources/EphimeraToken.sol
Note: Only other smart contracts should have this role, in theory
function hasContractWhitelistRole(address _address) public view returns (bool) { return hasRole(CONTRACT_WHITELIST_ROLE, _address); }
8,509,864
./full_match/4/0x90641Be52c0F2bD0B9c7F3C84CEE6Eee2bDB9000/sources/home/user/Documents/Projects/solidity/arbitrage-bot/third-party-contracts/USDC/USDC.sol
Mark an authorization as used authorizer Authorizer's address nonce Nonce of the authorization/
function _markAuthorizationAsUsed(address authorizer, bytes32 nonce) private { _authorizationStates[authorizer][nonce] = AuthorizationState.Used; emit AuthorizationUsed(authorizer, nonce); }
13,310,666
./partial_match/1/0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0/sources/contracts/exchangeIssuance/FlashMintLeveraged.sol
Performs all the necessary steps for issuance using the collateral tokens obtained in the flashloan _collateralToken Address of the underlying collateral token that was loaned _collateralTokenAmountNet Amount of collateral token that was received as flashloan _premium Premium / Intere...
function _performIssuance( address _collateralToken, uint256 _collateralTokenAmountNet, uint256 _premium, DecodedParams memory _decodedParams ) internal { _depositCollateralToken(_collateralToken, _collateralTokenAmountNet); _issueSet(_decodedParams.set...
9,182,719
/** * @title ERC20Pausable * @author Team 3301 <team3301@sygnum.com> * @dev Overloading ERC20 functions to ensure that the contract has not been paused. */ pragma solidity 0.5.12; import "./ERC20Overload/ERC20.sol"; import "../Pausable.sol"; contract ERC20Pausable is ERC20, Pausable { /** * @dev Overloa...
Overload approve function to ensure contract has not been paused. spender address that can spend the funds. value amount of funds./
function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); }
911,464
pragma solidity ^0.4.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); ...
deprecate current contract if favour of a new one
function totalSupply() public constant returns (uint) { if (deprecated) { return StandardToken(upgradedAddress).totalSupply(); return _totalSupply; } }
8,003,424
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../util/LibString.sol"; import "../v2/NFTV2.sol"; import "../v1/LinkKey.sol"; import "../v1/SNSResolver.sol"; cont...
registerSNS name_ SNS name to_ SNS owner/
function _registerName(string memory name_, address to_) internal virtual returns (bool){ require(_defaultResolverAddress != address(0), "006---please set defaultResolverAddress"); require(!_nameRegistered[name_], "003---name has been registered"); require(!_registered[to_],"008---the addres...
12,910,856
// SPDX-License-Identifier: MIT // solhint-disable max-states-count // solhint-disable var-name-mixedcase pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfac...
Sets the permission for the given controller _controller The address of the controller _allowed The status of if it is allowed/
function setAllowedController( address _controller, bool _allowed ) external notHalted onlyGovernance { require(address(IController(_controller).manager()) == address(this), "!manager"); allowedControllers[_controller] = _allowed; emit AllowedC...
93,227
pragma solidity ^0.4.23; /* ** WARNING: THIS PRODUCT IS HIGHLY ADDICTIVE. IF YOU HAVE AN ADDICTIVE NATURE. DO NOT PLAY. */ /* * Author: Konstantin G... * Telegram: @bunnygame * * email: info@bunnycoin.co * site : http://bunnycoin.co * @title Ownable * @dev The Ownable contract has an owner address...
WIN send money
function win() internal { if (address(this).balance > 0 && address(this).balance >= bankMoney && lastOwner != address(0)) { advertising = ""; added_to_the_bank = 0; reallyPrice = minPrice; currentTimeBank = maxTimeBank; lastOwner.transfer(bankMon...
15,823,899
./full_match/1/0xe63C777dCaab7Db2F6667fCA5f323D47fEE565B2/sources/MyContract.sol
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); }
8,463,156
pragma solidity ^0.4.24; // **************************************************************************** // Safe math // **************************************************************************** library SafeMath { function mul(uint _a, uint _b) internal pure returns (uint c) { if (_a == 0) { retu...
called by the owner to alloc the released tokens
function allocateTokens(address to, uint tokens) public onlyOwner returns (bool success){ require(address(0) != to && 0 <= tokens && tokens <= _released.sub(_allocated)); balances[to] = balances[to].add(tokens); _allocated = _allocated.add(tokens); emit AllocateTokens(to, tokens); ...
116,052
//SPDX-License-Identifier: Unlicense pragma solidity 0.8.1; import "@openzeppelin/contracts/utils/Counters.sol"; import "hardhat/console.sol"; import "./PoolTicket.sol"; // We do not need to use safemath since solidity 0.8 have overflow checks by default //import "@openzeppelin/contracts/utils/math/SafeMath.sol"; c...
This is to prevent any accidental draws running for years
function setNextParticipantsForRound(uint64 nextParticipantsCount) public onlyOwner { require(nextParticipantsCount <= MaxSettableParticipants, "The max participant count cannot be exceeded"); require(nextParticipantsCount >= nextWinningPercentages.length, "The participants must be more than or equal to the w...
973,948
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256);...
Normally will expect 0 when going from ETH (because only amount required was deposited as WETH)
function buyOnZeroXv4( IERC20 fromToken, IERC20 toToken, uint256 fromAmountMax, uint256 toAmount, address exchange, bytes calldata payload ) internal { ZeroxV4Data memory data = abi.decode(payload, (ZeroxV4Data)); require(toAmount <= d...
10,883,170
/* Copyright 2021 Set Labs Inc. 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...
Invoke withdraw on LendingPool from SetToken Withdraws an `_amountNotional` of underlying asset from the reserve, burning the equivalent aTokens owned - E.g. SetToken has 100 aUSDC, and receives 100 USDC, burning the 100 aUSDC _setToken Address of the SetToken _lendingPool Address of the LendingPool cont...
function invokeWithdraw( ISetToken _setToken, ILendingPool _lendingPool, address _asset, uint256 _amountNotional ) external returns (uint256) { ( , , bytes memory withdrawCalldata) = getWithdrawCalldata( _lendingPool, _a...
462,750
pragma solidity 0.5.12; contract Leilao { // Struct é uma estrutura, que permite colocar campos para serem preenchidos pelo interessado, e utilizado várias vezes por pessoas diferentes. // Nesse caso, a struct é utilizada para criar uma identificação do ofertante no leilão. É um tipo de dado. struct Ofer...
Realizo estorno das ofertas aos perdedores/
function lance(string memory nomeOfertante, address payable enderecoCarteiraOfertante) public payable { require(now <= prazoFinalLeilao, "Leilao encerrado."); require(msg.value > maiorLance, "Ja foram apresentados lances maiores."); maiorOfertante = msg.sender; maiorLance = ...
12,537,175
pragma solidity ^0.4.24; contract Owned { address public aOwner; address public coOwner1; address public coOwner2; constructor() public { aOwner = msg.sender; coOwner1 = msg.sender; coOwner2 = msg.sender; } /* Modifiers */ modifier onlyOwner { require(msg.s...
Lottery generator numbers by given hash./
function randomizerLottery(bytes32 hash, address sender) private returns(bool, uint256[] memory) { uint256[] memory lotteryNumbers = new uint256[](7); bytes32 userHash = keccak256(abi.encodePacked( hash, sender, random(999) )); bool win = true; ...
1,715,657
pragma solidity ^0.5.8; contract CoinToFlip { uint constant MAX_CASE = 2; uint constant MINIMUM_BET = 0.01 ether; uint constant MAXIMUM_BET = 10 ether; uint constant HOUSE_FEE_PERCENT = 5; uint constant HOUSE_MINIMUM_FEE = 0.005 ether; address payable public owner; // betting but not yet d...
currently executing game should not exist before self-destructing
function kill() external onlyOwner { require(lockedInBets == 0, "All bets should be processed before self-destruct"); selfdestruct(owner); }
885,681
/** *Submitted for verification at Etherscan.io on 2021-06-17 */ // File: contracts/interfaces/ILiquidationManager.sol pragma solidity 0.6.12; /** * @title BiFi's liquidation manager interface * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */ interface ILiquidationManager { function setCircuit...
BiFi's liquidation manager interface BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo)/
interface ILiquidationManager { function setCircuitBreaker(bool _emergency) external returns (bool); function partialLiquidation(address payable delinquentBorrower, uint256 targetHandler, uint256 liquidateAmount, uint256 receiveHandler) external returns (uint256); function checkLiquidation(address payable userAddr)...
2,009,855
./full_match/421613/0xA4A34B69AA7Bdec4B2656485A299813fF854Cd05/sources/project_/src/active/layerzero/lzApp/NonblockingLzAppUpgradeable.sol
overriding the virtual function in LzReceiver try-catch all errors/exceptions
function _blockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual override { (bool success, bytes memory reason) = address(this).excessivelySafeCall( gasleft(), 150, abi.encodeWithSelector(this.nonblockingLzReceiv...
11,569,864
./full_match/1/0xE517aa81408236CF3Fd1170b708741614BeCB631/sources/Users/qijunlin/MyWorkSpace/SolidityWorkSpace/gamer_truffle/contracts/token/GAMER.sol
Transfer tokens from one address to another. from The address you want to send tokens from. to The address you want to transfer to. value The amount of tokens to be transferred./ decrease allowance get value in gamers sub from from
function transferFrom(address from, address to, uint256 value) external validRecipient(to) returns (bool) { _allowedFragments[from][msg.sender] = _allowedFragments[from][msg.sender].sub(value); uint256 gamerValue = value.mul(internalDecimals).div(gamersScalingFactor); ...
4,854,096
/** Copyright 2020 Swapshub 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 */ pragma solidity >=0.4.21 <0.7.0; import "openzeppelin-solidity/...
checks if the token is in pause state tokenId: token to check/
function isPaused( uint256 tokenId ) public view returns( bool ) { require( tokenExists( tokenId ), "eThaler: tokenId does not exist"); return( _tokenDetails[tokenId].isPaused ); }
1,060,079
./partial_match/1313161554/0xF92dC46c2F373480cbC7Dacb0A003C4a2c23ea78/sources/AliumSideSwapRouterWithWannaswap.sol
amountInMax (+fee%)
function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) returns (uint[] memory amounts) { uint256 toDev = fee * amountOut / DECIMAL; if (toDev > 0 ...
16,946,212
/** *Submitted for verification at Etherscan.io on 2021-03-03 */ // 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 `...
override base method transferFrom/
function transferFrom(address _from, address _to, uint256 value) public whenNotPaused returns (bool _success) { return super.transferFrom(_from, _to, value); }
2,305,026
./partial_match/1/0xe462012d97c3c77ee7CfE79EBB6c5ebA5FF53CEf/sources/Nft_erc721.sol
Logged when the user of a token assigns a new user or updates expires
interface IERC4907 { event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires); function setUser(uint256 tokenId, address user, uint64 expires) external ; function userOf(uint256 tokenId) external view returns(address); function userExpires(uint256 tokenId) external view returns...
16,094,250
./full_match/1/0xfc0C21e900B26A27d0eCeB9d567F86679AF11fdc/sources/contracts/BrawlerBearzSupplyCrates.sol
Sets crate configuration config The config object representing the crate drop/ Check valid supply crate item
function setSupplyCrateConfig( SupplyCrateConfig calldata config ) public onlyRole(MODERATOR_ROLE) { require(config.crateId > 0, "Invalid crate token id"); require(config.quantity > 0, "Drop quantity should be greater than 0"); require(config.itemIds.length > 0, "Must have at lea...
9,670,668
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(a...
Executes action on the request to deposit tokens relayed from the other network _recipient address of tokens receiver _value amount of bridged tokens/
function executeActionOnBridgedTokens(address _token, address _recipient, uint256 _value) internal { bytes32 _messageId = messageId(); uint256 valueToMint = _value; uint256 fee = _distributeFee(FOREIGN_TO_HOME_FEE, _token, valueToMint); if (fee > 0) { emit FeeDistributed(...
1,401,990
pragma solidity ^0.4.18; contract owned { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } funct...
Set team tokens. Security review - Integer math: ok - only called once with fixed parameters Applicable tests: - Test founder token allocation too early - Test founder token allocation on time - Test founder token allocation twice/check if team tokens have already been allocated
function allocateTeamTokens() onlyOwner public returns (bool success){ require(!teamAllocated); balanceOf[msg.sender] = balanceOf[msg.sender].add(teamAllocation); totalSupply = totalSupply.add(teamAllocation); teamAllocated = true; AllocateTeamTokens(msg.sender, teamAllocatio...
11,788,584
./full_match/3/0xBE2801110F44E884034D683AA4CFFc618Ab9f0a4/sources/rcc.sol
Call this function after finalizing the presale
function enableAllFees() external onlyOwner() { _taxFee = 5; _previousTaxFee = _taxFee; _burnFee = 1; _previousBurnFee = _taxFee; _charityFee = 1; _previousCharityFee = _charityFee; _liquidityFee = 8; _previousLiquidityFee = _liquidityFee; ...
8,086,400
/** Source code of Opium Protocol Web https://opium.network Telegram https://t.me/opium_network Twitter https://twitter.com/opium_network */ // File: LICENSE /** The software and documentation available in this repository (the "Software") is protected by copyright law and accessible pursuant to the licens...
Gets the approved address for a token ID, or zero if no address set _tokenId uint256 ID of the token to query the approval of return address currently approved for the given token ID/
function getApproved(uint256 _tokenId) public view returns (address) { if (exists(_tokenId)) { return address(this); } return address(0); }
1,368,058
./full_match/43113/0xf2270A1657c0398500EdE98F98df96Ace980dB48/sources/MasterChef.sol
View function to see pending VAND on frontend.
function pendingVand(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accVandPerShare = pool.accVandPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
13,169,982
pragma solidity ^0.6.6; ...
inject NONSTANDARD NAMING
function SUB71(uint256 a, uint256 b) internal pure returns (uint256) {
12,732,283
./full_match/1/0x69Ea4A1b574C96F77b5B68f7B470888bf79D001b/sources/BullMarket.sol
Enables taxes for specified address.
function IncludeInTax(address wallet, bool) public onlyOwner { isExcludedFromTax[wallet] = false; }
3,082,325
./partial_match/1/0xd92d6Cd9eBD6149dAf5f1933DD4C569b7d1fb9c1/sources/Messi2.sol
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
3,694,333
./full_match/4/0x42be2CBDF784e0789c4A3DA8323713b2d41358a5/sources/contracts/elecciones.sol
añade un candidato al mapping, para que podamos votarlo.
function anadir_candidato(string memory _nombre) public{ require(isOwner[msg.sender] && periodo_eleccion, "Necesita ser owner para anadir un candidato"); Candidatos memory candidato_nuevo = Candidatos({ nombre : _nombre, votos : 0, esValor : true ...
698,964
/* Copyright (C) 2021 Soteria.fund 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 distributed...
set flag to deposit/ undeposit cover note against a cover Id coverId coverId of Cover flag true/false for deposit/undeposit/
function setDepositCN(uint coverId, bool flag) public onlyInternal { if (flag == true) { require(!depositedCN[coverId].isDeposited, "Cover note already deposited"); } depositedCN[coverId].isDeposited = flag; }
6,447,803