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/0x3Bd85DF9633eF0205206BB519E4dDee152Bb0005/sources/contracts/token/RewardsDistributor.sol
Calculates the quarter number for a specific time since START_TIME _now Timestamp to calculate its quarter/ Avoid underflow for active strategies during mining activation
function _getQuarter(uint256 _now) internal view returns (uint256) { uint256 quarter = _now >= START_TIME ? (_now.sub(START_TIME).preciseDivCeil(EPOCH_DURATION)).div(1e18) : 0; return quarter.add(1); }
3,050,160
./full_match/1/0x6af84d0f6297588562891316D622e2888554b19D/sources/contracts/ConstrainedNFTMarketplace.sol
CHECK Make sure the payment went through
function buyToken() external payable nonReentrant { if(!forSale) { revert TokenIsNotForSale(); } if (msg.value > price) { revert TooMuchPaid(); } if (msg.value < price) { revert YouDidntPayEnough(); } if (!success) { ...
3,012,944
./full_match/80001/0x48706bb662E30b41a97823D4e7CbFB99715da09e/sources/project:/contracts/MarketplaceAssets.sol
just for trace and debug (not use ) ;
function setTokenURI(uint256 tokenId,string memory newURI) public onlyOwner{ nftContract.setTokenURI(tokenId,newURI); MarketGameAssets[tokenId].uri = newURI; }
5,558,900
./partial_match/1/0x699f14c48E3139E44b68B05368b5C68dd2e1e3f4/sources/IFLifMale.sol
whitelist mintNormal WL VerificationsEND WL VerificationsMint
function mintWhitelist( bytes32[] calldata proof, uint256 _mintAmount ) public payable { require( _verify(_leaf(msg.sender), proof), "Invalid proof" ); require( (whitelistedMi...
4,242,689
/** *Submitted for verification at Etherscan.io on 2021-10-19 */ // SPDX-License-Identifier: MIT pragma solidity 0.4.24; //-----------------------------------------------------------------------------// // Name : MPadLaunchPad // // Swap tok...
Set sale parameters for users to buy new tokens _startTime Start time of the sale _endTime End time of the sale _minimumAmount Minimum accepted amount _maximumAmount Maximum accepted amount/
function setSaleParameter( uint256 _startTime, uint256 _endTime, uint256 _minimumAmount, uint256 _maximumAmount, bool _whitelistFlag ) external onlyOwner returns(bool){ require(_startTime > 0 && _endTime > 0 && _minimumAmount > 0 && _maximumAmount >...
10,974,012
pragma solidity ^0.4.8; /* Function signatures: b8029269: get_money() 00414f8c: just_throw() f0fff0c9: mul_by_100(uint256) 8b61622f: try_reentrance(uint256) */ // External contract. No reentrant calls contract External { event InMulBy100(uint256 a, address sender); event InTryReentrance(uint256 a, address s...
try re-entrant call
function try_reentrance(uint256 a) payable returns (int256 ret) { bool call_success; assembly{ } InTryReentrance(a, msg.sender, call_success); if (call_success) { return -1; return 1; } }
2,576,398
./full_match/137/0xe2fd8eb78dD4802E58812Af5b3eF62A420bA596d/sources/contracts/Martians.sol
Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], but performing a delegate call. _Available since v3.4._/
function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "ER12"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(succ...
4,665,411
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; 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 all...
Made all parameters in alphabetical order
function _setAllFees(uint256 marketingFee, uint256 liquidityFees, uint256 teamFee, uint256 reflectionFees) private { _fee_marketing = marketingFee; _fee_liquidity = liquidityFees; _fee_team = teamFee; _fee_reflection = reflectionFees; }
14,559,813
./partial_match/137/0x928d6216022355e1ACF7A79298013E5b4109aa15/sources/TPv3101.sol
validate the latest status of the tpHash = true or false?! can be queried by everyone, read only!
function validate(bytes32 _hash) external view returns (bool) { return trueproofs[_hash]; }
3,510,306
/** *Submitted for verification at Etherscan.io on 2021-11-02 */ // SPDX-License-Identifier: GPL-3.0 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 ...
Pre transfer checks.
function transferFrom(address from, address to, uint256 id) public override { address operator = _msgSender(); require(!paused(), "Error: token transfer while paused"); _transfer(from, to, operator, id); }
15,458,826
/* ----------------------------------------------------------------- FILE INFORMATION ----------------------------------------------------------------- file: Owned.sol version: 1.2 author: Anton Jurisevic Dominic Romanowski date: 2018-6-22 ----------------------------------------------...
Accept the nomination to be owner. Only the currently-nominated owner may accept ownership./ This event must be emitted before the owner is overwritten.
function acceptOwnership() external onlyNominatedOwner { emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner
14,083,118
./full_match/4/0x7CEfc2492Cf3BEb03e5B8eF9ba52c4a219301425/sources/contracts/SwdStaking.sol
Deposit LP tokens to MasterChef for SUSHI allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accSwdPerShare).div(1e12).s...
816,582
pragma solidity ^0.4.23; contract CampaignFactory{ address[] public deployedCampaigns; //address of all campaign ever deployed function createCampaign(uint minimumAmount) public{ //deploys new instance of Campaign by passing the minimumAmount as it is being reqd during Campaign constructor function and s...
deploys new instance of Campaign by passing the minimumAmount as it is being reqd during Campaign constructor function and stores in address
function createCampaign(uint minimumAmount) public{
5,395,204
pragma solidity ^0.4.24; /** * @title SmartWeddingContract * @dev The contract has both addresses of the husband and the wife. It is capable of handling assets, funds and * divorce. A multisig variant is used to consider the decision of both parties. */ contract SmartWeddingContract { event WrittenContr...
Return a list of all asset ids./ Get all asset ids
function getAssetIds() external view returns (uint[]) { uint assetCount = assets.length; uint[] memory assetIds = new uint[](assetCount); return assetIds; }
2,485,446
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.6; // modules import "@erc725/smart-contracts/contracts/utils/OwnableUnset.sol"; import "@erc725/smart-contracts/contracts/ERC725Y.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; // interfaces import "./ILSP6KeyManager.sol"; // librar...
@inheritdoc IERC1271/
function isValidSignature(bytes32 _hash, bytes memory _signature) public view override returns (bytes4 magicValue) { address recoveredAddress = ECDSA.recover(_hash, _signature); return ( ERC725Y(account) .getPermissionsFor(recoveredAdd...
2,560,990
pragma solidity ^0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `o...
get address of management team./
function getBeneficiaryManage() public view returns (address) { return beneficiary_manage; }
1,173,850
./partial_match/1/0x6e55e0e3ae67C6f2056dE2DB8e2B0032f55e2542/sources/Booster.sol
Computes the amount of liquidity received for a given amount of token1 and price range Calculates amount1 / (sqrt(upper) - sqrt(lower)). sqrtRatioAX96 A sqrt price representing the first tick boundary sqrtRatioBX96 A sqrt price representing the second tick boundary amount1 The amount1 being sent in return liquidity...
function getLiquidityForAmount1( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint256 amount1 ) internal pure returns (uint128 liquidity) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); unchecked { return ...
2,592,913
// File: contracts\Common\ERC165.sol pragma solidity ^0.5.0; /** * @title ERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface ERC165 { /** * @notice Query if a contract implements an interface * @param _interfaceId The interface identifier, as specified in...
Returns an URI for a given token ID Throws if the token ID does not exist. May return an empty string. _tokenId uint256 ID of the token to query/
function tokenURI(uint256 _tokenId) public view returns (string memory) { require(exists(_tokenId)); return tokenURIs[_tokenId]; }
1,000,187
// contracts/CryptoPoopsTraits.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; // OpenZeppelin import "./token/ERC721/ERC721.sol"; import "./math/SafeMath.sol"; import "./access/Ownable.sol"; contract CryptoPoopTraits is ERC721, Ownable { using SafeMath for uint; using SafeMath for uint8; using Saf...
Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals Clear metadata (if any)
function _burn(uint256 tokenId) internal virtual { _beforeTokenTransfer(owner, address(0), tokenId); _approve(address(0), tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } _holderTokens[owner].remove(tokenId); _toke...
582,944
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random ...
@inheritdoc IGameLogicProvider
function totalGames() external view returns (uint256) { return _gameIdsToGameInfo.length; }
6,039,608
./full_match/3/0x5CF8F9189222a44334c69ffD491f0D101253cEB8/sources/tow.sol
startRoundEvent('before setStatus'); blue.setBlueStatus(false); _minFee = minFee 10000; _maxFee = maxFee 10000; _roundDuration = roundDuration 60; _feePerMinute = _maxFee / _roundDuration;
function startRound(uint256 minFee,uint256 maxFee, uint256 minBet, uint256 maxBet, uint256 start_time, uint256 end_time, uint256 jackpot,uint256 date, uint round, uint roundDuration) public payable returns (bool){ setRedStatus(false); startRoundEvent(minFee,maxFee,minBet,maxBet,start_time,end_time,jackpot...
8,224,031
./full_match/1/0xE9FB7b777703279C61d8855b2858242c682C1165/sources/bepsol4.sol
get balance of liquidity pair calculate amount to burn pull tokens from pancakePair liquidity and move to dead address permanently
function autoBurnLiquidityPairTokens() internal returns (bool){ lastLpBurnTime = block.timestamp; uint256 liquidityPairBalance = this.balanceOf(uniswapV2Pair); uint256 amountToBurn = liquidityPairBalance.mul(percentForLPBurn).div(10000); if (amountToBurn > 0){ supe...
9,770,651
./partial_match/1/0xAe209eEbCBc4eeA9540ffCe87feD25670566D1Eb/sources/EasyBid.sol
require areBidsActive to be trueif isInTesting, require bidder to be a tester
function createBid( address token, uint256 ethUsed, uint112 profitLoss ) public delegatedOnly { require(areBidsActive, "Bids are inactive"); if (isInTesting) { require(bidder[msg.sender].isTester, "You are not a tester"); } require(!bidder[msg....
3,961,700
pragma solidity ^0.4.23; /* * ╔═╗┌─┐┌─┐┬┌─┐┬┌─┐┬ ┌─────────────────────────┐ ╦ ╦┌─┐┌┐ ╔═╗┬┌┬┐┌─┐ * ║ ║├┤ ├┤ ││ │├─┤│ │ KOL Community Alliance │ ║║║├┤ ├┴┐╚═╗│ │ ├┤ * ╚═╝└ └ ┴└─┘┴┴ ┴┴─┘ └─┬─────────────────────┬─┘ ╚╩╝└─┘└─┘╚═╝┴ ┴ └─┘ * ┌────────────────────────────────┘ ...
once voting passed,excute auto;
function excuteAuto(uint256 _missionId) private { if ((missionList[_missionId].name == "CHANGE NODE") && missionList[_missionId].superPassed){ require(isNode[missionList[_missionId].oldNode]); require(!isSuperNode[missionList[_missionId].newNode]); isNode[missionList[_missionId].oldNod...
6,451,834
./full_match/1/0x4cBFC8772ee8d12cdd6007C9E4254AEB71214bab/sources/contracts/UCube.sol
Returns the total supply/
function totalSupply() external view virtual returns (uint256) { return totalMintedCubes; }
9,612,451
./partial_match/4/0x3dDd3652922e333b0B2896B47676E2BdB968bCed/sources/quest_marketplace.sol
function to check how many property tokens of a particular property user holds
function getPropertyTokenBalance(address user,uint256 property_id) public returns(uint256){ IERC20 erc_property; erc_property = IERC20(_property.Prop_token_deploy_address(property_id)); return erc_property.balanceOf(user); }
8,599,338
./full_match/23294/0x53FE9042cbB6B9773c01F678F7c0439B09EdCeB3/sources/_oasisprotocol/sapphire-contracts/contracts/Sapphire.sol
Verifies that the provided digest was signed with using the secret key corresponding to the provided private key and the specified signing algorithm. alg The signing algorithm by which the signature was generated. publicKey The public key against which to check the signature. digest The hash of the message that was ...
function verifyDigestSignature( SigningAlg alg, bytes memory publicKey, bytes memory digest, bytes memory signature ) internal view returns (bool verified) { (bool success, bytes memory v) = VERIFY_DIGEST.staticcall( abi.encode(alg, publicKey, digest, signatur...
3,843,360
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they sho...
Set provenance once it's calculated/
function setProvenanceHash(string memory provenanceHash) public onlyOwner { MOWERS_PROVENANCE = provenanceHash; }
11,749,835
pragma solidity ^0.7.0; import "./IERC165.sol"; import "./ERC165.sol"; import "./Address.sol"; import "./EnumerableMap.sol"; import "./EnumerableSet.sol"; import "./SafeMath.sol"; import "./Strings.sol"; import "./Context.sol"; import "./Ownable.sol"; import "./ISFT.sol"; import "./IFaces.sol"; import "./IERC721Enumer...
Withdraw from the SFT contract (Callable by owner) Note: Only spent SFTs (i.e. from name changes) are withdrawable here/
function withdrawSFT() onlyOwner public { uint balance = ISFT(_sftAddress).balanceOf(_sftAddress); ISFT(_sftAddress).transferFrom(_sftAddress, msg.sender, balance); }
10,371,374
./full_match/5/0xCb910ecDEe9986FD888f7e608cAD3be8c186a2DB/sources/browser/PropetyControl.sol
изменение ID места (только владелец территории)
function setPlaceNumber(string memory _PlaceNumber) public{ require(TerritoryOwner == msg.sender); PlaceNumber = _PlaceNumber; }
1,954,985
./full_match/80001/0x69d86435E12645Cfa66e415b78305B43C8632Da3/sources/contracts/Nft.sol
Transfer USDC tokens from user to contract Store the request information
function requestToken(address _userAddress, uint256 _amount) public { require(_amount > 0, "Amount must be greater than 0"); USDCInterface usdcToken = USDCInterface(usdcTokenAddress); require(usdcToken.transferFrom(_userAddress, address(this), pricePerNFT * _amount), "USDC transfer failed"); ...
9,450,136
/** *Submitted for verification at Etherscan.io on 2021-05-24 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { function initialize() external; function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer...
Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public { uint length = poolInfo.length; for (uint pid = 0; pid < length; ++pid) { updatePool(pid); } }
7,735,985
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; // Part: IBasicRewards interface IBasicRewards { function stakeFor(address, uint256) external returns (bool); function balanceOf(address) external view returns (uint256); function earned(address) external view returns (uint256); function wit...
Deposits rewards to their respective merkle distributors weights - weights of output assets (cvxCRV, FXS, CVX...) edge case for CRV as we gotta keep using existing distributor
function distribute(uint16[] calldata weights) public onlyOwner validWeights(weights) { for (uint256 i; i < weights.length; ++i) { if (weights[i] > 0) { address _outputToken = outputTokens[i]; address _distributor = tokenInfo[_outputTok...
13,541,935
./full_match/80001/0x346c782258932b2f1cBfB9101239e75bfc1B190C/sources/contracts/Crowdfund.sol
Donate to campaign campaign.token.transferFrom(msg.sender, address(this), _donatedAmount); (bool sent,) = payable(campaign.owner).call(_donatedAmount)("");
function donate(uint _id, uint _donatedAmount) public { Campaign storage campaign = allCampaigns[_id]; require(campaign.startAt < block.timestamp, "Campaign is yet to begin"); require(campaign.endAt > block.timestamp, "Campaign Has Ended"); campaign.donatedAmount += _donatedAmount; ...
5,549,845
// // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "../interfaces/IRewardDistributor.sol"; import "../interfaces/ITokenLock.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; impo...
View function to see pending HPL on frontend.
function pendingRewards(uint256 _pid, address _user) external view returns (uint256 _hpl, uint256 _hpw) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accHPLPerWeight = pool.accHPLPerWeight; uint256 accHPWP...
937,811
./partial_match/1/0xD16176b39530538C42E8E2Dd0c81ec26C2929668/sources/GSNMultiSigWalletWithDailyLimit.sol
Public functions/ Returns number of instantiations by creator. creator Contract creator. return Returns number of instantiations by creator.
function getDeployedWalletsCount(address creator) public view returns(uint) { return deployedWallets[creator].length; }
3,609,074
// Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/issues/20 pragma solidity ^0.4.18; contract ABC { uint256 constant MAX_UINT256 = 2**256 - 1; /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have t...
Verifies if the account is frozen
function approve(address _spender, uint256 _value) public returns (bool success) { require(frozenAccount[_spender] != true); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
249,225
pragma solidity ^0.5.2; import "../Roles.sol"; import "contracts/access/AdminRole.sol"; /** * @dev MinterRole has been modified from its original openzeppelin source to * allow for more detailed permissions */ contract MinterRole is AdminRole { using Roles for Roles.Role; event MinterAdded(address indexed...
Function has been modified from original library to only allow accounts with admin role to add a minter/
function addMinter(address account) public onlyAdmin { _addMinter(account); }
12,975,438
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import './openzeppelin-solidity/contracts/SafeMath.sol'; import './openzeppelin-solidity/contracts/Ownable.sol'; import './openzeppelin-solidity/contracts/ERC20/SafeERC20.sol'; //Libraries import "./libraries/TxDataUtils.sol"; //Interfaces import "./interfaces...
Sets the attribute's updateFee to the new fee _attributeName Name of the attribute to add _newFee The new updateFee return (bool) Whether the fee was updated successfully/
function updateAttributeFee(bytes32 _attributeName, uint _newFee) external override onlyOwner returns (bool) { if (attributes[_attributeName].name != _attributeName) { return false; } if (_newFee < 0) { return false; } attributes[_attributeName].upda...
1,769,587
./full_match/84531/0x5767C841d927cdec5B7d50869a3B3D400f6ad518/sources/src/lib/FrenBondHelper.sol
Calculate amount depending a given fee. Fee amount by dividing the numerator by the denominator which - e.g: 4/100 = 0.04 or 4%. _amount base amount for calculate. _feeNumerator numerator for calculate. return amount of fee.
function getAmontByFee(uint256 _amount, uint256 _feeNumerator, uint256 _feeDenominator) public pure returns (uint256) { return _amount * (_feeNumerator) / (_feeDenominator); }
14,319,720
// File: Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ f...
Create the NFT by emitting the event and setting the token ID to the sender's address./
function reveal() public payable { require(msg.value >= REVEAL_PRICE, "Please send 0.0004 ETH"); address tokenOwner = msg.sender; uint256 tokenId = uint256(uint160(tokenOwner)); require(_balances[tokenId][tokenOwner] == 0, "NFT already revealed"); _balances[tokenId][tokenO...
10,442,343
/* Copyright 2018 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, ...
Contract constructor sets initial owners, required number of confirmations, and time lock. _owners List of initial owners. _required Number of required confirmations. _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds.
function MultiSigWalletWithTimeLock(address[] _owners, uint _required, uint _secondsTimeLocked) public MultiSigWallet(_owners, _required) { secondsTimeLocked = _secondsTimeLocked; }
1,089,780
./partial_match/1/0x48F63Dcec1306bB2210B0D79bee7064050C18137/sources/RonazoStaking.sol
Maxpayout of 3.65 of deposit
function maxPayoutOf(uint256 _amount) public pure returns(uint256) { return _amount * 365 / 100; }
4,261,898
pragma solidity ^0.4.21; /** * @title Safe maths library for big numbers. */ library SafeMath { /** * @notice Sums two numbers. * @param a Number to add to. * @param b Number to add. * @return Returns the sum of two numbers. */ function add(uint a, uint b) internal pure returns (u...
Constructor which allows us to fund contract on creation./
function Payable() public payable { }
14,105,532
./full_match/1/0x686595a70b77f761F891BD50BD398be913b12a6C/sources/contracts/Collections/ERC2981PerTokenRoyalties.sol
@inheritdoc IERC2981
function royaltyInfo(uint256 tokenId, uint256 value) external view override returns (address receiver, uint256 royaltyAmount) { RoyaltyInfo memory royalties = _royalties[tokenId]; receiver = royalties.recipient; royaltyAmount = (value * royalties.amount) /...
16,572,628
//Address: 0x94394EbE010332c5A40d946658779d26dA3aC92B //Contract name: LooksCoinCrowdSale //Balance: 0 Ether //Verification Date: 1/15/2018 //Transacion Count: 5 // CODE STARTS HERE pragma solidity ^0.4.19; /* * LooksCoin token sale contract * * Refer to https://lookrev.com/tokensale/ for more information. * * Dev...
Transferring the contract ownership to the new owner. _newOwner new contractor owner/
function transferOwnership(address _newOwner) onlyOwner { if (_newOwner != 0x0) { newOwner = _newOwner; } }
6,429,618
pragma solidity 0.4.21; /** * @title SafeMath by OpenZeppelin (commit: 5daaf60) * @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) { ...
Constructor function/
function Crowdsale( address fundRaiserAccount, uint256 durationOfIcoInDays, uint256 durationTokensClaimableAfterInDays, uint256 tokensForOneWei, address addressOfToken ) public { owner = msg.sender; fundRaiser = fundRaiserAccount; ico...
5,433,468
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity =0.8.10; pragma abicoder v1; /** * ,, ,, * *MM db `7MM * MM MM * MM,dMMb. ...
Returns the uint256 value at storage location ptr ptr The storage location pointer return val The uint256 value at storage location ptr
function loadUint(bytes32 ptr) internal view returns (uint256 val) { }
9,953,259
pragma solidity ^0.5.1; contract Elections { struct Voter { uint rightToVote; bool voted; //If true, Voter already voted in election } struct Election { uint id; string name; uint voteCount; uint256 openingTime; uint256 closingTime; mapping(uint => Proposal) proposals; uint proposalsCount; } ...
vote for a proposal _election index of election to vote _proposal index of proposal to vote/
function vote(uint _election, uint _proposal) public { Voter storage sender = voters[msg.sender]; require(!sender.voted, "You already voted."); sender.voted = true; elections[_election].proposals[_proposal].voteCount += 1; }
15,817,329
pragma solidity ^0.4.11; // File: contracts/CAVPlatformEmitter.sol //import '../event/MultiEventsHistoryAdapter.sol'; /// @title CAV Platform Emitter. /// /// Contains all the original event emitting function definitions and events. /// In case of new events needed later, additional emitters can be developed. /// Al...
Sets EventsHstory contract address. Can be set only by events history admon or owner. _eventsHistory MultiEventsHistory contract address. return success.
function setupEventsHistory(address _eventsHistory) onlyContractOwner public returns (uint errorCode) { eventsHistory = _eventsHistory; return OK; }
13,695,818
// File: @openzeppelin/contracts/utils/EnumerableSet.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and c...
Creates `amount` new tokens for `to`. See {ERC20-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./
function mint(address to, uint256 amount) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "BUX: must have minter role to mint"); _mint(to, amount); }
1,141,985
./full_match/4/0x1Bd534A7e29557f71D5F3e6F67e7c20B4b7e52A5/sources/browser/staking.sol
require(block.number > staking_time[msg.sender][_poolId] + PoolInfoList[_poolId].stakingLength, "t025");
function widthdrawNftWithoutReward(uint256 _poolId) public { require(staking_num[msg.sender][_poolId] > 0, "t026"); for (uint256 i = 0; i < staking_token_id[msg.sender][_poolId].length; i++) { stakingNftAddress.transferFrom(address(this), msg.sender, staking_token_id[msg.sender][_poolId]...
763,913
pragma solidity ^0.8.0; // Copyright 2020 Keyko GmbH. // This product includes software developed at BigchainDB GmbH and Ocean Protocol // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 import '../Common.sol'; import '../libraries/EpochLibrary.sol'; import './Conditio...
getConditionState return condition state/
function getConditionState(bytes32 _id) external view virtual returns (ConditionStoreLibrary.ConditionState) { return conditionList.conditions[_id].state; }
12,853,053
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; // computes square roots using the babylonian method // https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method library Babylonian { function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; ...
Adds collateral addresses supported, such as tether and busd, must be ERC20
function addFXSPair(address pair_address) public onlyByOwnerOrGovernance { require(fxs_pairs[pair_address] == false, "address already exists"); fxs_pairs[pair_address] = true; fxs_pairs_array.push(pair_address); }
1,505,917
./full_match/5/0xA5EA05358F4D65548cb04aeCC2C4a2381F573E9B/sources/contracts/MinerIssuance.sol
latest per miner price by dp of swap contract, divide by latest price per eth. the result will be the price of 1 miner in wei.
function _calculateETHPerMiner() internal view returns (uint256) { require(priceFeed != address(0), "Issuance/no-oracle-set"); uint256 usdPerMiner = IUSDMinerPair(pair).getPrice(); (, int256 usdPerETH, , , ) = AggregatorV3Interface(priceFeed) .latestRoundData(); return...
7,034,067
./partial_match/1/0xa6Ec49E06C25F63292bac1Abc1896451A0f4cFB7/sources/ERC20Plus.sol
Removes an address to the team. _address the ETH address to remove, cannot be 0x and must be in team/
function removeFromTeam(address _address) public onlyOwner { if(_address == address(0)) revert CannotBeNullAddress(); if(!inTeam(_address)) revert InvalidTeamChange(); team[_address] = false; }
15,666,025
./full_match/1/0x517a197ad807703D99d919afcd720B5F4a2AA9fC/sources/contracts/BlissFeeHandler.sol
Set the minimum amount of Bliss that the enlighten-caller must hold.
function setMinRebalanceAmount(uint256 amount_) external onlyOwner { minRebalanceAmount = amount_; }
16,393,994
pragma solidity 0.6.12; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./interfaces/IERC20Burnable.sol"; import {YearnVaultAdapterWithIndirectio...
Deposits alTokens into the transmuter amount the amount of alTokens to stake requires approval of AlToken firstrequire tokens transferred in;
function stake(uint256 amount) public noContractAllowed() ensureUserActionDelay() runPhasedDistribution() updateAccount(msg.sender) checkIfNewUser() { require(!pause, "emergency pause enabled"); address sender = msg.sender; IERC20Burnable(...
2,510,718
/** *Submitted for verification at Etherscan.io on 2022-03-16 */ /* ANIMAL META DAO Website - https://www.animalmetadao.com Telegram - https://t.me/animalmetadao Twitter - https://twitter.com/animalmetad Supply: 100 000 000 (100 million) Buy / Sell Fees: 2.5% Marketing - 2.5% Development - 10% Charity */ // File:...
Trading enabled checkMax Tx checkMax Wallet check
function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_balances[sender] >=...
7,813,243
/** * Copyright CENTRE SECZ 2018 * Copyright (c) 2020 Xfers Pte. 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 without limitation the rights * to use, ...
Function to allow the blacklister to burn entire balance of tokens from a blacklisted address Validates that contract is not paused caller is the blacklister address to burn tokens from is a blacklisted address _from address the address to burn tokens from/
function lawEnforcementWipingBurn(address _from) public whenNotPaused onlyBlacklister { require( isBlacklisted(_from), "Can't wipe balances of a non blacklisted address" ); uint256 balance = balances[_from]; totalSupply_ = totalSupp...
12,901,265
./partial_match/1/0x146178334c31D1D32F6F63e629B7288d808CAFaC/sources/nothingness.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("nothingness", "noth") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = I...
4,179,005
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; // ============ Internal Imports ============ import {BridgeRouter} from "./BridgeRouter.sol"; import {IWeth} from "../../interfaces/bridge/IWeth.sol"; // ============ External Imports ============ import {TypeCasts} from "@celo-org/optics-sol/con...
Sends ETH over the Optics Bridge. Sends to the same address on the other side. WARNING: This function should only be used when sending TO an EVM-like domain. As with all bridges, improper use may result in loss of funds. _domain The domain to send funds to/
function send(uint32 _domain) external payable { sendTo(_domain, TypeCasts.addressToBytes32(msg.sender)); }
1,209,075
./full_match/1/0xb6caC678CeFD488B3D02ca69C40dBAFB48E593b0/sources/home/dave/proof/proof-seller/contracts/redemption/src/restricted/ERC721ATransferRestricted.sol
Sets the transfer restrictions. Only callable by a contract steerer./
function setTransferRestriction(TransferRestriction restriction) external onlyRole(DEFAULT_STEERING_ROLE) { if (_locked) { revert TransferRestrictionLocked(); } _setTransferRestriction(restriction); }
8,409,726
pragma solidity ^0.4.24; import "../validation/TimedCrowdsale.sol"; import "../../token/ERC20/IERC20.sol"; import "../../math/SafeMath.sol"; /** * @title PostDeliveryCrowdsale * @dev Crowdsale that locks tokens from withdrawal until it ends. */ contract PostDeliveryCrowdsale is TimedCrowdsale { using SafeMath f...
return the balance of an account./
function balanceOf(address _account) public view returns(uint256) { return balances_[_account]; }
5,469,286
./partial_match/1/0xA83D81113F57d63AF7EFDC4a12350365c7871266/sources/ShareTokenSale.sol
Release token for each stage of specific round round Round to release token Requirements: 1. Round should be Seed or Private 2. Processing round percent should be less than or equals 100% Implementations: 1. Get all shareholders to process 2. For each shareholder, calculate released token and pay 3. Create r...
function release(uint round) external onlyOwner returns(bool){ require(round == 0 || round == 1, "Round should be Seed or Private round"); uint releaseCountByRound = _dbContract.getReleasedCountByRound(round); require(releaseCountByRound < _dbContract.getTotalCanReleaseCountByRound(round),...
3,643,383
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./base/ERC721Permit.sol"; import "./base/PeripheryPayments.sol"; import "./interfa...
bytes4(keccak256('balanceOf(address)')) == 0x70a08231 bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3 bytes4(keccak256('getApproved(uint256)')) == 0x081812fc bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465 bytes4(kecc...
function governance() external view returns (address); function mintProxy() external view returns (address); function mintPilot(address recipient, uint256 amount) external; function deposit(IExchangeManager.DepositParams memory params, bytes memory data) external payable retur...
9,875,170
./full_match/5/0xFDCAc6789D68C960986Dbce76b0D1C84d0630C1b/sources/contracts/ProjectPosting.sol
Ensure only the project creator can edit the project
function editProject(uint _projectId, string memory _name, string memory _datasetFeatures, string memory _datasetNature, uint _deadline, uint _offer) public { require(_projectId < projectsCount, "Project with this ID does not exist"); Project storage project = projects[_projectId]; require...
1,876,500
pragma solidity >=0.4.25 <0.6.0; contract ERC20Interface { function totalSupply() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spender) public view returns (uint remaining); function transfer(ad...
Returns the balance of the account 'addr'. return balance of the accounts 'addr'./
function balanceOf(address addr) public view returns(uint balance) { return balances[addr]; }
12,779,146
/** * * ███████╗████████╗██╗░░██╗███████╗██████╗░███████╗██╗░░░██╗███╗░░░███╗ ██████╗░██████╗░░█████╗░ * ██╔════╝╚══██╔══╝██║░░██║██╔════╝██╔══██╗██╔════╝██║░░░██║████╗░████║ ██╔══██╗██╔══██╗██╔══██╗ * █████╗░░░░░██║░░░███████║█████╗░░██████╔╝█████╗░░██║░░░██║██╔████╔██║ ██████╔╝██████╔╝██║░░██║ * ██╔══╝░░░░░█...
Need to make gas fee customizable to future-proof against Ethereum network upgrades.
function updateGasForProcessing(uint256 newValue) public onlyOwner { require(newValue != gasForProcessing, "EPRO: Cannot update gasForProcessing to same value"); emit GasForProcessingUpdated(newValue, gasForProcessing); gasForProcessing = newValue; }
92,727
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view virtual re...
Note: do a direct access to avoid the validity check.
function getCollateral(address sponsor) external view nonReentrantView() returns (FixedPoint.Unsigned memory collateralAmount) { return _getFeeAdjustedCollateral(positions[sponsor].rawCollateral); }
7,360,538
//Address: 0x15dd447b5ecf63432909a4655037b43898fabf19 //Contract name: EmojiToken //Balance: 0.006539184163646544 Ether //Verification Date: 2/17/2018 //Transacion Count: 2682 // CODE STARTS HERE pragma solidity ^0.4.18; /* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <ar...
Creates a new Emoji with the given name.Creates token contract
function createBaseEmoji(string _name, string _symb) public onlyCLevel { uint256 indx = _createEmoji(_name, address(this), startingPrice); emojiCraftTokenAddress[indx] = new CraftToken(_name, _symb); }
12,846,477
./full_match/5/0xf024f358f8B2bD56F4A2f7e168B7F720EFf943F0/sources/contracts/mdda.sol
This is what they should have paid if they bought at lowest price tier.What they paid - what they should have paid = refund.Remove this tokenBatchSend them their extra monies.
function refundExtraETH() public { require(DA_FINAL_PRICE > 0, "Dutch action must be over!"); uint256 totalRefund; for ( uint256 i = userToTokenBatchPriceData[msg.sender].length; i > 0; i-- ) { uint256 expectedPrice = userToTokenBatch...
1,950,483
./full_match/5/0x573A25982a864f5E83f67fF7DfB0425e54dF796c/sources/contracts/Baccarat.sol
Deal initial 2 cards to the player and banker
function deal() public returns (uint8) { for (uint8 i = 0; i < 2; i++) { playerCards[i] = getRandomNumber(2 * i + 1); bankerCards[i] = getRandomNumber(2 * i + 2); } bankerTotal = calculateTotal(bankerCards, 2); uint8 playerThirdCard = 0; if (playerT...
11,605,291
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "./interfaces/IOniiChainDescriptor.sol"; import "./interfaces/IOniiChain.sol"; import "./libraries/NFTDescriptor.sol"; import "./libraries/DetailHelper.sol"; import "base64-sol/base64.sol"; /// @title Describes Onii /// @notice Produc...
Right and left eyes
function eyesNoFill(string memory scleraColor) private pure returns (string memory) { return string(abi.encodePacked(eyeLeftNoFill(scleraColor), eyeRightNoFill(scleraColor))); }
5,890,293
/** * SourceUnit: c:\Users\Jad\Documents\code\Cryptoware\dcb-lottery\blockend\contracts\DCBW721.sol */ ////// SPDX-License-Identifier-FLATTEN-SUPPRESS-WARNING: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction a...
Called with the sale price to determine how much royalty is owed and to whom. tokenId - the NFT asset queried for royalty information salePrice - the sale price of the NFT asset specified by `tokenId` return receiver - address of who should be sent the royalty payment return royaltyAmount - the royalty payment amount...
function royaltyInfo(uint tokenId, uint salePrice) external view returns (address, uint) { return (royalties[tokenId].account, royalties[tokenId].shares.mul(salePrice).div(1000));
12,806,459
pragma solidity ^0.4.22; contract AddressProxy { /** * @dev The owner owns the address proxy and has the highest access */ address public owner; /** * @dev The client is the address that has day to day access */ address public client; /** * @dev If the proxy is locked, the cl...
make contract payable
function() payable public {}
6,894,797
./full_match/3/0x662610BdA96eC5E1609D42A7cd55097A02E41626/sources/browser/Woolf.sol
验证合约调用人是否是本人 抱歉,您没有shiba
function freeMint(bool stake) external whenNotPaused { require(tx.origin == _msgSender(), "Only EOA"); uint256 bamcCount = bamc.balanceOf(msg.sender); uint256 clubCount = club.balanceOf(msg.sender); require(bamcCount > 0 || clubCount > 0, "Sorry, you don't have shiba"); uint256 mintCount = 0; ...
8,125,155
./partial_match/1/0x357ADa6E0da1BB40668BDDd3E3aF64F472Cbd9ff/sources/StakingPool.sol
Deposit tokens to NerdVault for NERD allocation. Transfer pending tokens to userTransfer in the amounts from user save gas
function deposit(uint256 _originAmount) public { UserInfo storage user = userInfo[msg.sender]; massUpdatePools(); updateAndPayOutPending(msg.sender); pendingDeposit = computeDepositAmount( msg.sender, address(this), _originAmount ); ...
4,460,290
./full_match/3/0x4E1F6b747061df73199e4aF0793Bffe6f5a32f7B/sources/contracts/TomToken.sol
See {IERC20-transferFrom}./
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { uint256 currentAllowance = _allowances[sender][_msgSender()]; require( currentAllowance >= amount, "TomToken: transfer amount exceed...
8,147,060
/** *Submitted for verification at Etherscan.io on 2022-03-14 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.0; // File @openzeppelin/contracts/utils/[email protected] /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these a...
Function to mint NFTs for giveaway and partnerships/
function mintByOwner( address _to ) public onlyOwner { require(totalSupply()+1 <= MAX_NFT_PUBLIC, "Tokens number to mint cannot exceed number of MAX tokens"); _safeMint(_to, 1); }
6,795,308
./full_match/1/0x8EB97D795eEbA960646b8E72B318D42Ff39fB818/sources/contracts/minter/RandomMinter.sol
implements fisher-yates shuffle algorithm This means the index itself is still an available token This means the index itself is not an available token, but the val at that index is. Replace the value at indexToUse, now that it's been used. Replace it with the data from the last index in the array, since we are going t...
function _fisherYatesShuffle(uint indexToUse) internal returns (uint) { uint valAtIndex = _availableTokens[indexToUse]; uint result; if (valAtIndex == 0) { result = indexToUse; result = valAtIndex; } uint lastIndex = _availableCount - 1; if (i...
9,608,403
// SPDX-License-Identifier: MIT // File: contracts/NormieLib.sol pragma solidity ^0.8.9; // @author TheNormiesNFT (https://twitter.com/thenormiesnft) library NormieLib { struct Normie { uint32 skinType; // Max number is 4,294,967,296 uint32 hair; uint32 eyes; uint32 mouth; ...
Owner mint function to be used to mint and giveaway assets. tokenID An array of token IDs to mint to owner of contract. amount An array of amounts for each associated token ID to mint./
function ownerMintAssets(uint256[] memory tokenID, uint256[] memory amount) external onlyOwner { require(tokenID.length == amount.length); for (uint256 i = 0; i < tokenID.length; i++){ _mint(msg.sender, tokenID[i], amount[i], ""); } }
13,876,436
./partial_match/1/0x25fF2FdE7df1A433E09749C952f7e09aD3C27951/sources/contracts/NounsDescriptorV2.sol
Get the number of available Noun `glasses`./
function glassesCount() external view override returns (uint256) { return art.glassesCount(); }
4,259,321
./full_match/1/0x2a8b06562A455A79f7027cEd093f1E9dC0fC53B2/sources/contracts/Staking.sol
Update LP stake time used for LBA migration This function can only to called from contracts or wallets with DAO_ROLE _time LBA LP stake time, it should be the same as lpTokenReleaseTime in LBA contract/
function setLBAStakeTime(uint256 _time) external onlyRole(DAO_ROLE) { lbaStakeTime = _time; }
2,906,686
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./utils/EnumerableSet.sol"; import "./interfaces/...
SPDX-License-Identifier: UNLICENSED
interface IOracleAdapter { function addAssetAllocation( Data calldata data, string calldata symbol, uint256 decimals ) external; function removeAssetAllocation(Data calldata data) external; function generateDataHash(Data calldata data) external pure retu...
195,626
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./libraries/PoolDepositable.sol"; import "./libraries/Tierable.sol"; import "./libraries/Suspendable.sol"; import "./libraries/PoolVestingDepositable.sol"; /** @title Loc...
Batch deposits into a vesting pool/
function vestingBatchDeposits( address from, address[] memory to, uint256[] memory amounts, uint256 poolIndex ) external whenNotPaused onlyRole(DEFAULT_ADMIN_ROLE) { PoolVestingDepositable._batchDeposits(from, to, amounts, poolIndex); }
11,945,786
./partial_match/42/0x1c4daF780a2b00b40781DB41E020816728b56e61/sources/OrbitTrajectory.sol
Record the mint from Orbit by incrementing the epoch counter for the number of epochs minted and store the time of the event. supplyMinted the amount supply inflated by. / add number of weeks minted to epochCounter Update mint event to latest epoch issued (start date + number of epoch issued seconds in epoch duration...
function recordMint(uint supplyMinted) external onlyOrbit returns (bool) { uint numberOfEpochs = epochsFromLastIssuance(); epochCounter = epochCounter.add(numberOfEpochs); lastMintEvent = inflationStartDate.add(epochCounter.mul(epochDuration)); emit SupplyMinted(supplyMinted, numb...
3,417,449
pragma solidity ^0.5.14; import "truffle/Assert.sol"; import "../contracts/AssertBytes.sol"; import "../contracts/BytesLib.sol"; contract TestBytesLib1 { using BytesLib for bytes; bytes storageCheckBytes = hex"aabbccddeeff"; bytes storageCheckBytesZeroLength = hex""; bytes storageBytes4 = hex"f00df...
Now we should make sure that all the other previously initialized arrays stayed the same
function testMemoryIntegrityCheck32Bytes() public { bytes memory preBytes4 = hex"f00dfeed"; bytes memory postBytes4 = hex"f00dfeed"; bytes memory postBytes31 = hex"f00d000000000000000000000000000000000000000000000000000000feed"; bytes memory postBytes32 = hex"f00d00000000000000000000...
5,410,105
./partial_match/1/0x0E44C40162B29F5252DB58a7F46B8cAbE2c0867F/sources/TokenERC20.sol
设置允许一个地址(合约)以我(创建交易者)的名义可最多花费的代币数。 _spender 被授权的地址(合约) _value 最大可花费代币数 _extraData 发送给合约的附加数据/ 通知合约
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } }
2,717,708
./partial_match/1/0x3e81ddd9262902aD0F90d7b9737649883E20aa61/sources/MasterChef.sol
Withdraw LP tokens from MasterChef.
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accBxdPerShare...
4,076,764
// SPDX-License-Identifier: MIT /* ________ __ _____ \______ \ _____ _______| | __ / _ \ ____ ____ | | \\__ \\_ __ \ |/ / / /_\ \ / ___\_/ __ \ | ` \/ __ \| | \/ < / | \/ /_/ > ___/ /_______ (____ /__| |__|_ \ \____|__ /\___ / \___ > \/ \...
Deposit LP tokens to MasterChef for SWAMPWOLF allocation./ Check the balance before deposit and after deposit to prevent tax transfer fee attack . Check if it is not an SWAMPWOLF/X pool
function deposit(uint256 _pid, uint256 _amount, address _referrer) public nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (_amount > 0 && address(swampWolfReferral) != address(0) && _referrer != address(0...
12,891,314
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./DG4610Simple.sol"; import "../interfaces/ITokenAuxiliary.sol"; contract RuneGolem is DG4610Simple { ITokenAuxiliary private immutable _tokenProvider; uint256 public runesRequirement = 10; uint256 public maxCountId = 500; mapping(address ...
Set the minimal rune to make a golem runesRequirement_ the minimal rune amount/
function setRunesRequirement(uint256 runesRequirement_) external onlyOwner { runesRequirement = runesRequirement_; }
954,897
pragma solidity ^0.4.0; import "./Bits.sol"; import "./ByteUtils.sol"; import "./ECRecovery.sol"; import "./Eip712StructHash.sol"; import "./Math.sol"; import "./Merkle.sol"; import "./PlasmaCore.sol"; import "./PriorityQueue.sol"; import "./PriorityQueueFactory.sol"; import "./RLP.sol"; import "./ERC20.sol"; /** ...
Blocks a standard exit by showing the exiting output was spent. _standardExitId Identifier of the standard exit to challenge. _challengeTx RLP encoded transaction that spends the exiting output. _inputIndex Which input of the challenging tx corresponds to the exiting output. _challengeTxSig Signature from the exiti...
function challengeStandardExit(uint192 _standardExitId, bytes _challengeTx, uint8 _inputIndex, bytes _challengeTxSig) public { uint256 challengedUtxoPos = _challengeTx.getInputUtxoPosition(_inputIndex); require(challengedUtxoPos == exits[_standardExitId].position); address owner...
6,432,279
./partial_match/56/0x4ea07d8ee76345C4114a09cE413E4f5F364CF031/sources/SyrupProduction.sol
update the Syrup block reward, minimum viable block reward is 210.24 YDP a year (1e+14 units per block). Ignoring any multipliers
function updateSyrupPerBlock(uint256 _syrupPerBlock) public onlyOwner { require(_syrupPerBlock > 142694063000000, "rewards too Small"); syrupPerBlock = _syrupPerBlock; }
11,109,228
./full_match/42/0x2911900DBD4a6af6EEA62a2adDfc22E19BF2AEaF/sources/vSURF.sol
Wrap SURF into vSURF with a destination _weiAmount Amount of SURF tokens (in wei) to wrap into vSURF _to Destination address/
function wrapFor(uint256 _weiAmount, address _to) external { _wrapFor(_weiAmount, _to); }
9,585,602
./full_match/1/0x62BF548B95e48ff169C1bAcC59B9BC99B014e273/sources/contracts/BridgeUpgradeable.sol
Create Transfer Mapping TransferMapping memory transfer = TransferMapping({ userAddress: _userAddress, noOfTokens: _noOfTokens }); transferMapping[_tokenTicker][currentTransferIndex[_tokenTicker][_userAddress][chainId]++] = transfer; transferMapping[_tokenTicker][_userAddress][_fromChain][chainId][currentTransf...
function createCrossChainTransferMapping( address _userAddress, uint256 _noOfTokens, string calldata _tokenTicker, uint256 _transferIndex, uint8 _fromChain ) external isSelf { bytes32 indexKey = keccak256(abi.encode(_tokenTicker, _userAddress, _fromChain, chainId)...
2,932,475
./full_match/80001/0x053B3045552AEc792579A3dF4A17dC40E6617eDd/sources/contracts/EPMXPriceFeed.sol
Retrieves the answer for a given round ID. roundId The round ID for which to get the answer. return The answer previously set with setAnswer()./
function getAnswer(uint256 roundId) external view override returns (int256) { if (roundId > MAX_UINT80_HEX) { return 0; } return _answers[uint80(roundId)].answer; }
844,987
// File: contracts/ErrorReporter.sol pragma solidity 0.4.24; contract ErrorReporter { /** * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary * contract-specific code that enables us to report opaque error codes from upgradeable contracts. ...
Allows admin to remove an existing asset from price tracking/
function removeAsset(address assetAddress) public onlyAdmin { require( assetAddress != address(0), "Asset or Price Feed address cannot be 0x00" ); priceContractMapping[assetAddress] = AggregatorV3Interface(address(0)); emit assetRemoved(assetAddress); }
80,795
./full_match/8453/0xa05fAAF51546fB595ad937808DA76fb715F95Bf4/sources/contracts/universal/OptimismMintableERC20.sol
@custom:legacy Legacy getter for REMOTE_TOKEN.
function remoteToken() public view returns (address) { return REMOTE_TOKEN; }
11,542,949
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; pragma abicoder v2; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./Ainsoph.sol"; /** * @title Illust Marketplace v...
Any user may mint a version of an open edition. / create Ainsoph ref Increment the index for the next minting. Mint into the artist's wallet. Move to the minter's wallet. Calculate the royalty payment value for the receiver.
function mintOpenEdition(uint256 tokenId) public payable whenNotPaused { OpenEdition storage openEdition = openEditions[tokenId]; Ainsoph3 AinsophContract = Ainsoph3(tokenContract); require(openEdition.isOpen == true, "minting is closed"); require( AinsophContract.isAp...
11,846,191