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/3/0x0ACb19bf5eE38389B3877020276eB5621663e818/sources/CustomNFT.sol
Mint tokens by user. Users can call this function and pay for "gas" for token minting Owner needs to sign the tokenId Reverts if tokenId already exists Reverts if owner has not signed tokenId tokenId Id of NFT to be minted r signature s signature v recovery id of signature _fees Fees to be used in secondary market...
function mint( uint256 tokenId, address to, uint8 v, bytes32 r, bytes32 s, Fee[] memory _fees, string memory uri ) public noEmergencyFreeze returns (bool) { bytes32 message = getMessageForMint(tokenId, to, _fees); require(isAdmin(getSigner(message,r,s,v)), "admin signature ...
8,099,841
// File: @openzeppelin/contracts/utils/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...
Edit reserved whitelist spots
function editWhitelistReserved(address[] memory _a, uint256[] memory _amountNFTs) public onlyOwner { for(uint256 i; i < _a.length; i++){ whitelistReserved[_a[i]] = _amountNFTs[i]; } }
13,672,761
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "./interfaces/IOptions.sol"; import "./interfaces/IHegexoption.sol"; /** * @author [email protected] * @title Option factory aka Mighty Option Chef * @notice Option Chef has the monopoly to m...
custom functions in useIERC721 functions in use
interface IHegexoption { function burnHegexoption(uint _id) external; function mintHegexoption(address _to) external returns (uint256); function ownerOf(uint256 tokenId) external view returns (address owner); }
1,527,143
/* * Havven Contract * * The collateral token of the Havven stablecoin system. * * version: nUSDa.1 * date: 29 Jun 2018 * url: https://github.com/Havven/havven/releases/tag/nUSDa.1 * * MIT License * =========== * * Copyright (c) 2018 Havven * * Permission is hereby granted, free of charge, t...
Cancel an existing vote by the sender on a motion to confiscate the target balance./ An account may cancel its vote either before the confirmation phase when the motion is still open, or after the confirmation phase, when the motion has concluded. But the totals must not change during the confirmation phase itself. / I...
function cancelVote(uint motionID) external { require(!motionConfirming(motionID)); Vote senderVote = vote[msg.sender][motionID]; require(senderVote != Vote.Abstention); if (motionVoting(motionID)) { if (senderVote == Vote.Yea) { votesFor...
6,482,239
pragma solidity ^0.5.0; // Safe math library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(...
Returns the percent of INCH that has not been burned (sent to 0X0) Implicitly floors the result INCH sent to burn addresses other than 0x0 are not currently included in calculation
function getPercentOfInchRemaining() external view returns(uint) { return inchWormContract.totalSupply().mul(100).div(initialSupply); }
893,042
pragma solidity ^0.6.2; // Aave LendingPool interface interface ILendingPool { function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external payable; function withdraw(address asset, uint256 amount, address to) external; function getReserveData(address asset) external vi...
Aave LendingPool interface
interface ILendingPool { function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external payable; function withdraw(address asset, uint256 amount, address to) external; function getReserveData(address asset) external view returns( uint256 configuration, uint128 ...
12,987,940
pragma solidity >=0.5.10; import 'ROOT/trading/IOrders.sol'; import 'ROOT/libraries/math/SafeMathUint256.sol'; import 'ROOT/libraries/math/SafeMathInt256.sol'; import 'ROOT/trading/Order.sol'; import 'ROOT/reporting/IMarket.sol'; import 'ROOT/libraries/Initializable.sol'; import 'ROOT/libraries/token/IERC20.sol'; imp...
_amount = _uints[0] _price = _uints[1] _outcome = _uints[2] _moneyEscrowed = _uints[3] _sharesEscrowed = _uints[4] _betterOrderId = _bytes32s[0] _worseOrderId = _bytes32s[1] _tradeGroupId = _bytes32s[2] _orderId = _bytes32s[3]
function saveOrder(uint256[] calldata _uints, bytes32[] calldata _bytes32s, Order.Types _type, IMarket _market, address _sender, IERC20 _kycToken) external returns (bytes32 _orderId) { require(msg.sender == createOrder || msg.sender == address(this)); require(_uints[2] < _market.getNumberOfOutcomes(...
1,012,403
pragma solidity 0.4.22; import "./zeppelin-solidity/contracts/math/SafeMath.sol"; import "./OttolottoDaoRules.sol"; /** * @title Ottolotto Distributed Autonomus Organization. * * The ottolotto platform is curated by Decentralized Autonomous Organization, * this means nobody has direct access to funds or Jackpot and...
Accept funds./
function acceptFunds() public payable { notDistributedWei += msg.value; }
968,042
./full_match/1/0x3f4DD25BA6Fb6441Bfd1a869Cbda6a511966456D/sources/src/HoneyJar.sol
burn the honeyjar tokens. Nothing will have the burn role upon initialization This will be used for future game-mechanics only callable by the BURNER role
function burn(uint256 _id) external override onlyRole(Constants.BURNER) { _burn(_id); }
3,093,384
// // Made by: Omicron Blockchain Solutions // https://omicronblockchain.com // // SPDX-License-Identifier: MIT pragma solidity =0.8.10; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/interfaces/IERC721.sol"; im...
Given an array of base tokens, check if any of the tokens were previously redeemed. _baseTokens Array with base tokens ID. return true if any base token was previously redeemed, false otherwise./
function areRedeemed(uint256[] calldata _baseTokens) external view returns (bool[] memory) { bool[] memory redeemed = new bool[](_baseTokens.length); for (uint256 i = 0; i < _baseTokens.length; i++) { redeemed[i] = redeemedBaseTokens[_baseTokens[i]]; } return redeemed; }
14,093,757
pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "./Table.sol"; //存证合约 contract EvidenceConV1 { // event event RegisterEvent(string serviceId,string sn,string rid,string ts,string remarkJsonValue,address account,uint256 timeStamp); event SetPermitUserEvent(uint256 state,address msgAd...
修改授权,address userAddress 用户地址 .bool permitState 授权状态 true 开启,false关闭
function changePermitUser(address userAddress,bool permitState) public onlyManager returns(uint256){ uint256 state=0; string memory stateMessage=""; permitUserMapping[userAddress]=permitState; if(permitUserMapping[userAddress]==permitState){ state=1; ...
7,284,526
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "../interfaces/ITokenExchange.sol"; import "../connectors/curve/interfaces/IRewardOnlyGauge.sol"; contract A3Crv2A...
TODO: denominator usage check after denormilization check after denormilization
function exchange( address spender, IERC20 from, address receiver, IERC20 to, uint256 amount ) external override { require( (from == a3CrvToken && to == a3CrvGaugeToken) || (from == a3CrvGaugeToken && to == a3CrvToken), "A3C...
7,242,274
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { /...
Founder or the pixel account set the pixel conversion rate. Pixel team first sets this conversion rate and then start sending COLs in exchange of pixels that people have received. This rate is used in `sendCoinsForPixels` functions to calculate the amount COLs to transfer to pixel holders.
function setPixelConversionRate(uint256 _pixelConvRate) public pixelOrFounder { pixelConvRate = _pixelConvRate; }
6,455,007
/** *Submitted for verification at FtmScan.com on 2021-11-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint256 ...
getter for the total amount of SOUL already released
function totalReleased() public view returns (uint amountReleased) { return _totalReleased; }
12,998,291
pragma solidity >=0.4.21 <0.6.0; import "openzeppelin-solidity/contracts/introspection/IERC1820Registry.sol"; import "openzeppelin-solidity/contracts/utils/Address.sol"; import "../interfaces/IDDAI.sol"; // Dollar cost averaging manager // Account should be operator and stack manager contract DCA { using Address ...
if being called from self msgSender is saved in storage
function _msgSender() internal returns (address payable) { if(msg.sender != address(this)) { return msgSender; } return msg.sender; }
14,072,959
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "sol-datastructs/src/contracts/PolymorphicDictionaryLib.sol"; import "./structs/TableLib.sol"; import "./structs/ColumnLib.sol"; contract ORMBase { //Libraries using PolymorphicDictionaryLib for PolymorphicDictionaryLib.PolymorphicDictionary; ...
Add uint value to set at dictionary[key]. O(1). _key The bytes32 key. _value The uint value. return bool true if succeeded (no conflicts)./
function addUIntForKey(bytes32 _key, uint256 _value) public returns (bool) { return dictionary.addUIntForKey(_key, _value); }
12,583,151
pragma solidity ^0.5.0; contract Token { uint256 public totalSupply; /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 value); function getHolderContract(address a) internal view returns (Holder) { b...
The following line can be commented out to save gas
function createHolder(address payable _owner) public returns (Holder) { bytes memory holder_init_code = hex"608060405234801561001057600080fd5b5033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600080600173ffffffffffffffffff...
7,308,042
// File: github/Team3dVidyaGames/VidyaGenerator/contracts/interfaces/IVault.sol pragma solidity ^0.8.6; /** * @title Vault Interface */ interface IVault { /** * @dev External function to get vidya rate. */ function rewardRate() external view returns (uint256); /** * @dev External functi...
Internal function to finish a commitment when it has ended./
function commitmentFinished() internal { Provider storage user = providerInfo[msg.sender]; if (user.commitmentEndTime <= block.timestamp) { user.committedAmount = 0; user.commitmentIndex = 0; } }
618,701
/** * Copyright 2017-2019, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.8; pragma experimental ABIEncoderV2; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contr...
no need to require value <= totalSupply, since that would imply the sender's balance is greater than the totalSupply, which should be an assertion failure
function _burn( address _who, uint256 _tokenAmount, uint256 _assetAmount, uint256 _price) internal { require(_tokenAmount <= balances[_who], "burn value exceeds balance"); balances[_who] = balances[_who].sub(_tokenAmount); _tokenAmount = _toke...
15,801,786
./partial_match/1/0x2F8BAc6b71867A30D6b862595648e1Fa30955Ac8/sources/CCIToken.sol
unlock tokens of array of addresses. Available only to the owner. accounts array of addresses. amounts array of amounts of tokens./
function unlock(address[] calldata accounts, uint256[] calldata amounts) external onlyOwner { for (uint256 i = 0; i < accounts.length; i++) { _locked[accounts[i]] = _locked[accounts[i]].sub(amounts[i]); emit Unlocked(accounts[i], amounts[i], msg.sender); } }
15,578,745
./full_match/1/0xdACA381F4Ef448A7cd96e140130B2480787db314/sources/contracts/SattvaBlendSupportersSupport.sol
External functions/
function mint(address _address, uint256 _amount) external onlyRole(MINTER) { _mint(_address, _amount); }
9,728,117
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* Liquidity NFTs Store of value kept on contract so that buyers can opt out and burn their tokens to get cash back if they feel the project isn't going the way that it should. DiscountMint allows people to mint at full-refund price, giving them the ability to ...
See {IERC165-supportsInterface}. Interfaces Supported by this Standard
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC165).interfaceId || interfaceId == Roll...
14,406,159
pragma solidity ^0.4.0; contract ERC20Interface { 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 remaining); function transfer(address to,...
Initialize a week data struct
function initializeWeekData(uint _week) public { if (dataPerWeek[_week].initialized) return; WeekData storage week = dataPerWeek[_week]; week.initialized = true; week.totalTokensCompleted = 0; week.totalPeopleCompleted = 0; week.totalTokens = 0; week.totalPeople = 0; week.totalDaysComm...
1,362,194
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import './interfaces/IERC20.sol'; import './interfaces/IUniswap.sol'; import './interfaces/IWETH.sol'; import './libraries/SafeERC20.sol'; import './libraries/TransferHelper.sol'; import './libraries/Managable.sol'; /// @author Nathan Worsley (https://gi...
given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'MistXLibrary: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'MistXLibrary: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn * amountOut * 1000;...
1,088,964
./partial_match/4/0xCFDad4CeB8a9135FF18FC850031208B2c0024b25/sources/Pawnshop.sol
Returns true if the key is in the map. O(1)./
function contains(AddressToSupportStateMap storage map, address key) internal view returns (bool) { return _contains(map._inner, bytes32(uint256(key))); }
8,690,295
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {Cron, Spec} from "../libraries/internal/Cron.sol"; /** * @title The CronUpkeepDelegate contract * @notice This contract serves as a delegate for all instances of CronUpkeep. Those contra...
Get the id of an eligible cron job return upkeepNeeded signals if upkeep is needed, performData is an abi encoding of the id and "next tick" of the eligible cron job/ DEV: start at a random spot in the list so that checks are spread evenly among cron jobs
function checkUpkeep(bytes calldata) external view returns (bool, bytes memory) { uint256 numCrons = s_activeCronJobIDs.length(); if (numCrons == 0) { return (false, bytes("")); } uint256 startIdx = block.number % numCrons; bool result; bytes memory payload; (result, payload) = check...
5,347,000
//Address: 0xcba6f10d1147b2c5a3d8d8cbd93c373b31c6c2c8 //Contract name: VuePayTokenSale //Balance: 1.208 Ether //Verification Date: 10/3/2017 //Transacion Count: 36 // CODE STARTS HERE pragma solidity^0.4.17; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization co...
Signals that the sale has reached its minimum funding goal
function triggerMinCap() public onlyOwner { minCapReached = true; }
12,888,347
./partial_match/1/0x429E09f55f42Ff268Bb5A37192298C3572197B1f/sources/MasterChef.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } if (block.number >= bonusEndBlock) { bonusEndBlock = bonusEndBlock + blocksHalving; sushiPerBlock = sushiPerBlo...
2,693,916
pragma solidity >=0.4.0 <0.6.0; /* taking ideas from FirstBlood token */ contract SafeMath { /* function assert(bool assertion) internal { */ /* if (!assertion) { */ /* throw; */ /* } */ /* } // assert no longer needed once solidity is on 0.4.10 */ function safeAdd(uint256 x, uin...
return money if something goes wrong
function createFreeTokens(uint256 numberOfTokens) external payable onlyOwner{ uint256 checkedSupply = safeAdd(totalSupply, tokens); totalSupply = checkedSupply; }
12,535,788
pragma solidity ^0.8.6; /** * @title Logic for Compound's JumpRateModel Contract V2. * @author Compound (modified by Dharma Labs, refactored by Arr00) * @notice Version 2 modifies Version 1 by enabling updateable parameters. */ contract BaseJumpRateModelV2 { /** * @notice The address of the owner, i.e. th...
Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)` cash The amount of cash in the market borrows The amount of borrows in the market reserves The amount of reserves in the market (currently unused) return The utilization rate as a mantissa between [0, 1e18]/ Utilization rate is 0 ...
function utilizationRate( uint256 cash, uint256 borrows, uint256 reserves ) public pure returns (uint256) { if (borrows == 0) { return 0; } return (borrows * 1e18) / ((cash + borrows) - reserves); }
12,663,660
./full_match/5/0x5E37A79cBFBC036467e1295d0A00Cc8c73051580/sources/@reality.eth/contracts/development/contracts/RealityETH_ERC20-3.0.sol
Ask a new question with a bounty and return the ID Template data is only stored in the event logs, but its block number is kept in contract storage. template_id The ID number of the template the question will use question A string containing the parameters that will be passed into the template to make the question ...
function askQuestionERC20(uint256 template_id, string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 tokens) public returns (bytes32) { _deductTokensOrRevert(tokens); require(templates[template_id] > 0, "template must exist"); bytes32 c...
1,897,795
./full_match/1/0xA8121B153c77cA4dd1da3a9D7cDC4729129c8c6D/sources/NFT.sol
Core creator interface/ Royalty support for various other standards
interface ICreatorCore is IERC165 { event ExtensionRegistered(address indexed extension, address indexed sender); event ExtensionUnregistered(address indexed extension, address indexed sender); event ExtensionBlacklisted(address indexed extension, address indexed sender); event MintPermissionsUpdated(a...
3,000,264
./partial_match/1/0x5fa60726E62c50Af45Ff2F6280C468DA438A7837/sources/contracts/exchangeV2/Signatures.sol
Create a hash of TakeAskSingle calldata with an approved caller inputs TakeAskSingle inputs _caller Address approved to execute the calldata return Calldata hash/
function hashTakeAskSingle( TakeAskSingle memory inputs, address _caller ) external pure returns (bytes32) { return _hashCalldata(_caller); }
4,003,374
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/ReentrancyGuard.sol"; import "./markets/MarketRegistry.sol"; import "./SpecialTransferHelper.sol"; import "../../interfaces/markets/tokens/IERC20.sol"; import "../../interfaces/markets/tokens/...
return remaining ETH (if any) return remaining tokens (if any)
function _returnDust(address[] memory _tokens) internal { assembly { if gt(selfbalance(), 0) { let callStatus := call( gas(), caller(), selfbalance(), 0, 0, 0, ...
1,346,559
// SPDX-FileCopyrightText: 2021 ShardLabs // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/I...
Only NodeOperatorRegistry can call this function Withdraws funds from unstaked validator _validatorShare - Address of the validator share that will be withdrawn/
function withdrawTotalDelegated(address _validatorShare) external override { require( msg.sender == address(nodeOperatorRegistry), "Not a node operator" ); (uint256 stakedAmount, ) = getTotalStake( IValidatorShare(_validatorShare) ); if (...
5,895,454
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/Constants.sol"; import { PoolParams } from "./interfaces/Types.sol"; import "./interfaces/IVestingPools.sol"; import "./utils/Claimable.sol"; import "./utils/DefaultOwnable.sol"; impor...
Inits the contract and adds stakes Owner only may call on a proxy (but not on the implementation)
function addStakes( uint256 _poolId, address[] calldata holders, uint256[] calldata allocations, uint256 unallocated ) external onlyOwner { if (allocation == 0) { _init(_poolId); require(_poolId == poolId, "PStakes: pool mismatch"); } ...
12,762,076
./partial_match/1/0x93A20D8EbA6997ABB53aE94bd01727C8e74c8734/sources/TokenCore.sol
removeOperator _operators addresses/
function revokeOperators(address[] memory _operators) public onlySysOp returns (bool) { for (uint256 i=0; i < _operators.length; i++) { delete operators[_operators[i]]; emit OperatorRevoked(_operators[i]); } return true; } event RoleDefined(bytes32 role); event OperatorAssigned(by...
3,566,172
/** *Submitted for verification at Etherscan.io on 2021-07-02 */ /** Hello, Welcome to $GOAT */ pragma solidity ^0.6.12; // SPDX-License-Identifier: Unlicensed interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. ...
SPDX-License-Identifier: Unlicensed
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) ...
15,239,171
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; /* ██████╗ █████╗ ███╗ ██╗██╗███████╗██╗ ██╔══██╗██╔══██╗████╗ ██║██║██╔════╝██║ ██║ ██║███████║██╔██╗ ██║██║█████╗ ██║ ██║ ██║██╔══██║██║╚██╗██║██║██╔══╝ ██║ ██████╔╝██║ ██║██║ ╚████║██║███████╗███████╗ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚══...
Transfers ownership of the collection. Can't be the zero address. newOwner Address of new owner./
function transferOwnership(address newOwner) public onlyOwner { require(!Address.isZero(newOwner), "CXIP: zero address"); _owner = newOwner; }
1,359,583
pragma solidity ^0.5.0; import './ERCX.sol'; import '../Interface/IERCXMetadata.sol'; contract ERCXMetadata is ERC165, ERCX, IERCXMetadata { // item name string internal _name; // item symbol string internal _symbol; // Base URI string private _baseURI; // Optional mapping for item URIs mapping(uin...
Internal function to set the base URI for all item IDs. It is automatically added as a prefix to the value returned in {itemURI}. _Available since v2.5.0._/
function _setBaseURI(string memory baseUri) internal { _baseURI = baseUri; }
12,610,834
// SPDX-License-Identifier: GPL-2.0 pragma solidity 0.8.8; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contrac...
Deposit Koromaru tokens into farm Deposited Koromaru will zap into Koro/WETH LP tokens, a refund of TX fee % will be issued/ do tax refund
function depositKoroTokensOnly(uint256 _amount) external whenNotPaused nonReentrant { require(_amount > 0, "KOROFARM: Invalid Koro Amount"); require( _amount <= zapKoroLimit, "KOROFARM: Can't deposit more than Zap Limit" ); (uint25...
12,599,158
pragma solidity ^0.5.0; //Functions for retrieving min and Max in 51 length array (requestQ) //Taken partly from: https://github.com/modular-network/ethereum-libraries-array-utils/blob/master/contracts/Array256Lib.sol library Utilities { /** * @dev Returns the minimum value in an array. */ function ge...
Gets all dispute variables _disputeId to look up return bytes32 hash of dispute return bool executed where true if it has been voted on return bool disputeVotePassed return address of reportedMiner return address of reportingParty return address of proposedForkAddress return uint of requestId return uint of timestamp ...
function getAllDisputeVars(TellorStorage.TellorStorageStruct storage self, uint256 _disputeId) internal view returns (bytes32, bool, bool, address, address, uint256[9] memory, int256) { TellorStorage.Dispute storage disp = self.disputesById[_disputeId]; return ( ...
12,578,965
pragma solidity ^0.4.23; /// @title Listing /// @dev An indiviual O2OProtocol Listing representing an offer for booking/purchase import "./Purchase.sol"; import "./PurchaseLibrary.sol"; contract Listing { uint public DEFAULT_EXPIRATION = 60 days; /* * Events */ event ListingPurchased(Purchase _purcha...
close(): Allows a seller to close the listing from further purchases
function close() public isSeller { unitsAvailable = 0; emit ListingChange(); }
12,737,851
// SPDX-License-Identifier: Apache-2.0 /****************************************************************************** * Copyright 2020 IEXEC BLOCKCHAIN TECH * * * * Licensed under the Apache License, Ve...
solium-disable-next-line security/no-low-level-calls
function createContractAndCall(bytes memory _code, bytes32 _salt, bytes memory _call) public returns(address) { address addr = _create2(_code, keccak256(abi.encodePacked(_salt, _call))); emit NewContract(addr); if (_call.length > 0) { (bool success, bytes memory reason) = addr.call(_call); require(succ...
1,836,372
pragma solidity 0.5.12; //contrato simples de aluguel. Por convenção, o nome, após contract começa com letra maiúscula. contract Aluguel { string public locatario; string public locador; uint256 private valor; uint256 constant numeroMaximoLegalDeAlugueisparaMulta = 3; // Constructor de...
Os parametros serão adicionados pelo usuario no Remix, no campo de deployed contracts, ou numa pagina frontend desenvolvida para isso
function simulaMulta ( uint256 mesesRestantes, uint256 totalMesesContrato) public view returns ( uint256 valorMulta) { valorMulta = valor*numeroMaximoLegalDeAlugueisparaMulta; valorMulta = valorMulta/totalMesesContrato; valorMulta = valorMulta*mesesRestantes; return valorMulta; ...
12,701,074
/** *Submitted for verification at Etherscan.io on 2021-03-16 */ // 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 ...
Function designed to promote trading with incentive. Users get 20% of WETH from profitable trades
function executorSwapTokens(address _executor, uint256 _minSecSinceLastTrade, bool doFlash) external { require(now.sub(lastTradeTime) > _minSecSinceLastTrade, "The last trade was too recent"); require(_msgSender() == tx.origin, "Contracts cannot interact with this function"); checkAndSwapTok...
10,912,233
contract Scrypt { /// Verifies a salsa step in the first half of the scrypt computation. function verifyFirstHalf(uint[4] input, uint[4] output) constant returns (bool) { var (a, b, c, d) = Salsa8.round(input[0], input[1], input[2], input[3]); return (a == output[0] && b == output[1] && c == out...
Verifies a salsa step in the first half of the scrypt computation.
function verifyFirstHalf(uint[4] input, uint[4] output) constant returns (bool) { var (a, b, c, d) = Salsa8.round(input[0], input[1], input[2], input[3]); return (a == output[0] && b == output[1] && c == output[2] && d == output[3]); }
5,517,823
./partial_match/1/0x5f1F5b4BFAa78E4e1F8063b71E96656bAF965Db7/sources/KongEntropyDirectMint.sol
Interface for Register contract./
interface RegisterInterface { function getKongAmount(bytes32 primaryPublicKeyHash) external view returns (uint); function getTertiaryKeyHash(bytes32 primaryPublicKeyHash) external view returns (bytes32); function mintKong(bytes32 primaryPublicKeyHash, address recipient) external; }
15,523,967
./full_match/5/0x04996Bf06a0654C8299041086115fbB0B836683f/sources/project_/contracts/HuxleyComicsIssue4.sol
Updates value of 'canPublicMint' _value New value of 'canPublicMint'/
function setCanPublicMint(bool _value) external onlyOwner { canPublicMint = _value; }
1,946,795
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "./inte...
Batch minting of tokens Currently no restrictions as to who is allowed to mint - so, it is public. ERC-1155 _to The address that will own the minted token _tokenIds IDs of the tokens to be minted _values Amounts of the tokens to be minted _data Additional data forwarded to onERC1155BatchReceived if _to is a contra...
function mintBatch( address _to, uint256[] memory _tokenIds, uint256[] memory _values, bytes memory _data ) external onlyFromVoucherKernel { _mintBatch(_to, _tokenIds, _values, _data); }
6,202,375
pragma solidity ^0.6.6; ...
inject NONSTANDARD NAMING
function ADD452(uint256 a, uint256 b) internal pure returns (uint256) {
1,825,752
pragma solidity ^0.5.17; import "./Staking/SafeMath96.sol"; import "../openzeppelin/SafeMath.sol"; import "../openzeppelin/SafeERC20.sol"; import "./IFeeSharingProxy.sol"; import "./Staking/IStaking.sol"; contract FeeSharingProxy is SafeMath96, IFeeSharingProxy { using SafeMath for uint256; using SafeERC20 for IERC...
adds checkpoint with accumulated amount by function invocation _token address of the token /write a regular checkpoint
function _addCheckpoint(address _token) internal { if (block.timestamp - lastFeeWithdrawalTime[_token] >= FEE_WITHDRAWAL_INTERVAL) { lastFeeWithdrawalTime[_token] = block.timestamp; uint96 amount = unprocessedAmount[_token]; unprocessedAmount[_token] = 0; _writeTokenCheckpoint(_token, amount); } }
7,285,470
./full_match/5/0x3c2F64de19CbA99Dd82B7FCDd56CD122EDB67117/sources/src/Cre8ing.sol
exit a CRE8OR from the warehouse tokenId token to exit from the warehouse
function leaveWarehouse(uint256 tokenId) internal { _beforeCre8ingExit(tokenId); uint256 start = cre8ingStarted[tokenId]; cre8ingTotal[tokenId] += block.timestamp - start; cre8ingStarted[tokenId] = 0; emit Uncre8ed(tokenId); }
7,053,681
./full_match/11155111/0x699f6dB94d38cD523584c91593e033c29948f56e/sources/contracts/Buffer2.sol
Calculate IPFS CID from id and encoding
function cid() public view returns (string memory) { bytes32 data = bytes32(id); bytes memory alphabet = bytes("abcdefghijklmnopqrstuvwxyz234567"); bytes memory _cid = bytes(encoding ? "bafybei" : "bafkrei"); uint bits = 2; uint buffer = 24121888; uint bitsPerChar = 5; uint mask = uint((1 ...
3,795,337
./full_match/1287/0xC7C8F57C273c59476f67c614192296dEBcFE9229/sources/project_/contracts/Voting/BaseVotingContract.sol
core logic for voting votingBallotId this is the id of the ballot for which user is voting voter Voter's address oldWeight Old weight of the voter newWeight New weight of the voter
function _changeVoteWeight( uint256 votingBallotId, address voter, uint256 oldWeight, uint256 newWeight ) private { require( alreadyVoted[votingBallotId][voter] == true, "INVALID: INTERNAL: USER_HAS_NOT_VOTED" ); bool vote = userVot...
7,096,798
/* _____ _________________ _ _ _ ___ _ / ___| ___| ___ \ ___ \ | | | | / / | | | \ `--.| |__ | |_/ / |_/ / | | | |/ /| | | | `--. \ __|| __/| __/| | | | \| | | | /\__/ / |___| | | | | |_| | |\ \ |_| | \____/\____/\_| \_| \___/\_| \_/\___/ ...
Safe SEPPUKU transfer function, just in case if rounding error causes pool to not have enough SEPPUKU.
function safeSEPPUKUTransfer(address _to, uint256 _amount) internal { uint256 SEPPUKUBal = SEPPUKU.balanceOf(address(this)); if (_amount > SEPPUKUBal) { SEPPUKU.transfer(_to, SEPPUKUBal); SEPPUKU.transfer(_to, _amount); } }
7,669,552
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; // Base import "./openzeppelin-presets/ERC1155PresetMinterPauserSupplyHolder.sol"; // Token interfaces import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/inte...
Lets a protocol admin update the royalties paid on pack sales.
function setRoyaltyBps(uint256 _royaltyBps) public onlyModuleAdmin { require( _royaltyBps < controlCenter.MAX_BPS(), "NFTCollection: Invalid bps provided; must be less than 10,000." ); royaltyBps = _royaltyBps; emit RoyaltyUpdated(_royaltyBps); }
6,389,281
// File: contracts/ComptrollerInterface.sol pragma solidity 0.5.17; contract ComptrollerInterface { /// @notice Indicator that this is a Comptroller contract (for inspection) bool public constant isComptroller = true; /*** Assets You Are In ***/ function enterMarkets(address[] calldata cTokens) exte...
. Admin function: change redeemFee. newRedeemFee newRedeemFee return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ Check caller = admin
function _setRedeemFee(uint newRedeemFee) public returns (uint) { if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK); } require(newRedeemFee <= MAX_BORROW_REDEEM_FEE, "newRedeemFee is greater than MAX_BORROW_REDEEM_FEE"); ...
598,269
pragma solidity ^0.5.16; import "./ERC20.sol"; // SushiBar is the mock contract for testing. // Ref: https://etherscan.io/address/0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272#code contract SushiBar is StandardToken(0, "SushiBar", 18, "xSUSHI") { using SafeMath for uint256; ERC20 public sushi; constructor(E...
Enter the bar. Pay some SUSHIs. Earn some shares.
function enter(uint256 _amount) public { uint256 totalSushi = sushi.balanceOf(address(this)); uint256 totalShares = totalSupply; if (totalShares == 0 || totalSushi == 0) { _mint(msg.sender, _amount); uint256 what = _amount.mul(totalShares).div(totalSushi); ...
1,052,055
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; /** * @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...
Hook to surface arbitrary logic to be called after deployment by owner Governance hook Does not ensure that it is only called once because it is permissioned to governance only/ Storing an initial non-zero value makes deployment a bit more expensive, but in exchange the refund on every call to nonReentrant will b...
function setup() external onlyOwner { _setNotEntered(true); _setup(); }
12,066,218
./full_match/43113/0xA09322b0F84Ea97b327a25cECDB0A946Ef67A3B2/sources/GothSwapRouter02.sol
ADD LIQUIDITY create the pair if it doesn't exist yet
function _addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin ) internal virtual returns (uint amountA, uint amountB) { if (IGothSwapFactory(factory).getPair(tokenA, tokenB) == address(0)...
7,158,457
./full_match/42/0xa312e287d9E09792B2e2C45BE4bBC39cfFaD34BC/sources/8a173a65099261582a652ba18b7d96c1/APIConsumer.sol
Callback function for getting the view count on a video/Set contract variables to start the agreementTurn string total view count into an int and calculate pay
function viewCountFallback(bytes32 _requestId, bytes32 _viewCount) public recordChainlinkFulfillment(_requestId) { string memory _viewCountString = bytes32ToString(_viewCount); viewCount = uint256(parseInt(_viewCountString, 0)); payForWithdraw = (payPerView * viewCount) - accumulatedPay; ...
9,574,498
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "@openzeppelin/contracts/math/SafeMath.sol"; contract Universe { using SafeMath for uint; //The register of poem creators mapping (uint => address) public poemOwners; //The maximum number of poems uint constant public MAXPOEMS = 100; ...
A function to get a poem's creator is the index of the poem in the array of poems returns the poem at the index specified/
function getPoemOwner(uint id) view public returns (address poemOwner) { require(id < MAXPOEMS); return poemOwners[id]; }
1,086,880
./partial_match/1/0x67391801E7564994bdAa80544Ff916A7bCBFCB60/sources/MacroverseUniversalRegistry.sol
Transfer all Ether held by the contract to the owner./ For some reason Ownable doesn't insist that the owner is payable. This makes it payable.
function reclaimEther() external onlyOwner { address(uint160(owner())).transfer(address(this).balance); }
9,236,575
./full_match/1/0x3Bc988Da91b01d682C37e29f95bC0Ed18F3273Fc/sources/contracts/GraphcastRegistryV2.sol
Return Staking interface return Staking contract registered with Graph Proxy Controller/
function staking() internal view returns (Staking) { return Staking(stakingAddr); }
16,529,869
/* Copyright [2019] - [2021], PERSISTENCE TECHNOLOGIES PTE. LTD. and the pStake-smartContracts contributors SPDX-License-Identifier: Apache-2.0 */ pragma solidity >=0.7.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradea...
Set 'whitelisted address', performed by admin only whitelistedAddress: contract address of the whitelisted party holderContractAddress: holder contract address lpContractAddress: LP token contract address Emits a {setWhitelistedAddress} event/ lpTokenERC20ContractAddress or sTokenReserveContractAddress can be addres...
function setWhitelistedAddress( address whitelistedAddress, address holderContractAddress, address lpContractAddress ) public virtual override returns (bool success) { require(_msgSender() == _whitelistedPTokenEmissionContract, "ST12"); require(whitelistedAddress != address(0), "ST13"); if (!_whitelistedA...
12,967,255
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../interfaces/INFTComplexGemPoolData.sol"; import "../interfaces/ISwapQueryHelper.sol"; import "../interfaces/INFTGemMultiToken.sol"; ...
the claim quantity (count of gems staked) for the given claim hash/
function claimQuantity(ComplexPoolData storage self, uint256 claimHash) public view returns (uint256) { return self.claimQuant[claimHash]; }
15,863,495
pragma solidity 0.5.16; import './TrustlessFund.sol'; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract TrustlessFundFactory is Ownable { /*** STORAGE VARIABLES ***/ /** * @notice Maps unique IDs to funds. */ mapping(uint => address) funds; /** * @notice Maps user address to their c...
Deploy a TrustlessFund contract. _expiration Date time in seconds when timelock expires. _beneficiary Address permitted to withdraw funds after unlock./
function createFund(uint _expiration, address _beneficiary) public payable returns(uint) { require(funds[nextId] == address(0), 'id already in use'); require(msg.value == fee, 'must pay fee'); TrustlessFund fund = new TrustlessFund(_expiration, _beneficiary, msg.sender); funds[nextId] = address(fund);...
933,201
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol"; import { StandardBridge } from "../universal/StandardBridge.sol"; import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol"; /** * @title L2StandardBridge * ...
Withdraw tokens to self on L1 _l2Token The L2 token address to withdraw _amount The amount of L2 token to withdraw _minGasLimit The min gas limit in the withdrawing call _data Additional calldata to pass along/
function withdraw( address _l2Token, uint256 _amount, uint32 _minGasLimit, bytes calldata _data ) external payable virtual { _initiateWithdrawal(_l2Token, msg.sender, msg.sender, _amount, _minGasLimit, _data); }
13,129,869
// SPDX-License-Identifier: MIT pragma solidity ^0.8.5; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../yearn/interfaces/VaultApi.sol"; import "../yearn/interfaces/StrategyApi.sol"; /* * BaseStrategy implements all of the required functionality to interoperate closely * with the core protocol. T...
Resolve governance address from Vault contract, used to make assertions on protected functions in the Strategy/
function governance() internal view returns (address) { return VaultAPI(vault).governance(); }
897,494
pragma solidity 0.5.17; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "../interfaces/Comptroller.sol"; import "../interfaces/PriceOracle.sol"; import "../interfaces/CERC20.sol"; import "../interfaces/CEther.sol"; import "../Utils.sol"; contract CompoundOrder is Utils(address(0), address(0), address(...
Checks if an Ethereum account is a smart contract _addr the account to be checked return True if the account is a smart contract, false otherwise/
function isContract(address _addr) internal view returns(bool) { uint256 size; if (_addr == address(0)) return false; assembly { size := extcodesize(_addr) } return size>0; }
15,851,496
./partial_match/1/0x65D1121cf02007A7ae46C783824272C3aBC791F6/sources/PublishedToken.sol
Setter for bonus of tokens user get for 1 ETH sending to contract/
function setBonus(uint256 bonus)onlyOwner public returns (bool success){ bonusinpercent = bonus; return true; }
15,900,502
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the on...
Lock the token URI, no one can change it anymore
function lock_URI() external onlyOwner { lock = true; }
1,677,786
./full_match/1/0x0EBB2B76FBdcc3a636b652fd3769154b5C196249/sources/contracts2/CSPLGuildPoolV2.sol
poolに追加 execute from buySPL
function addEthToGuildPool(uint16 _guildType, address _purchaseBy) external payable whenNotPaused() nonReentrant() { require(guildAsset.getTotalVolume(_guildType) > 0); require(allowedAddresses[msg.sender]); guildTypeToTotalAmount[_guildType] += msg.value; emit EthAddedToPool( _guildType, ...
8,294,343
./full_match/3/0xA2656476F64F5f102a996d8BF87Fd6ea1342aad4/sources/contracts/wakeup.sol
Confirm whether the user is in the contract as joined or not.
function verifyJoined(address _participant) public view returns (bool) { return participantExists[_participant]; }
8,282,126
/** *Submitted for verification at Etherscan.io on 2021-08-23 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.4; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas opti...
Multiplies two unsigned integers, reverts on overflow./ Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-solidity/pull/522
function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath#mul: OVERFLOW"); return c; }
2,332,198
./partial_match/1/0x2F66C5aAF006Bd9c51615D617589C16c0ed35fD3/sources/contracts/DODOV3MM/D3Vault/periphery/D3PoolQuota.sol
Enable default quota for a token
function enableDefaultQuota(address token, bool status) external onlyOwner { hasDefaultQuota[token] = status; }
4,285,681
/** *Submitted for verification at Etherscan.io on 2018-03-26 */ pragma solidity ^0.4.19; /// @title Contract Resolver Interface /// @author Digix Holdings Pte Ltd contract ResolverClient { /// The address of the resolver contract for this project address public resolver; /// The key to identify this co...
Transfer(_from, _to, _value);
function log_demurrage_fees(address _from, address _to, uint256 _value) public if_sender_is(CONTRACT_SERVICE_TOKEN_DEMURRAGE) { }
13,046,814
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma abicoder v2; import "./interfaces.sol"; import "./helpers.sol"; contract Resolver is Helpers { /** * @dev Sort token address * @param _token0: token0 Address * @param _token1: token1 Address */ function sort(address _token0, add...
Sort token address _token0: token0 Address _token1: token1 Address/
function sort(address _token0, address _token1) external view returns (address token0, address token1) { if (_token0 < _token1) { token0 = _token1; token1 = _token0; token0 = _token0; token1 = _token1; } }
480,230
./partial_match/56/0x472F647Df948a00534098E4d564cd8A145d6e9f7/sources/EggChef.sol
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw() public { UserInfo storage user = userInfo[msg.sender]; egg.safeTransfer(address(msg.sender), user.amount); emit EmergencyWithdraw(msg.sender, user.amount); user.amount = 0; user.rewardDebt = 0; user.rewardPending = 0; }
11,092,731
pragma solidity ^0.4.24; contract Ownable { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() in...
nodes can be bought cheaper if the user uses a valid referral address set parent/child relations (only if there is no connection/parent yet available) --> this also means that a referral structure can't be changed only apply discount if referral address is valid (or as long we can step up the hierarchy) do not take nod...
function _buyMasternode(string memory coinsTargetAddress, bool useReferral, address referral) internal { require(isActive, "Buying is currently deactivated."); require(currentPrice > 0, "There was no MN price set so far."); uint256 nodePrice = currentPrice; if (useReferral && isValidReferralAddress(...
12,878,880
./full_match/1/0x467439207d53530505E5Eb40eDD6deBBAfF3e063/sources/Users/mario/Development/MarsGenesis/Contract/contracts/MarsGenesisAuction.sol
Sends donation balance to the npo addresses Only callable by the deployer
function sendDonations() external { require(msg.sender == _deployerAddress, "INVALID_ROLE"); require(npoBalance > 0, "No Balance to send"); uint amount = npoBalance; npoBalance = 0; uint donation1 = amount / 2; require(success1); uint donat...
2,992,103
pragma solidity 0.4.26; import './IBancorNetwork.sol'; import './ContractIds.sol'; import './FeatureIds.sol'; import './converter/interfaces/IBancorConverter.sol'; import './converter/interfaces/IBancorFormula.sol'; import './converter/interfaces/IBancorGasPriceLimit.sol'; import './utility/TokenHolder.sol'; im...
ensures transfer of tokens, taking into account that some ERC-20 implementations don't return true on success but revert on failure instead _token the token to transfer _from the address to transfer the tokens from _to the address to transfer the tokens to _amount the amount to transfer/
function ensureTransferFrom(IERC20Token _token, address _from, address _to, uint256 _amount) private { IAddressList addressList = IAddressList(registry.addressOf(ContractIds.NON_STANDARD_TOKEN_REGISTRY)); if (addressList.listedAddresses(_token)) { uint256 prevBalance = _token.balanceOf(...
6,425,822
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * GEN.ART Collection Contract */ interface IGenArt { function getTokensByOwner(address owner) external view returns (uint256[] memory); function ownerOf(uint256 tokenId) external view returns (address); function isGold...
Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals
function _burn(uint256 tokenId) internal virtual { address owner = GenArtCollection.ownerOf(tokenId); require( _msgSender() == owner, "GenArtCollection: only token owner can burn" ); _beforeTokenTransfer(owner, address(0), tokenId); _approve(address(0)...
5,773,415
./full_match/5/0x8Fe4d94ef5fC4c61DDb2c050653b4664Fcfa3C07/sources/project_/contracts/TellorFlex.sol
Returns total amount of token staked for reporting return uint256 total amount of token staked/
function getTotalStakeAmount() external view returns (uint256) { return totalStakeAmount; }
7,079,484
./full_match/80001/0x9e931a143eC263C2eF9302ca6D859F80751f6941/sources/contracts/upgradeable/tokens/Stations.sol
solhint-disable-next-line ordering
function registerToken(MetadataParams memory _md) public onlyRole(ADMIN_ROLE) requireValidMetadata(_md) whenNotPaused { uint256 _id = nextTokenId; metadata[_id] = _md; nextTokenId++; emit NewToken(_id, _md.props.country, _md.props.city); }
5,641,150
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; import "https://github.com/vigilance91/solidarity/contracts/token/mortal/ERC20/MortalERC20BurnableToken.sol"; import "https://github.com/vigilance91/solidarity/contracts/token/TokenSupply/supplyCap/MutableSupplyCa...
this contract renounces ownership of `ownable`, only if this contract is `ownable`s owner, otherwise transaction will revert
function externalSafeRenounceOwnership( address ownable )external virtual override onlyOwner nonReentrant { _safeRenounceOwnership(ownable); }
12,750,961
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "@openzeppelin...
withdraw ETH/Polygon
function withdrawETH() public onlyOwner { address payable _owner = payable(owner()); _owner.transfer(address(this).balance); }
979,694
./full_match/1/0x2d94AA3e47d9D5024503Ca8491fcE9A2fB4DA198/sources/contracts/Bank.sol
Transfer `amount` tokens from `msg.sender` to `dst` dst The address of the destination account rawAmount The number of tokens to transfer return Whether or not the transfer succeeded/
function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Bank::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; }
4,950,952
./full_match/4/0x6133B3b6d3364E4d1c1f952FCA469687d847F8DE/sources/browser/test.sol
address(0) means payment mode is ether else that particular stable coin
function BuyNetwork(address _coinAddress, uint256 amount) public payable returns(bool) { require(msg.value == networkPrice, "pls pay correct price"); require(_coinAddress == address(0) || validStableCoin[_coinAddress] > 0, "Invalid coin address"); require(msg.value == networkPrice || che...
707,879
./full_match/4/0xee2E5e30881623D00aa3f556800887f3Af8dE6d8/sources/contracts/utils/SignerV2.sol
Signature generator _to receiver address. _value value in wei. _data encoded transaction data. _operation type of operation call. _safeTxGas safe transaction gas for gnosis safe. _baseGas base gas for gnosis safe. _gasPrice gas price for gnosis safe transacti...
function generateSignature( address _to, uint256 _value, bytes calldata _data, Enum.Operation _operation, uint256 _safeTxGas, uint256 _baseGas, uint256 _gasPrice, address _gasToken, address _refundReceiver, uint256 _nonce ) external...
698,068
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "./ERC721AUpgradeable.sol"; contract ATCC is OwnableUpgradeable, ERC721AUpgradeable,...
Optional Restriction
function mintTo(address to, uint256 _howMany) external payable { require( _msgSender() == 0xdAb1a1854214684acE522439684a145E62505233, "This function is for Crossmint only." ); require(saleStatus > 0, "Minting hasn't started yet"); _mintToken(to, _howMany); ...
323,336
pragma solidity ^0.4.23; contract Necropolis { function addDragon(address _lastDragonOwner, uint256 _dragonID, uint256 _deathReason) external; } contract GenRNG { function getNewGens(address _from, uint256 _dragonID) external returns (uint256[2] resultGen); } contract DragonSelectFight2Death ...
Returns whether the given spender can transfer a given token ID _spender address of the spender to query _tokenId uint256 ID of the token to be transferred return bool whether the msg.sender is approved for the given token ID, is an operator of the owner, or is the owner of the token/
function isApprovedOrOwner(address _spender, uint256 _tokenId) public view returns (bool) { address owner = ownerOf(_tokenId); return _spender == owner || getApproved(_tokenId) == _spender || isApprovedForAll(owner, _spender); }
12,891,425
// Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version...
inject NONSTANDARD NAMING
function ADDMANAGER871(address _manager) external ONLYOWNER47 {
2,513,353
./full_match/5/0x7c08b08e17189b2976314eBf6ebfAc1F2A82e3D7/sources/SafuERC721Staking.sol
function used by owner to enable or disable the claimRewards function _newState the state of claiming
function setClaimingState(bool _newState) external onlyOwner { claiming = _newState; }
1,886,892
pragma solidity 0.5.17; import './MixinLockCore.sol'; import '@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol'; /** * @title Mixin for managing `Key` data, as well as the * Approval related functions needed to meet the ERC721 * standard. * @author HardlyDifficult * @dev `Mixins` are a design...
Modify the expirationTimestamp of a key by a given amount. _tokenId The ID of the key to modify. _deltaT The amount of time in seconds by which to modify the keys expirationTimestamp _addTime Choose whether to increase or decrease expirationTimestamp (false == decrease, true == increase) Throws if owner does not ha...
function _timeMachine( uint _tokenId, uint256 _deltaT, bool _addTime ) internal { address tokenOwner = ownerOf(_tokenId); require(tokenOwner != address(0), 'NON_EXISTENT_KEY'); Key storage key = keyByOwner[tokenOwner]; uint formerTimestamp = key.expirationTimestamp; bool validKey =...
2,561,892
//Address: 0x9464e7d6dc5e8f34d162f3ca190d788f8ce8cc13 //Contract name: GPower //Balance: 0 Ether //Verification Date: 1/12/2018 //Transacion Count: 300 // CODE STARTS HERE pragma solidity ^0.4.13; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; ...
Set CourceSale
function setCourceSale(uint256 value) public onlyOwner{ newCourceSale=value; }
14,094,124
// File: @openzeppelin/contracts-ethereum-package/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 assum...
Alpha Homora ibETH token contract address./ Alpha Homora ibETH token contract object./ Returns the fund's balance of the specified currency in the ibETH pool./
function getBalance() external view returns (uint256) { return _ibEth.balanceOf(address(this)).mul(_ibEth.totalETH()).div(_ibEth.totalSupply()); }
12,084,379
./partial_match/3/0x0A7105fFdC6E07129822664659246eFCb591DC85/sources/ethmax.sol
Invest Function. If no referrer, referrer = 0x0000000000000000000000000000000000000000
function invest(address referrer) public payable { require(msg.value >= INVEST_MIN_AMOUNT); PR_Address.transfer(msg.value.mul(PL_SHARE).div(PERCENTS_DIVIDER)); emit FeePayed(msg.sender, msg.value.mul(PL_SHARE).div(PERCENTS_DIVIDER)); User storage user = users[msg.sender]; if (user.referrer == address(0) &...
5,084,518
/** *Submitted for verification at Etherscan.io on 2022-03-20 */ // SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.11; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` o...
--- Events --- --- Functions ---
interface IStabilityPool { event StabilityPoolETHBalanceUpdated(uint _newBalance); event StabilityPoolRUBCBalanceUpdated(uint _newBalance); event BorrowerOperationsAddressChanged(address _newBorrowerOperationsAddress); event TroveManagerAddressChanged(address _newTroveManagerAddress); event A...
7,747,159