file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// pragma solidity ^0.4.24; pragma solidity ^0.4.19; //for Ethereum Classic import "./dependencies/SafeMath.sol"; import "./dependencies/Ownable.sol"; import "./dependencies/RLP.sol"; import "./dependencies/BytesLib.sol"; import "./dependencies/ERC721Basic.sol"; import "./dependencies/ERC721BasicToken.sol"; import "./...
https:ethereum.stackexchange.com/questions/6498/how-to-convert-a-uint256-type-integer-into-a-bytes32
function bytes32ToUint256(bytes32 n) internal returns (uint256) { return uint256(n); }
7,283,682
./full_match/1/0x49a3caab781f711aD74C9d2F34c3cbD835d6A608/sources/contracts/distribution/TokenDistributor.sol
@inheritdoc ITokenDistributor
function getRemainingMemberSupply( Party party, uint256 distributionId ) external view returns (uint128) { return _distributionStates[party][distributionId].remainingMemberSupply; }
2,946,116
pragma solidity ^0.4.23; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/IdentityProtocol.sol"; import "./helpers/ThrowProxy.sol"; contract TestIdentityProtocol { IdentityProtocol protocol = IdentityProtocol(DeployedAddresses.IdentityProtocol()); ThrowProxy throw...
Testing the createPersonalIdentity() function
function testUserCannotGetInvalidIdentity() public { address(throwableProtocol).call(abi.encodeWithSignature("getIdentity(bytes)","InvalidIdentity")); throwProxy.shouldThrow(); }
5,508,215
./partial_match/4/0xfDcF6aA1715253aC31675Ce16cDF10E01729Cf93/sources/Liquidity_v3.sol
uint256 num = amount.mul(userInterestRate); uint256 denom = 10000; uint256 reward = num.div(denom);
function _withdrawAfterClose( address from, uint256 amount, uint256 _userIndex ) private returns (bool) { deposits[from].paid = true; uint256 i; uint256 initialRate = rates[_userIndex].newInterestRate; uint256 initialTime = deposits[from].depositTime; ...
8,756,439
./full_match/80001/0x85C1929cC1794dd7c25d16d095a09318Cc57d174/sources/contracts/WorkerAuthManagerImpl.sol
XXX: we can't do this because the worker need to accept the job before receiving an authorization
function hireAndAuthorize( address payable _workerAddress, address _dappAddress ) public override payable { workerManager.hire(_workerAddress); authorize(_workerAddress, _dappAddress); }
872,982
pragma solidity ^0.5.0; interface ICustodian { function users(uint) external returns(address); function totalUsers() external returns (uint); function totalSupplyA() external returns (uint); function totalSupplyB() external returns (uint); function balanceOf(uint, address) external returns (uint); functi...
terminateVoting voting if timeout
function terminateByTimeout() public returns (bool) { require(votingStage != VotingStage.NotStarted); uint nowTimestamp = getNowTimestamp(); if (nowTimestamp > voteStartTimestamp && nowTimestamp - voteStartTimestamp > VOTE_TIME_OUT) { votingStage = VotingStage.NotStarted; emit TerminateByTimeOut(candidate)...
12,803,776
./full_match/5/0x25427ba3411054899A181b473e6a1584f9D23341/sources/project_/contracts/superfluid/Superfluid.sol
check if whitelisting required
function registerApp( uint256 configWord ) external override { if (APP_WHITE_LISTING_ENABLED) { revert HOST_NO_APP_REGISTRATION_PERMISSIONS(); } _registerApp(configWord, ISuperApp(msg.sender), true); }
1,898,336
pragma solidity ^0.4.20; contract Poker { address public owner; uint256 public minimumBet; uint256 public totalBet; uint256 public numberOfBets; uint256 public maxAmountOfBets = 100; address[] public players; struct Player { uint256 amountBet; uint256 numberSelected; } // The addr...
Generates a number between 1 and 10 that will be the winner
function generateNumberWinner() public { distributePrizes(numberGenerated); }
5,472,472
pragma solidity ^0.5.12; pragma experimental ABIEncoderV2; /*- * Copyright (c) 2019 @secondphonejune * All rights reserved. * * This code is derived by @secondphonejune (Telegram ID) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following c...
This function allows people to generate a voterID to register and vote.Supposingly this ID should be random so that people do not know who it belongs to,and each person has only one unique ID so they cannot double vote.It means a public key pair binding with identity / hash of identity.As most people do not have a wall...
function getVoterID(string memory name, string memory HKID) public view returns(uint256){ electionList db = electionList(dbAddress); if(!checkHKID(HKID)) return 0; return uint256(sha256(joinStrToBytes(db.hashHead(),name,HKID))); }
7,293,098
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/finance/PaymentSplitter.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contrac...
Current collection getter External usage to view current config return Collection
function currentCollection() external view returns (Collection memory) { return collections_[currentCollectionId()]; }
10,228,914
...
inject NONSTANDARD NAMING
function ADD537(uint256 a, uint256 b) internal pure returns (uint256) {
6,417,035
pragma solidity ^0.5.0; import "@openzeppelin/contracts-ethereum-package/contracts/GSN/Context.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol"; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "../access/roles/AdministratorRole.sol"; import "../utils/Addresses...
Sets the VASP postal address./
function setPostalAddress( string calldata streetName, string calldata buildingNumber, string calldata postCode, string calldata town, string calldata country ) external onlyAdministrator { require(!streetName.isEmpty(), "VASP: street name is n...
13,101,934
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma experimental ABIEncoderV2; interface IERC20 { function totalSupply() external view returns (uint256 supply); function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint256 _value) extern...
Enable/Disable a token as collateral for the specified Aave market
function getAllReservesTokens() external virtual view returns (TokenData[] memory); function getAllATokens() external virtual view returns (TokenData[] memory); function getReserveConfigurationData(address asset) external virtual view returns ( uint256 decimals, uint256 ltv, uint25...
11,949,248
// SPDX-License-Identifier: MIT // File: contracts/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library ...
See {ITradable-setProxyRegistry}. Requirements: - Caller must be the contract owner./
function setProxyRegistry( address proxyRegistryAddress_ ) external onlyOwner { _setProxyRegistry( proxyRegistryAddress_ ); }
14,920,311
/** *Submitted for verification at Etherscan.io on 2022-03-26 */ // SPDX-License-Identifier: GNU // AE T H E R // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity 0.8.7; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the com...
unpause and remove all restrictions public sale ready 0.07 eth there is not max per address or max per transaction in the public sale after unpausing we will set no limits to transactions
function setPhase2() external onlyOwner { mintPrice = 70000000000000000; _unpause(); }
10,908,622
./full_match/1/0xD2cAa748B66768aC9c53A5443225Bdf1365dd4B6/sources/contracts/WiseOracleHub/OracleHelper.sol
Determines info for the heartbeat update mechanism for chainlink oracles, roundIds./
function _getLatestAggregatorRoundId( address _tokenAddress ) internal view returns (uint80) { ( uint80 roundId, , , , ) = priceFeed[_tokenAddress].latestRoundData(); return roundId; }
17,171,953
pragma solidity ^0.4.24; import "./ScryToken.sol"; contract ScryProtocol { enum TransactionState {Begin, Created, Voted, Buying, ReadyForDownload, Closed} struct DataInfoPublished { uint256 price; bytes metaDataIdEncSeller; bytes32[] proofDataIds; uint256 numberOfProof; ...
loop if invalid verifier was chosen until get valid verifier
function chooseVerifiers(uint8 num) internal view returns (address[] memory) { require(num < validVerifierCount, "No enough valid verifiers"); address[] memory chosenVerifiers = new address[](num); for (uint8 i = 0; i < num; i++) { uint index = getRandomNumber(verifiers.length) ...
12,557,988
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; // Interface import { ILazyMintERC20 } from "./ILazyMintERC20.sol"; // Base import { Coin } from "../../Coin.sol"; // Access Control + security import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; // Utils import "@openzeppelin/co...
Lets an account claim a given quantity of tokens, of a single tokenId. Get the claim conditions. Verify claim validity. If not valid, revert. If there's a price, collect price. Mint the relevant tokens to claimer.
function claim(address _receiver, uint256 _quantity, bytes32[] calldata _proofs) external payable nonReentrant { uint256 activeConditionIndex = getIndexOfActiveCondition(); ClaimCondition memory condition = claimConditions.claimConditionAtIndex[activeConditionIndex]; verifyClaim(_receiver,...
15,868,461
./partial_match/5/0x212272215413D9387929839E76cE7071c8A4AE91/sources/DNSSECImpl.sol
An interface for contracts implementing a DNSSEC digest./
interface Digest { function verify(bytes calldata data, bytes calldata hash) external pure returns (bool); } }
16,852,975
/** *Submitted for verification at Etherscan.io on 2021-10-19 */ // SPDX-License-Identifier: MIT pragma solidity 0.4.24; //-----------------------------------------------------------------------------// // Name : MPadLaunchPad // // Swap tok...
Total number of tokens in existence./
function totalSupply() external view returns (uint256) { return _totalSupply; }
10,973,997
./full_match/1/0x7af62458e41E2F490D2Df54A8FeDc56fFedB8c17/sources/lib/solady/src/utils/LibSort.sol
Returns whether the array is sorted in ascending order.
function isSorted(uint256[] memory a) internal pure returns (bool result) { assembly { result := 1 if iszero(lt(mload(a), 2)) { let end := add(a, shl(5, mload(a))) let p := mload(a) a := add(a, 0x20) result :...
3,202,933
// SPDX-License-Identifier: MIT //** Meliora Crowfunding Contract*/ //** Author Alex Hong : Meliora Finance 2021.5 */ pragma solidity 0.6.6; pragma experimental ABIEncoderV2; import "./libraries/Ownable.sol"; contract MelioraInfo is Ownable { uint256 private devFeePercentage = 1; uint256 private minDevFeeIn...
get launchpad count/
function getLaunchpadCount() external view returns (uint256) { return launchpadAddresses.length; }
5,521,937
pragma solidity ^0.4.18; // File: contracts/UidCheckerInterface.sol interface UidCheckerInterface { function isUid( string _uid ) public pure returns (bool); } // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an own...
Sets the manager _address Manager's address/
function setManager( address _address ) external onlyOwner { require(_address != address(0)); manager = _address; ManagerSet(_address, false); }
1,782,737
pragma solidity >=0.8.0; import "./interfaces/IStake.sol"; import "./Stake.sol"; import "./Base.sol"; contract StakeManager is Base { event StakeCreated( address indexed from, address stakeToken, address rewardToken, address stake ); event LibUpdated(address indexed newLib...
quit, claim reward + unstake all/
function quit() external enable() lock() updateReward(msg.sender) { unstake(stakers[msg.sender].amount); _claim(msg.sender); }
1,534,146
./partial_match/1/0x1b9301A08Fa97a7d6646AFb58BfE93c3927bad26/sources/BACStaking.sol
return userBlanaces[_owner].values(); Return an empty array
function userStakedNFT(address _owner) public view returns(uint256[] memory){ uint256 tokenCount = userBlanaces[_owner].length(); if (tokenCount == 0) { return new uint256[](0); uint256[] memory result = new uint256[](tokenCount); uint256 index; for (i...
2,717,143
pragma solidity ^0.4.19; contract ERC721 { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) external view returns (address owner); function approve(address _to...
arise warrior Check ritual time is oversend compensation
function finishRitual(address _owner) whenNotPaused external { uint256 timeBlock = ritualTimeBlock[_owner]; require(timeBlock > 0 && timeBlock <= block.number); uint256 souls = soulCounter[_owner]; require(souls >= 10); uint256 identity = _generateI...
5,942,480
./partial_match/42/0x142201C24af5095EDED6D6A8F500B2f05E08f523/sources/Depot.sol
Fallback function (exchanges ETH to xUSD)/
function() external payable { exchangeEtherForSynths(); }
3,468,490
./full_match/43114/0xCCB8aDAFfF911be27E51c6CCB03fae041d391454/sources/contracts/avaxsnob.sol
Anyone can harvest it at any given time. I understand the possibility of being frontrun But AVAX is a dark forest, and I wanna see how this plays out i.e. will be be heavily frontrunned? if so, a new strategy will be deployed. Collects Joe tokens 10% is sent to treasury Donates DUST
function harvest() public override onlyBenevolent { IMasterChefJoeV2(masterChefJoeV3).deposit(poolId, 0); uint256 _joe = IERC20(joe).balanceOf(address(this)); if (_joe > 0) { uint256 _keep = _joe.mul(keep).div(keepMax); uint256 _amount = _joe.sub(_keep).div(2); ...
4,511,960
./partial_match/1/0x47B0f414d5298CFFF5E043767d6715E2a5D92CC6/sources/BoiChillClub.sol
Returns the total number of tokens minted. return The total number of tokens minted./
function totalMinted() external view returns (uint256) { return _idCounter - 1; }
4,455,950
pragma solidity ^0.4.18; // solhint-disable-line contract VerifyToken { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remain...
RE ENABLE THIS BEFORE DEPLOYING MAINNETrequire(hatcheryShrimp[msg.sender]==0);lastHatch[msg.sender]=now;hatcheryShrimp[msg.sender]=hatcheryShrimp[msg.sender].add(STARTING_SHRIMP);
function claimFreeEggs() public{ require(ethVerify.verifiedUsers(msg.sender)); require(initialized); require(!hasClaimedFree[msg.sender]); claimedEggs[msg.sender]=claimedEggs[msg.sender].add(getFreeEggs()); _hatchEggs(0); hatchCooldown[msg.sender]=0; hasClaime...
1,755,102
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./DelicateDinosBaseIntegration.t.sol"; contract DelicateDinosIntegrationTest is DelicateDinosBaseIntegrationTest { function setUp() external { init(); } // ============ WHITELISTED MINT ============= // function testCanMintWhitelisted() ext...
Whitelisted account can receive multiple minted tokens, but all must be minted at once
function testCannotMintTwiceWhitelisted() external { bytes32 requestId = delicateDinos.getTokenIdToMintRequestId(1); _vrfRespondMint(RANDOM_NUMBER, requestId); assertTrue(delicateDinosMinter.hasClaimed(address(this))); HEVM.expectRevert(abi.encodeWithSelector(WhitelistManager.AlreadyClaimed.selector))...
6,413,760
./partial_match/1/0xCb4cCC716ABE1b5be15870E2bfa12BF5F0b501e6/sources/Verifier.sol
return the product of a point on G1 and a scalar, i.e. p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p. Use "invalid" to make gas estimation work
function scalar_mul(G1Point p, uint s) internal returns (G1Point r) { uint[3] memory input; input[0] = p.X; input[1] = p.Y; input[2] = s; bool success; assembly { success := call(sub(gas, 2000), 7, 0, input, 0x80, r, 0x60) } require (success); }
4,401,868
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../libraries/tokens/ERC20/ERC20.sol"; contract MockERC20 is ERC20 { uint256 public totalSupply; constructor( string memory _name, string memory _symbol, uint256 _initialAmount ) public ERC20(_name, _symbol) { // Give the creator all initial t...
Return the DOMAIN_SEPARATOR It's named internal to allow making it public from the contract that uses it by creating a simple view function with the desired public name, such as DOMAIN_SEPARATOR or domainSeparator. solhint-disable-next-line func-name-mixedcase
function _domainSeparator() internal view returns (bytes32) { uint256 chainId; assembly { chainId := chainid() } return chainId == DOMAIN_SEPARATOR_CHAIN_ID ? _DOMAIN_SEPARATOR : _calculateDomainSeparator(chainId); }
13,681,544
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.6.12; // // _β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ // β–‘β–ˆβ–ˆβ–“β–’β–‘β–‘β–’β–“β–ˆβ–ˆ // β–ˆβ–ˆβ–“β–’β–‘__β–‘β–’β–“β–ˆβ–ˆ___β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ // β–ˆβ–ˆβ–“β–’β–‘____β–‘β–“β–ˆβ–ˆβ–ˆβ–“__β–‘β–’β–“β–ˆβ–ˆ // β–ˆβ–ˆβ–“β–’β–‘___β–‘β–“β–ˆβ–ˆβ–“_____β–‘β–’β–“β–ˆβ–ˆ // β–ˆβ–ˆβ–“β–’β–‘_______________β–‘β–’β–“β–ˆ...
Lookup all editions added for the given edition type Returns array of edition numbers, any zero edition ids can be ignore/stripped/
function editionsOfType(uint256 _type) external view returns (uint256[] memory _editionNumbers) { return editionTypeToEditionNumber[_type]; }
6,043,744
//Address: 0x320274f5dd332cc3b617b360e8554d95a0b96978 //Contract name: ZillaCrowdsale //Balance: 0 Ether //Verification Date: 11/30/2017 //Transacion Count: 3034 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath {...
Allow owner to change the multisig wallet _vault the new address of the multisig wallet/
function setVault(address _vault) public onlyOwner { require(_vault != 0x0); vault = _vault; }
6,456,222
pragma solidity 0.4.23; /** * Utility library of inline functions on addresses */ library AddressUtils { /** * @notice Checks if the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created un...
Allows setting the `lockedBitmask` parameter of the contract, which is used to determine if a particular token is locked or not A locked token cannot be transferred, upgraded or burnt The token is locked if it contains any bits from the `lockedBitmask` in its `state` set Requires sender to have `ROLE_STATE...
function setLockedBitmask(uint64 bitmask) public { require(__isSenderInRole(ROLE_STATE_LOCK_PROVIDER)); lockedBitmask = bitmask; }
1,803,650
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "./IslandBase.sol"; contract EthereumIslands is IslandBase { uint256 public genesisMintIndex; uint256 public genesisMintPrice = 1000000 * 10**18; IERC20Burnable public pmlg; constructor( IERC20Burnable pml, IMetadataStor...
tokens can only be burned is the flag burnIsActive is set to true
function burn(uint256 tokenId) external { if (!burnIsActive) revert BurnNotActive(); if (!_isApprovedOrOwner(msg.sender, tokenId)) revert NotTheOwnerOrApproved(tokenId); _burn(tokenId); }
12,009,371
// SPDX-License-Identifier: Unlicensed pragma solidity 0.7.6; // ============ Contract information ============ /** * @title InterestRateSwapFactory * @notice A deployment contract for Greenwood basis swap pools * @author Greenwood Labs */ // ============ Imports ============ import '@openzeppelin/contracts/m...
toggle the value of isPaused
function togglePause() external onlyGovernance() returns (bool){ isPaused = !isPaused; return true; }
1,627,784
./partial_match/1/0xAB42127980a3bff124E6465e097a5fC97228827e/sources/src/contracts/core/DataLayrServiceManager.sol
Used by DataLayr governance to adjust the address of the `feeSetter`, which can adjust the value of `feePerBytePerTime`.
function setFeeSetter(address _feeSetter) external onlyOwner { _setFeeSetter(_feeSetter); }
9,359,615
pragma solidity ^0.4.18; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf(address _owner) public view returns (uint256 balance); function implementsERC721() public pu...
Returns all the relevant information about a specific item. _tokenId The tokenId of the item of interest.
function getItem(uint256 _tokenId) public view returns ( string itemName, uint256 sellingPrice, address owner, bytes32 itemMessage, address creator ) { Item storage item = items[_tokenId]; itemName = item.name; itemMessage = item.message; sellingPrice = itemIndexToPrice[_tokenId]; ow...
10,703,087
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title Ownable * @dev Ownable contract with two-step ownership transfer. The new owner should accept ownership to prevent * transferring to wrong address. */ contract SafeTransferOwnable is Ownable { address public n...
Allows the current owner to propose control of the contract to a newOwner. _newOwner The address to transfer ownership to./
function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; emit OwnershipProposed(owner, newOwner); }
12,806,062
pragma solidity ^0.5.0; import "./libs/ListAsRingLib.sol"; import "./libs/EntityLib.sol"; import "./libs/AddressIndexLib.sol"; import "./libs/StringIndexLib.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; contract HallOfFame is Ownable { using EntityLib for EntityLib.Entities; using Lis...
Get group. _id group id. return uint, string, string/
function getGroup(uint _id) external view returns ( uint id, string memory data, uint version, string memory index ) { (id, data, version) = groups.get(_id); return (id, data, version, groupIndexes.getIndex(_id)); }
12,636,180
./full_match/1/0x1bB602b7a2ef2aECBA8FE3Df4b501C4C567B697d/sources/lib/ERC721A/contracts/ERC721A.sol
Mints `quantity` tokens and transfers them to `to`. Requirements: - `to` cannot be the zero address. - `quantity` must be greater than 0. Emits a {Transfer} event for each mint./ Overflows are incredibly unrealistic. `balance` and `numberMinted` have a maximum limit of 264. `tokenId` has a maximum limit of 2256. Update...
function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); unchecked { _packedAddressData[to] += quantity * ((1 << _BI...
2,948,540
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
FLIGHTS FUNCTIONALITY /
function registerFlight (address _airline, uint256 _time, bytes32 _flight) public requireAuthorizedCaller requireIsOperational { bytes32 flightKey = getUniqueKey(_airline, _flight, _time); flightKeys.push(flightKey); flights[flightKey] = Flight({ flight: _...
12,922,177
./full_match/56/0xa603b15B6a9A76a688B65A3C63590B3098407760/sources/project_/contracts/diamond/libraries/LibPriceFacade.sol
Take the newer price
function getPriceFromCacheOrOracle(PriceFacadeStorage storage pfs, address token) internal view returns (uint64, uint40) { LatestCallbackPrice memory cachePrice = pfs.callbackPrices[token]; (uint256 price, uint8 decimals,uint256 startedAt) = LibChainlinkPrice.getPriceFromChainlink(token); ui...
3,227,833
pragma solidity ^0.4.22; // // complied with 0.4.24+commit.e67f0147.Emscripten.clang // 2018-09-07 // With Optimization enabled // // Contact support@win1million.app // // Play at: https://win1million.app // // Provably fair prize game where you can win $1m! // // /** * @title SafeMath * @dev Math o...
and then enumerate through them and get their respective bids...
function getGamesPlayerBids(uint256 gameId, address playerAddress) public view returns(uint256){ return games[gameId].PlayerBidMap[playerAddress]; }
1,021,278
./partial_match/8453/0x3997B940aE1B6A1a767fFbf0cE91b82d0179Ad72/sources/Swamp.sol
handle the transfer of reward tokens via `transferFrom` to reduce the number of transactions required and ensure correctness of the reward amount
function notifyRewardAmount(address _rewardsToken, uint256 reward) external updateReward(address(0)) { require(rewardData[_rewardsToken].notifier == msg.sender); IERC20(_rewardsToken).safeTransferFrom(msg.sender, address(this), reward); if (block.timestamp >= rewardData[_rewardsToken].perio...
16,814,103
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import './token/PoolsInterestBearingToken.sol'; import './token/Bridge.sol'; import './utils/MyPausableUpgradeable.sol'; import 'hardhat/cons...
Private function that allows calls from other functions despite nonReentrant modifier/ get staker info and check if such a record exists update the reward pool calculations (e.g. rewardPerShare) calculate reward amount Save the current share of the pool as reward debt to prevent a staker from harvesting again (similar ...
function _harvest(address tokenAddress, address stakerAddress) private whenNotPaused { StakerInfo storage staker = stakes[tokenAddress][stakerAddress]; require(staker.balance > 0, 'RewardPools: Staker has a balance of 0'); updateRewards(tokenAddress); uint256 accumulated = (staker.balance * rewardPo...
87,320
/** MIT License Copyright (c) 2019 Mavennet Systems Inc. https://mavennet.com 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,...
Adds two numbers, throws on overflow./
function add(uint256 _a, uint256 _b) internal constant returns (uint256 c) { c = _a + _b; require(c >= _a); return c; }
1,088,834
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../eip712/ITransferWithSig.sol"; import "../defi/ILendManager.sol"; import...
deposit eth/ args
function deposit(address _addrTo) external payable { require(msg.value > 0, "Cashier :: invalid msg.value"); bytes memory r = address(swapManager).callfn( abi.encodeWithSelector( swapManager.swapEthToToken.selector, msg.value, reserveToken...
13,129,492
// Hudson Jameson (Souptacular) Created December 2015 contract owned { function owned() { owner = msg.sender; } modifier onlyowner() { if (msg.sender == owner) _ } address owner; } contract Marriage is owned { // Store marriage data bytes32 public partner1; by...
Set the marriage status if it changes
function setStatus(bytes32 status) { marriageStatus = status; }
12,994,491
/** *Submitted for verification at Etherscan.io on 2021-01-31 */ pragma solidity ^0.6.6; interface AggregatorInterface { function latestAnswer() external view returns (int256); function latestTimestamp() external view returns (uint256); function latestRound() external view returns (uint256); function getAns...
sell BIOP to the bonding curve amount the amount of BIOP to sell/
function sell(uint256 amount) public returns (uint256){ require(balanceOf(msg.sender) >= amount, "insufficent BIOP balance"); uint256 ethToSend = getContinuousBurnRefund(amount); if (sellFee > 0) { uint256 fee = ethToSend.div(buyFee).div(100); if (gov == 0x000000000...
2,186,479
./full_match/1/0x85979c90D53E20E4505C83d9408b8A61Beb8db1F/sources/contracts/Aladdin.sol
Update sender's state.
function _transferToExcluded(address sender,address recipient,uint256 amount) private{ updateWeight(sender); uint256 uBalance; if(_liquidWeight==0){ uBalance=_balances[sender]; uBalance=_balances[sender].add(_balances[address(this)].mul(_userWeight[sender]).d...
9,732,629
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* Copyright 2021 Archer DAO: Chris Piatt ([emailΒ protected]). */ import "./lib/0.8/AccessControlUpgradeable.sol"; import "./lib/0.8/CheckAndSend.sol"; /** * @title TipJar * @dev Allows suppliers to create a tip that gets distributed to miners + the network...
Check that contract call results in specific 32 bytes value, then tip _target target contract _payload contract call bytes _resultMatch result to match/
function check32BytesAndTip( address _target, bytes calldata _payload, bytes32 _resultMatch ) external payable { _check32Bytes(_target, _payload, _resultMatch); tip(); }
14,680,933
pragma solidity ^0.5.12; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "../helpers/ValidatorsOperations.sol"; //Beneficieries (validators) template import "../third-party/BokkyPooBahsDateTimeLibrary.sol"; impo...
_addPendingVolumeByDate(amount);
function setTransfer(uint amount, bytes32 guestAddress) public activeBridgeStatus checkMinMaxTransactionValue(amount) checkPendingDayVolumeTransaction() checkDayVolumeTransaction() checkDayVolumeTransactionForAddress() { transferContract.setTransfer(amount, msg.sender, guestAddress); ...
5,370,369
./full_match/4/0x14a733278d2C792d1b93DEF58C30CC16AED0DcCD/sources/Squries.sol
set upgradestrengthwisdomluckfath
function upgradeTokenFromQuesting(uint256 tokenId, uint stengthUpgrade, uint wisdomUpgrade, uint luckUpgrade, uint faithUpgrade) external { require(allowedContracts[msg.sender]); require(_exists(tokenId), "Token has not been minted yet"); if(tokenIdSquireStrength[tokenId] + stengthUpgrade > levelCap){ ...
729,059
/// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import...
Enables/disables deposits with batcher only. This can only be called by governance. _batcherOnlyDeposit if true vault can accept deposit via batcher only or else anyone can deposit.
function setBatcherOnlyDeposit(bool _batcherOnlyDeposit) public { onlyGovernance(); batcherOnlyDeposit = _batcherOnlyDeposit; emit UpdatedBatcherOnlyDeposit(_batcherOnlyDeposit); }
39,239
// SPDX-License-Identifier: MIT /* B L I T B L 0 x L \ L \ I B L I T B L 0 x T L T L B I <3 B I L T L T 0 B 0 B B L L T B L 0 x L \ 0 \ 0 B L I T B L 0 x Blitblox by sayangel.eth Derivat...
glTF data built from blitmap/flipmap token data. Just like original SVGs data is built in chunks of 4 voxels at a time. The output is a 32 x 32 grid of voxels. Each voxel is a node in the scene that references 1 of 4 meshes depending on its color. There are 4 mesh primitives with the only difference being material ...
function tokenGltfData(bytes memory data, bytes1 style) public pure returns (string memory) { (uint8 voxelStyle, uint8 transparencyIndex) = styleByteToInts(style); string[32] memory lookup = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", ...
2,559,025
pragma solidity ^0.4.11; // SafeMath Taken From FirstBlood contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint a, uint b) internal returns (uint) { assert(b...
_serviceProvider return _feeBasisPoints Check service ee (in BP) for a given provider
function checkServiceFee(address _serviceProvider) constant returns (uint256 _feeBasisPoints) { return feeBasisPoints[_serviceProvider]; }
6,433,446
./full_match/1/0x04108C0B1E615aB7765383F35E4fAb8628760646/sources/project_/contracts/DioneStaking.sol
Update withdrawal status
function updateWithdrawStatus(bool _status) external onlyOwner { require(isFinished, "DioneStaking: NOT_FINISHED"); isWithdrawable = _status; emit UpdateWithdrawStatus(_status); }
2,914,924
./partial_match/1/0xB309C8644dE4de778CB53d837565c0ccabc6aa32/sources/MummifiedCoin.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("MummifiedCoin", "MC") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_...
9,150,756
./full_match/4/0xBa7a638a06dBCF2A87CE4425d67f3EA224bFE5b9/sources/github/NFT-Worlds/NFT-Worlds-Staking-Rental-Contract/src/NFTWEscrow.sol
Claim all rewards from caller into a given address
function claim(address to) external virtual override { _updateRewardsPerWeight(0, false); uint rewardAmount = _updateUserRewards(_msgSender(), 0, false); rewards[_msgSender()].accumulated = 0; TransferHelper.safeTransfer(WRLD_ERC20_ADDR, to, rewardAmount); emit RewardClaimed(...
740,736
/* * Copyright ©️ 2020 Curio AG (Company Number FL-0002.594.728-9) * Incorporated and registered in Liechtenstein. * * Copyright ©️ 2020 Curio Capital AG (Company Number CHE-211.446.654) * Incorporated and registered in Zug, Switzerland. */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzep...
Withdraw funds by owner token Token address amount The amount of token to withdraw/
function withdrawFunds(IERC20 token, uint256 amount) public onlyOwner { token.universalTransfer(owner(), amount); }
1,009,232
./partial_match/1/0xeB40E25AF8F5F22Bb201f53971480beA0094Cd65/sources/src/v0.8/functions/tests/1_0_0/testhelpers/FunctionsClientUpgradeHelper.sol
Callback that is invoked once the DON has resolved the request or hit an error requestId The request ID, returned by sendRequest() response Aggregated response from the user code err Aggregated error from the user code or from the execution pipeline Either response or error parameter will be set, but never both/
function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override { emit ResponseReceived(requestId, response, err); }
4,322,740
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "./../interfaces/IExchangeAdapter.sol"; import "@openzeppelin/contracts/interfaces/IERC20.sol"; // solhint-disable func-name-mixedcase // solhint-disable var-name-mixedcase interface ICurveFrax { function exchange_underlying( int128 i, ...
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...
6,204,503
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; interface PotLike { function chi() external view returns (uint); function pie(address) external view returns (uint); function drip() external returns (uint); function join(uint) external; function exit(uint) external; } interface GemL...
Check caller is admin
function _setComptroller(ComptrollerInterface newComptroller) public returns (uint) { if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_COMPTROLLER_OWNER_CHECK); } ComptrollerInterface oldComptroller = comptroller; require(newComptroller.i...
7,349,276
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/acces...
in emergency mode , only repay loan booking
function emergencyRepay(uint256 _bid) external virtual override nonReentrant { require(emergencyRepayEnabled, 'not in emergency'); BorrowInfo storage borrowCurrent = borrowInfo[_bid]; uint256 repayAmount = borrowCurrent.amount; IERC20(baseToken()).safeTransferFrom(msg.sender, addre...
12,814,692
/** *Submitted for verification at Etherscan.io on 2021-10-19 */ // SPDX-License-Identifier: MIT pragma solidity 0.4.24; //-----------------------------------------------------------------------------// // Name : MPadLaunchPad // // Swap tok...
Owner can set hard cap for IDO/
function setIDOavailable(uint256 _IDOHardCap) external onlyOwner returns(bool){ require(_IDOHardCap <= balanceOf(address(this)) && _IDOHardCap > 0, "Value should not be more than IDO balance and greater than 0" ); hardCap = _IDOHardCap; IDOAvailable = _IDOHardCap; return true; ...
10,974,024
./full_match/4/0x402013f33cbD1fCfdf699ccfccC8a3b5b73BD389/sources/browser/test.sol
this ref ID will be assigned to user who joins without any referral ID.
function changeDefaultRefID(uint newDefaultRefID) onlyOwner public returns(string memory){ defaultRefID = newDefaultRefID; return("Default Ref ID updated successfully"); }
654,794
./full_match/1/0xD243629A94c657cB415cFfbfB4f84fb8b98496ec/sources/contracts/TipJarManager.sol
Public getter for TipJar Proxy admin address/ We need to manually run the static call since the getter cannot be flagged as view bytes4(keccak256("admin()")) == 0xf851a440
function getProxyAdmin() public view returns (address) { (bool success, bytes memory returndata) = tipJar.staticcall(hex"f851a440"); require(success); return abi.decode(returndata, (address)); }
9,784,594
pragma solidity ^0.5.9; import "./Standard/ERC20.sol"; import "./Standard/ERC165.sol"; import "./Util/SafeMath.sol"; contract DelightItem is ERC20, ERC165 { using SafeMath for uint; // The two addresses below are the addresses of the trusted smart contract, and don't need to be allowed. // μ•„λž˜ 두 μ£Όμ†ŒλŠ” μ‹ λ’°ν•˜λŠ” 슀마트 κ³„μ•½μ˜ ...
ERC20: Returns the name of the token.ERC20: ν† ν°μ˜ 이름 λ°˜ν™˜
function name() external view returns (string memory) { return _name; }
1,822,977
/* Projekt Gold, by The Fair Token Project * 100% LP Lock * 0% burn * * ****USING FTPAntiBot**** * * Projekt Gold uses FTPAntiBot to automatically detect scalping and pump-and-dump bots * Visit FairTokenProject.com/#antibot to learn how to use AntiBot with your project * Your contract must hold 5Bil $GOLD(Proj...
Highly recommend use of a function that can edit AntiBot contract address to allow for AntiBot version updates
function assignAntiBot(address _address) external onlyOwner() {
9,929,258
// File: openzeppelin-solidity/contracts/math/SafeMath.sol pragma solidity ^0.5.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...
Set the common reference string. If the trusted setup is re-run, we will need to be able to change the crs _commonReferenceString the new commonReferenceString/
function setCommonReferenceString(bytes32[6] memory _commonReferenceString) public { require(isOwner(), "only the owner can set the common reference string"); commonReferenceString = _commonReferenceString; emit SetCommonReferenceString(_commonReferenceString); }
6,450,243
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.6; pragma abicoder v2; import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol'; import {IVotingPowerStrategy} from '../../interfaces/governance/IVotingPowerStrategy.sol'; import {IKyberGovernance} from '../../interfaces/governance/IKyberGovernance.so...
assume that governance check start and end time call to init data if needed, and return voter's voting power proposalId, choice: unused param for future usage/
function handleVote( address voter, uint256, /*proposalId*/ uint256 /*choice*/ ) external override onlyGovernance returns (uint256 votingPower) { (uint256 stake, uint256 dStake, address representative) = staking .initAndReturnStakerDataForCurrentEpoch(voter); return representative == voter...
1,596,857
pragma solidity 0.6.12; // /** * @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, which is the standard behavior in h...
buy in ETH, outToken is ETH, amountIn is token convert to amountIn in ETH
function calcImpactCostFor_SWAP_WITH_EXACT(address token, bytes memory data, uint256 ethAmount, uint256 erc20Amount) public pure returns (uint256 impactCost) { (, address outToken, , uint256 amountIn) = abi.decode(data, (address, address, address, uint256)); if (outToken != token) { uint...
14,965,902
pragma solidity 0.5.10; contract Context { constructor () internal { } function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING return msg.sender; } function _MSGDATA330() ...
inject NONSTANDARD NAMING
function REFUND497(bytes32 loan) external {
1,784,199
pragma solidity ^0.4.24; // File: contracts/upgradeability/ImplementationStorage.sol /** * @title ImplementationStorage * @dev This contract stores proxy implementation address. */ contract ImplementationStorage { /** * @dev Storage slot with the address of the current implementation. * This is the ...
Returns current stored migration count return uint256 Count/
function getMigrationCount() external view returns (uint256) { return migrations.length; }
5,903,380
./full_match/1/0x2fC246149B4B8d7bcEF6188A10AF1791380227f1/sources/src/BaseWithStorage/ERC20Group.sol
mint more tokens of a specific subToken . to address receiving the tokens. id subToken id (also the index at which it was added). amount of token minted.
function mint( address to, uint256 id, uint256 amount ) external { require(_minters[msg.sender], "NOT_AUTHORIZED_MINTER"); (uint256 bin, uint256 index) = id.getTokenBinIndex(); mapping(uint256 => uint256) storage toPack = _packedTokenBalance[to]; toPack[bi...
8,434,504
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view retu...
Move all the remaining elements down one
function finishRemoveToken() external onlyGovernance timelockConditionsMet(3) { uint256 length = activeTokens.length; for(uint256 i = 0; i < length; i++){ if(activeTokens[i] == _timelock_address){ for(uint256 i2 = i; i2 < length-1; i2++){ } ...
10,720,027
pragma solidity >=0.4.22 < 0.4.25; pragma experimental ABIEncoderV2; /** * @title MetadataRegistry * @author Cory Dickson (@gh1dra) * @dev On-chain registry that stores IPFS (multihash) hash for contract addresses. A multihash entry is in the format * of <varint hash function code><varint digest size in bytes><has...
Retrieve number of versions published for a contract _address address used as key _categoryID The keccak256 hash of the string representing the category/
function getVersion(address _address, bytes32 _categoryID) public view returns(uint) { uint version = versions[_address][_categoryID]; return version; }
13,114,927
./full_match/11155111/0xaf6EeD5e61BE0936BDE7fc347a218230FA661E9e/sources/contracts/Latest2_HRTCrowdfunding.sol
Internal function to check if the caller is the campaign owner
function isCampaignOwner(uint256 _campaignId) internal view returns (bool) { return msg.sender == campaigns[_campaignId].owner; }
3,800,239
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "../interfaces/IUniswapRouter.sol"; import "./StrategyBase.sol"; interfac...
TODO Check if there is enough WETH, if not withdraw collateral
function withdraw(uint256 amount) public override onlyPool { token.transfer(pool, amount); }
12,865,805
./full_match/1/0x653050F11B5f20213C9d1Ee62Cc02A76518649c6/sources/contracts/DullahanVault.sol
Get the maximum amount that can be minted by the user user User address return uint256 : Max amount to mint/
function maxMint(address user) public view returns (uint256) { return type(uint256).max; }
9,800,050
/** *Submitted for verification at Etherscan.io on 2021-08-11 */ /* ___ _ ___ _ | .\ ___ _ _ <_> ___ | __><_>._ _ ___ ._ _ ___ ___ | _// ._>| '_>| ||___|| _> | || ' |<_> || ' |/ | '/ ._> |_| \___.|_| |_| |_| |_||_|_|<___||_|_|\_|_.\___. * P...
Validations are checked from bridge state
function _claimBridgedAmount(uint _index) internal returns (bool) { (address account, uint amount, , , ) = bridgeState.inboundings(_index); require(account == messageSender, "Caller is not matched"); bridgeState.claimInbound(_index); require(_mintByProxy(account, amount), "Mint fa...
10,567,829
./full_match/43113/0xe2B4Af9921C0d89B4404Baa3aD9223904Bb8C876/sources/Avalanche/burnvault.sol
setlockPeriod/
function setlockPeriod(uint256 _lockPeriod)public onlyOwner{ lockPeriod=_lockPeriod; }
7,183,562
/************************************************************************* * This contract has been merged with solidify * https://github.com/tiesnetwork/solidify *************************************************************************/ pragma solidity ^0.4.10; /******************************************...
Locks or allows transfer for all holders, for emergency reasons/
function setLockedState(bool state) managerOnly { transferLocked = state; }
2,500,679
// File: soltsice/contracts/MultiOwnable.sol pragma solidity ^0.4.18; /* * A minimum multisig wallet interface. Compatible with MultiSigWallet by Gnosis. */ contract WalletBasic { function isOwner(address owner) public returns (bool); } /** * @dev MultiOwnable contract. */ contract MultiOwnable...
var (,,minPrice,,,,,,,) = owner.auctionStates(this);
function minPrice() public view returns (uint256) { var (endSeconds,maxTokenBidInEther,minPrice,highestBid,highestBidder,cancelled,finalized,maxTokenBidInUsd,highestBidInUsd,highestBidderInUsd,item) = owner.auctionStates(this); return minPrice; }
12,904,586
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "../ShareholderRegistry/IShareholderRegistry.sol"; import "./IVoting.sol"; contract VotingBase { IShareholderRegistry _shareholderRegistry; IERC20Upgradeable _token; ...
Returns the amount of valid votes for a given address An address that is not a contributor, will have always 0 voting power An address that has not delegated at least itself, will have always 0 voting power account The account whose voting power is requested return Account's voting power
function getVotingPower(address account) public view returns (uint256) { return _votingPower[account]; }
5,400,869
/** *Submitted for verification at Etherscan.io on 2020-08-15 */ pragma solidity ^0.5.15; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure r...
harvest and unstakeswap univ2 LPToken to YAM / yCRV
function exitPool() external { Yam(stakingpool).exit(); IERC20(yam).safeApprove(unirouter, uint(-1)); IERC20(ycrv).safeApprove(unirouter, uint(-1)); UniswapRouter(unirouter).removeLiquidity( address(yam), address(ycrv), IERC20(univ2).balanceOf(msg.sender), 0, 0, ...
13,054,786
./full_match/1313161555/0x5A824f809B300bEeC20eB5b931747726Bd2afdd2/sources/contracts/helpers/ITemporarilyPausable.sol
Interface for the TemporarilyPausable helper./
interface ITemporarilyPausable { event PausedStateChanged(bool paused); function getPausedState() external view returns (bool paused, uint256 pauseWindowEndTime, uint256 bufferPeriodEndTime); }
7,095,885
pragma solidity >=0.4.9 <0.6.0; contract r { function s() public view {} } contract a is r { uint x = 1; function getX() public view returns (uint) { return x; } } contract b is a { uint y = 2; uint x = 3; function getY(uint z, bool r) public returns (uint) { ...
d();sha3("bla");x++;
function d() public returns (uint a, uint b) { address payable o = msg.sender; o.call.gas(200000).value(address(this).balance)(abi.encode("pay()")); getY(x); a = getX() + getY(1, false); b = getX() + getY(x); }
12,591,743
// Sources flattened with hardhat v2.9.3 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.5.0 // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in t...
See {IERC1155MetadataURI-uri}. This implementation returns the same URI for all token types. It relies on the token type ID substitution mechanism Clients calling this function must replace the `\{id\}` substring with the actual token type ID./
function uri(uint256 tokenId) public view virtual override returns (string memory) { return string(abi.encodePacked(_uri, tokenId.toString())); }
12,214,322
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@...
Allow external checks for token existence/
function tokenExists(uint256 _tokenId) public view returns(bool) { return _exists(_tokenId); }
1,378,920
./full_match/80001/0xb1B3D50811731f55543152FA134D0EF44f082cb6/sources/contracts/Gateway/ClaimHelper.sol
Only admin allowed to call this function
function changeDependentContractAddress() external { require( IAccessControl(address(cg)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "Pool: Caller is not an admin" ); coverGateway = CoverGateway(cg.getLatestAddress("CG")); listingGateway = ListingGateway(cg.get...
9,504,935
./full_match/1/0xc751D8c8f7b2fa4d9d01507E5A088F1b136e10c2/sources/src/lib/StringUtils.sol
Splits the slice, setting `self` to everything after the first occurrence of `needle`, and returning everything before it. If `needle` does not occur in `self`, `self` is set to the empty slice, and the entirety of `self` is returned. self The slice to split. needle The text to search for in `self`. re...
function split(Slice memory self, Slice memory needle) internal pure returns (Slice memory token) { split(self, needle, token); }
9,823,810
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.7; /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ...
Allow the owner to update a token URI. only updates for tokens not yet minted after calling this existing token URIs should be changed on .. the NFT hubs using setTokenURI() _market the market address the token belongs to _cardId the index 0 card id of the token to change _newTokenURIs the new URIs to set assembl...
function updateTokenURI( address _market, uint256 _cardId, string[] calldata _newTokenURIs ) external override onlyUberOwner { IRCMarket.Mode _mode = IRCMarket(_market).mode(); uint256 _numberOfCards = IRCMarket(_market).numberOfCards(); tokenURIs[_market][_cardId...
5,501,815
./full_match/1/0xA215610b717576D23EC54a1f0Cd37fa3f14163b1/sources/contracts/smartyield/providers/AaveV2/fix/SmartYield.fix.sol
calculate the yield for next term, ends current term, allow bond holders to claim their rewards _bond the bond token address for the term/ if no more term is set up, then the yield goes to liqudity provider
function liquidateTerm(address _bond) external nonReentrant defaultCheck { require(termList.contains(_bond), "invalid bond address"); TermInfo memory termInfo = bondData[_bond]; require(!termInfo.liquidated, "term already liquidated"); uint256 _end = termInfo.end; address nex...
4,830,310
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; /** * @title GraphTokenDistributor * ...
Remove token balance available for multiple accounts. _accounts Addresses to assign tokens to _amounts Amounts of tokens to assign to beneficiary/
function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner { require(_accounts.length == _amounts.length, "Distributor: !length"); for (uint256 i = 0; i < _accounts.length; i++) { _setBeneficiaryTokens(_accounts[i], beneficiaries[_acc...
13,110,976
./partial_match/97/0x067293eDC235491cBF8bf21De4614F48881d884a/sources/OilToken.sol
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); if(totalSupply()>10000000000000000000000){ _burn(_msgSender(),amount/100); _transfer(_msgSender(), fundWallet...
11,477,174
./partial_match/1/0x9DB16288F0fc5d27ce66aA7d7B4992AF5C20D3CA/sources/MTFTokenFarm.sol
------------------------------------------------------------------------ Private function to calculate the percentage ------------------------------------------------------------------------
function calculatePercent(uint256 _tokens) private returns (uint256){ uint onePercentofTokens = _tokens.mul(100).div(100 * 10**uint(2)); return onePercentofTokens; }
3,695,169