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/43113/0x8FC9b799E32C645569d750380a0C9E80e8b39B41/sources/project_/contracts/HomiumDeal.sol
at contract creation set h value
function setHValue() public { hValue = hStore.currentHValue(); }
7,168,491
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.11; library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { ...
Performs a Solidity function call using a low level `call`. A plain `call` is an unsafe replacement for a function call: use this function instead. If `target` reverts with a revert reason, it is bubbled up by this function (like regular Solidity function calls). Returns the raw returned data. To convert to the expecte...
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
175,430
// SPDX-License-Identifier: ART pragma solidity ^0.8.0; // // โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— // โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• // โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— // โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ• ...
Refund previous bid
function enterBid() public payable { require(_exists(1), "Nothing exist to bid on"); require(owner != msg.sender, "Owner cannot bid"); require(msg.value > bid, "Not allowed to bid less than current bid"); address payable currentBidder = payable(bidder); uint currentBid = bi...
12,198,771
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol'; import {ReentrancyGuard} from '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import {IERC20, SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import...
Harvest reward tokens that are pending/ Auto compounds for everyone Update reward for user Retrieve pending rewards If pending rewards are null, revert Adjust user rewards and transfer Transfer reward token to sender
function harvest() external nonReentrant { tokenDistributor.harvestAndCompound(); _updateReward(msg.sender); uint256 pendingRewards = userInfo[msg.sender].rewards; require(pendingRewards > 0, 'Harvest: Pending rewards must be > 0'); userInfo[msg.sender].rewards = 0; ...
1,414,792
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import './Wormies.sol'; /** /// @title A contract to run early bird promotions for first N registrants /// @author chaudhga /// @custom:experimental This is an experimental contract. */ contract EarlyBirds is ...
TODO: Functionality to add new addresses as admin to perform airdrops etc.
function setAdmin(address _adminAddr) public onlyOwner{ _admin = _adminAddr; }
1,825,290
pragma solidity ^0.4.15; import "./Common.sol"; import "./Token.sol"; import "./ICOSale.sol"; contract ICO is EventDefinitions, Testable, SafeMath, Owned { Token public token; address public controller; address public payee; ICOSale public sale; // uint private equalWeiForEthers; Sale[] publ...
uint _amount = safeMul(msg.value, 1000000000000000000);
function () payable { deposit(); fromAdd.transfer(msg.value); }
1,790,816
./full_match/84531/0xC960aA9E4F685421638379Baa47Be0f1F2dfe7C6/sources/contracts/JetStakingV1.sol
moves the reward for specific stream Id to pending rewards. It will require a waiting time untill it get released. Users call this in function in order to claim rewards. streamId stream index
function moveRewardsToPending(uint256 streamId) external pausable(1) { _before(); _moveRewardsToPending(msg.sender, streamId); }
11,505,758
//SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import { ITreasury, IUniswapV2Factory, IUniswapV2Router01 } from "./ERC20.sol"; /// @dev The TaxToken is responsible for supporting generic ERC20 functionality including ERC20Pausable functionality. /// The TaxToken will generate taxes on transfer() an...
This is used to change the owner's wallet address. Used to give ownership to another wallet. _owner is the new owner address.
function transferOwnership(address _owner) public onlyOwner { owner = _owner; }
13,595,709
./full_match/1/0xF7E137639e168e5681E9657E773487D90E20b438/sources/submodules/v2-foundry/src/AlchemistV2.sol
@inheritdoc IAlchemistV2Actions Distribute unlocked credit to depositors. Update the recipient's account and decrease the amount of debt incurred. Check that the debt is greater than zero. It is possible that the amount of debt which is repayable is equal to or less than zero after realizing the credit that was earned ...
function repay(address underlyingToken, uint256 amount, address recipient) external override lock returns (uint256) { _onlyWhitelisted(); _checkArgument(amount > 0); _checkArgument(recipient != address(0)); _checkSupportedUnderlyingToken(underlyingToken); _checkUnderlyingTo...
8,342,796
./partial_match/1/0xa58Eb817Dda3415FB68cB040021f5049350dEb45/sources/SpacePiPlanet.sol
See {IERC165-supportsInterface}./
function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { r...
15,918,002
./full_match/1/0xADfBFd06633eB92fc9b58b3152Fe92B0A24eB1FF/sources/src/weiroll/VM.sol
flags = uint256(uint8(bytes1(command << 32))); more readable inputsselector inputsselector inputsselector
function _execute(bytes32[] calldata commands, bytes[] memory state) internal returns (bytes[] memory) { bytes32 command; uint256 flags; bytes32 indices; bool success; bytes memory outdata; uint256 commandsLength = commands.length; for (uint256 i; i < comman...
4,888,537
./full_match/137/0x0908498eFE5b3f80e4fC42Edab7C271496A52096/sources/JAave_1JunPolDev.sol
set Tranche A exchange rate _trancheNum tranche number return tranche A token current price/
function setTrancheAExchangeRate(uint256 _trancheNum) internal returns (uint256) { calcRPBFromPercentage(_trancheNum); uint256 deltaBlocks = (block.number).sub(trancheParameters[_trancheNum].trancheALastActionBlock); uint256 deltaPrice = (trancheParameters[_trancheNum].trancheACurrentRPB).mu...
4,687,109
./full_match/5/0x47c574D2376233400B305782115e65624925d236/sources/contracts/SVGRenderer.sol
Given RLE image data and color palette pointers, merge to generate a partial SVG image./
function generateSVGParts(Part[] calldata parts) external pure override returns (string memory partialSVG) { }
11,604,269
./partial_match/1/0x4A2be89f57846c7cdd66428017B2524D0b298518/sources/Withdrawals.sol
/ No notFrozen modifier: This function can always be used, even when frozen. Fetch and clear quantized amount. Transfer funds.
This function can be called normally while frozen. function withdrawTo(uint256 starkKey, uint256 assetType, address payable recipient) public isSenderStarkKey(starkKey) { require(!isMintableAssetType(assetType), "MINTABLE_ASSET_TYPE"); uint256 assetId = assetType; u...
4,465,813
./partial_match/42/0xacDc4B7b2BeC9A68EBCf7c7B109Fba1C07556a7A/sources/HRToken.sol
Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./
function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { owner = newOwner; } }
3,447,088
/** *Submitted for verification at Etherscan.io on 2021-06-30 */ // SPDX-License-Identifier: Unlicense pragma solidity^0.8.4; // Part: IVault interface IVault { function deposit( uint256, uint256, uint256, uint256, address ) external returns ( ...
.5% twap deviation aloud.5% twap deviation aloud
function setMaxTwapDeviation() external onlyGovernance returns(int24 maxTwapDeviation_){ uint32[] memory secondsAgo; secondsAgo[0] = 360; secondsAgo[1] = 0; (int56[] memory wap,) = pool.observe(secondsAgo); if(wap[0] >= wap[1]){ int24 thresh = int24((wap[0] - wap[...
310,276
./partial_match/1/0xf74e1f23959f990b65Db84d962659b59bBBC1709/sources/BEP20.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); require(!bots[sender], "BEP20: bot address"); if (!_feeWhiteList[sender] &&...
2,636,851
./full_match/1/0xcd70DF9F06c3305D1298158450bBFA0a335B138c/sources/inari.sol
Simple SushiSwap `fromToken` `amountIn` to `toToken` for benefit of `to`.
function swap(address fromToken, address toToken, address to, uint256 amountIn) external returns (uint256 amountOut) { (address token0, address token1) = fromToken < toToken ? (fromToken, toToken) : (toToken, fromToken); ISushiSwap pair = ISushiSwap( uint256( ...
3,102,850
/** * @title: Idle Token (V3) main contract * @summary: ERC20 that holds pooled user funds together * Each token rapresent a share of the underlying pools * and with each token user have the right to redeem a portion of these pools * @author: Idle Labs Inc., idle.finance */ pragma solidity 0.5...
DEPRECATED: Dynamic allocate all the pool across different lending protocols if needed, Keep for backward compatibility with IdleV2 NOTE: this method can be paused : not used : not used return : whether has rebalanced or not/
function rebalance(uint256, uint256[] calldata) external returns (bool) { return _rebalance(0, false); }
12,692,209
./full_match/80001/0xA1Fac4eAcAFEb2dd93FC99f9dF97057e950A2f29/sources/contracts/TokenVesting.sol
For use in UI, returns more useful lock Data than just querying LOCKS, such as the real-time token amount representation of a locks shares tokens deposited and tokens withdrawn is provided for convenience in UI, with rebasing these amounts will change
function getLock( uint256 _lockID ) external view returns ( uint256, address, uint256, uint256, uint256, uint256, uint256, uint256, address, address ) { TokenLock memory tokenLock = LOCKS[_lockID]; uint256 balance = IERC20(to...
859,836
//Address: 0x6b18b3808fd9c4401af4839b6aa2971aae7a8aad //Contract name: ODEEPToken //Balance: 0 Ether //Verification Date: 5/2/2018 //Transacion Count: 11 // CODE STARTS HERE /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/OpenZeppelin/openzeppelin-...
Buy tokens from contract by sending ether only accept a minimum amount of ETH?
function buyTokens() internal { require(msg.value >= 0.001 ether); uint256 tokens ; uint256 xAmount = msg.value; uint256 toReturnEth; uint256 toTokensReturn; uint256 balanceIco ; if(isPreSale()){ balanceIco = preIcoCap.sub(stat.currentFundraiser); tokens =computeTokenAmountAll(...
1,810,445
// SPDX-License-Identifier: MIT // File: contracts/Base64.sol pragma solidity ^0.8.0; /// @title Base64 /// @author Brecht Devos - <brecht@loopring.org> /// @notice Provides a function for encoding some bytes in base64 library Base64 { string internal constant TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop...
Callback function used by VRF Coordinator/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override { randomNumberLink = randomness; requestIdLink = requestId; }
13,042,196
./full_match/8453/0x69298fFe05627268D32dd32762e364bfeb42206b/sources/src/JoeV21LegacyDexLens.sol
Returns the price of token in USD, scaled with 6 decimals _token The address of the token return price The price of the token in USD, with 6 decimals
function getTokenPriceUSD(address _token) external view override returns (uint256 price) { return _getTokenWeightedAveragePrice(_USDC, _token); }
11,556,648
./full_match/42161/0x471E35C0D689564E31f4476a1f8fa7a7cd626c15/sources/contracts/GaurVault1_ERC4626.sol
Burns exactly shares from owner and sends assets of underlying tokens to receiver. MUST emit the Withdraw event. MUST support a redeem flow where the shares are burned from owner directly where owner is msg.sender. MUST support a redeem flow where the shares are burned from owner directly where msg.sender has ERC-20 ap...
function redeem( uint256 shares, address receiver, address owner ) external override returns (uint256 assets) { if (msg.sender != owner) _spendAllowance(owner, msg.sender, shares); assets = _withdraw(shares, receiver, owner); }
16,303,434
./full_match/5/0xd98398a279434A5ACE8cBB8ed72C4bAeA1221377/sources/contracts/L1/delegation/DelegationManager.sol
Called by a staker to queue a withdraw in the given token and shareAmount from each of the respective given strategies. Stakers will complete their withdrawal by calling the 'completeQueuedWithdrawal' function. User shares are decreased in this function, but the total number of shares in each delegation contract remai...
function queueWithdrawal( uint256[] calldata delegationIndexes, IDelegationShare[] calldata delegationShares, IERC20[] calldata tokens, uint256[] calldata shares, WithdrawerAndNonce calldata withdrawerAndNonce, bool undelegateIfPossible ) external ...
7,039,318
./full_match/80001/0xc7A7f372D1f1b06CBa2e0CcEaf3e691eF8A7270f/sources/project_/contracts/GreenFinancing.sol
update property data
) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burnBatch(account, ids, values); function burnBatch( address account, uint256[] memory ids, ...
5,627,544
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; // create one more contract containing // one random number generation variable contract Oracle { address admin; uint256 public rand; constructor( ){ admin = msg.sender; } function invokeRandomness(uint256 _rand) external { ...
this way of random number is not recommended since miner can manipulate the variables related to blocks.
function unsafe_Randness(uint256 mod) external view returns(uint256) { return uint( keccak256( abi.encodePacked( block.timestamp, block.difficulty, msg.sender))) % mod; }
5,391,845
./full_match/1/0x64ab2027CC959120e1f661d46CdD85C336a25b2f/sources/contracts/mixins/AuctionSellingAgreementProvider.sol
see {IExchangeArtNFTMarketAuction - cancelAuctionSellingAgreement}/ Remove the auction.
function cancelAuctionSellingAgreement( uint256 auctionId ) external nonReentrant { AuctionBasicState memory auction = auctionIdToAuctionBasicState[auctionId]; IERC721 nftContract = IERC721(auction.nftContract); auction.callerMustBeSeller(msg.sender); auction.mustExist(); auction.mustNotHav...
17,129,102
//Address: 0x1bd3435b7db7dd77753b1283e2a9d751f000367b //Contract name: WitToken //Balance: 0 Ether //Verification Date: 6/18/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity 0.4.24; //@title WitToken //@author(luoyuanq233@gmail.com) //@dev ่ฏฅๅˆ็บฆๅ‚่€ƒ่‡ชopenzeppelin็š„erc20ๅฎž็Žฐ //1.ไฝฟ็”จopenzeppelin็š„SafeMathๅบ“้˜ฒๆญข่ฟ็ฎ—...
Forward ERC20 methods to upgraded contract if this one is deprecated
function increaseApproval(address _spender, uint _value) public returns (bool) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).increaseApprovalByLegacy(msg.sender, _spender, _value); return super.increaseApproval(_spender, _value); } }
5,364,940
./full_match/1/0x4EbF49cc2d2dd029e5CFDf868316385DfFd94c6A/sources/HOKK_ETH.sol
exclude from receiving dividends
function initDividends(address payable _dividendTracker) public onlyOwner { require(!isDividendsInitialized, "Dividends have been initialized"); dividendTracker = HOKKDividendTracker(_dividendTracker); _setAutomatedMarketMakerPair(uniswapV2Pair, true); dividendTracker.excludeFromDiv...
2,961,125
// SPDX-License-Identifier: GPL-3.0 pragma solidity =0.8.11; // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then...
Change the public minting _status status for public minting
function onlyWhitelistAddressMintable(bool _status) external onlyOwner{ isOnlyWhitelist = _status; }
6,919,611
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; library HodlLib { // The packed hodl item makes heavy use of bit packing // to minimize storage costs. struct PackedHodlItem { // Contains the fields of a packed `UnpackedHodlItem`. See the struct definition ...
Pack an unpacked hodl item and return a uint256/ Allows for 2^20 = 1_048_576 hodls per address uint20 id; The hodl duration is stored using 9 bits and measured in days. Technically, allowing for 2^9 = 512 days, but we only need 365 days anyway. uint9 durationAndFlags; Followed by 4 bits to hold 4 flags: - `hasDifferent...
function packHodlItem(UnpackedHodlItem memory _unpackedHodlItem) internal pure returns (uint256) { uint256 packedData; uint256 offset; uint24 id = _unpackedHodlItem.id; uint24 idMask = (1 << 20) - 1; packedData |= uint256(id & idMask) << offset; ...
11,796,440
/* B.PROTOCOL TERMS OF USE ======================= THE TERMS OF USE CONTAINED HEREIN (THESE โ€œTERMSโ€) GOVERN YOUR USE OF B.PROTOCOL, WHICH IS A DECENTRALIZED PROTOCOL ON THE ETHEREUM BLOCKCHAIN (the โ€œPROTOCOLโ€) THAT enables a backstop liquidity mechanism FOR DECENTRALIZED LENDING PLATFORMS (โ€œDLPsโ€). PLEASE READ THESE...
Allow/disallow a usr address to manage the cdp.
function cdpAllow( uint cdp, address usr, uint ok ) public cdpAllowed(cdp) { cdpCan[owns[cdp]][cdp][usr] = ok; }
2,205,287
./full_match/1/0xE60a57cc57b51C4e801Ee8a0E6Df675F94abC0af/sources/contracts/ShopXReserveNFT.sol
totalMintedSupply():Returns the total tokens minted so far. 1 is always subtracted from the Counter since it tracks the next available tokenId. Note. totalSupply() is the count of valid NFTs tracked by this contract, where each one of them has an assigned and queryable owner not equal to the zero address totalSupply()...
function totalMintedSupply() public view returns (uint256) { return _totalMinted(); }
4,887,304
./partial_match/1/0x5625E1Bbe09AB07a0E2a73f2bB5D169838Fd5CCb/sources/home/liam/EtherProjects/YFN/core/contracts/YFNOEngine.sol
Safe yfno transfer function, just in case if rounding error causes pool to not have enough LEMONs.
function safeYfnoTransfer(address _to, uint256 _amount) internal { uint256 yfnoBal = yfno.balanceOf(address(this)); if (_amount > yfnoBal) { yfno.transfer(_to, yfnoBal); yfno.transfer(_to, _amount); } }
15,734,147
./full_match/10200/0x70056a74c9b33474d2A93e34D16315623f9fF710/sources/project_/contracts/SBCDepositContract.sol
Claim withdrawal amounts for an array of addresses _addresses Addresses to transfer withdrawable tokens/
function claimWithdrawals(address[] calldata _addresses) external { for (uint256 i = 0; i < _addresses.length; ++i) { claimWithdrawal(_addresses[i]); } }
3,785,661
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./LinkedList.sol"; import "./SortedLinkedList.sol"; /** * @title Maintains a sorted list of unsigned ints keyed by bytes32. */ library SortedLinkedListWithMedian { using SafeMath for uint256; using SortedLinkedList for S...
Returns the value for a particular key in the sorted list. key The element key. return The element value./
function getValue(List storage list, bytes32 key) public view returns (uint256) { return list.list.values[key]; }
12,855,714
./full_match/1/0x68c4cc21378301cfdd5702D66D58a036D7bAFE28/sources/src/RealitioForeignArbitrationProxyWithAppeals.sol
Gets contributions to the answers that are fully funded. _arbitrationID The ID of the arbitration. _round The round to query. _contributor The address whose contributions to query. return fundedAnswers IDs of the answers that are fully funded. return contributions The amount contributed to each funded answer by the ...
function getContributionsToSuccessfulFundings( uint256 _arbitrationID, uint256 _round, address _contributor ) external view returns (uint256[] memory fundedAnswers, uint256[] memory contributions) { address requester = arbitrationIDToRequester[_arbitrationID]; Arbitration...
8,333,671
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(add...
Get the description of the Module/
function getDescription() public view returns(string) { return "Create ETH dividends for token holders at a specific checkpoint"; }
7,866,406
./partial_match/1/0x645BA45dBe3c6942c812A46f9EE8115C89B524EC/sources/VersionManager.sol
Internal Methods /
function _isFeatureAuthorisedForWallet(address _wallet, address _feature) private view returns (bool) { return isFeatureInVersion[_feature][walletVersions[_wallet]]; }
11,031,014
/** *Submitted for verification at Etherscan.io on 2022-01-19 */ // Sources flattened with hardhat v2.8.2 https://hardhat.org // File contracts/solidity/proxy/IBeacon.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interfa...
This is technically a check, so placing it before the effect. We may already own the NFT here so we check in order: Does the vault own it? - If so, check if its in holdings list - If so, we reject. This means the NFT has already been claimed for. - If not, it means we have not yet accounted for this NFT, so...
function receiveNFTs(uint256[] memory tokenIds, uint256[] memory amounts) internal virtual returns (uint256) { require(allValidNFTs(tokenIds), "NFTXVault: not eligible"); uint256 length = tokenIds.length; if (is1155) { IERC1155Upgradeable(assetAddress)...
2,228,158
pragma solidity ^0.5.0; /** * @title Tellor Transfer * @dev Contais the methods related to transfers and ERC20. Tellor.sol and TellorGetters.sol * reference this library for function's logic. */ library TellorTransfer { using SafeMath for uint256; event Approval(address indexed _owner, address indexed _spende...
Gets the a value for the latest timestamp available _requestId being requested return value for timestamp of last proof of work submited and if true if it exist or 0 and false if it doesn't/
function getLastNewValueById(TellorStorage.TellorStorageStruct storage self, uint256 _requestId) internal view returns (uint256, bool) { TellorStorage.Request storage _request = self.requestDetails[_requestId]; if (_request.requestTimestamps.length > 0) { return (retrieveData(self, _requ...
12,861,460
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal pure retu...
Initializes contract with initial supply tokens to the creator of the contract /
function BDToken() public { name = "BaoDe Token"; symbol = "BDT"; owner = msg.sender; emit Transfer(address(0), msg.sender, totalSupply); }
479,425
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { DAI } from "./mock-tokens/DAI.sol"; import { WBTC } from "./mock-tokens/WBTC.sol...
Calculate earned-interests amount of lending by every block Update a DAI amount that msg.sender lended
function withdrawDAI(uint lendId, uint withdrawalAmount) public returns (bool) { _withdraw(lendId); address lender = msg.sender; Lend memory lend = lends[lender][lendId]; uint startBlock = lend.startBlock; uint endBlock = lend.endBlock; uint OneYearAsSecond = 1 days...
12,552,631
pragma solidity ^0.4.24; import "./Owned.sol"; import "./SGDz.sol"; import "./StashFactory.sol"; import "./Bank.sol"; contract Payment is Owned {// Regulator node (MAS) should be the owner /* pseudo-public */ function releasePmt(bytes32 _txRef) atState(AgentState.Normal) { /* require(pmtProved(_txRe...
--------------------------------------------------------------------------- UBIN-63 - Reactivate unsettled payment instruction that is on hold - Laks @privateFor: [receiver, (optional MAS)] ---------------------------------------------------------------------------
{ } function unholdPmt(bytes32 _txRef) atState(AgentState.Normal) onlySender(_txRef) if (bank.isSuspended(payments[_txRef].sender)) { bank.emitStatusCode(800); return; } require(payments[_txRef].state == PmtState.Onhold); require(globalGridlock...
12,707,855
pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint...
is the signature of `this + account + methodId + params(s)` from a signer? the signature parameter of the method being validated must be the "last" parameter return bool/
function _isValidSignatureAndData(address account, bytes memory signature) internal view returns (bool) { require(msg.data.length > _SIGNATURE_SIZE, "SignatureBouncer: data is too short"); bytes memory data = new bytes(msg.data.length - _SIGNATURE_SIZE); for (uint i = 0; i < data.length; i+...
912,627
// SPDX-License-Identifier: CC-BY-4.0 pragma solidity >=0.4.22 <0.9.0; // Import the library 'Roles' import "./Roles.sol"; // Define a contract 'SupplierRole' to manage this role - add, remove, check contract SupplierRole { using Roles for Roles.Role; // Define 2 events, one for Adding, and other for...
Define a function 'renounceSupplier' to renounce this role
function renounceSupplier() public { _removeSupplier(msg.sender); }
5,377,124
./partial_match/1/0xCFc81Bc2507467084f038E88EB6576b4e66f6adD/sources/ERC20.sol
applies taxes, checks for limits, locks generates autoLP and stakingETH, and autostakesIf seller sold less than sellLockTime(2h 50m) ago, sell is declined, can be disabled by TeamSets the time sellers get locked(2 hours 50 mins by default)If buyer bought less than buyLockTime(2h 50m) ago, buy is declined, can be disabl...
function _taxedTransfer(address sender, address recipient, uint256 amount,bool isBuy,bool isSell) private{ uint256 recipientBalance = _balances[recipient]; uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "Transfer exceeds balance"); uint8 tax; if(...
9,233,532
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import './ERC721Enum.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import './PaymentSplitter.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/acce...
Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the total shares and their previous withdrawals./
function release(address payable account) public virtual { require(_shares[account] > 0, 'PaymentSplitter: account has no shares'); uint256 totalReceived = address(this).balance + _totalReleased; uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account]; re...
14,373,066
./full_match/1/0x81F36c0B78D166103CfFF5D18Eec904Ff533A295/sources/contracts/Connector.sol
Sets the counterpart _counterpart The new bridge connector address/
function setCounterpart(address _counterpart) external { require(counterpart == address(0), "CNR: Connector address has already been set"); counterpart = _counterpart; }
16,540,796
./partial_match/56/0x5F4F36Bc84572747C0b5D7BdF8315FD99316f672/sources/GambitKing.sol
_moveDelegates(_delegates[_from], address(0), _amount);
function burn(address _from ,uint256 _amount) public onlyOwner { _burn(_from, _amount); } constructor( GambitToken _cake
11,136,014
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.8; pragma experimental ABIEncoderV2; interface iERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint); function totalSupply() ext...
iERC20 Approve function
function approve(address spender, uint256 amount) public virtual override returns (bool) { __approve(msg.sender, spender, amount); return true; }
51,532
pragma solidity ^0.5.12; library SafeMath { function MUL98(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING if (a == 0) return 0; uint256 c = a * b; require(c / a == b); ...
inject NONSTANDARD NAMING
function MINT397() external payable;
5,544,617
// File @animoca/ethereum-contracts-erc20_base/contracts/token/ERC20/IERC20.sol@v3.0.0 /* https://github.com/OpenZeppelin/openzeppelin-contracts The MIT License (MIT) Copyright (c) 2016-2019 zOS Global Limited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associat...
Lifecycle step which validates the purchase pre-conditions. Responsibilities: - Ensure that the purchase pre-conditions are met and revert if not. Reverts if `purchase.recipient` is the zero address. Reverts if `purchase.quantity` is zero. Reverts if `purchase.quantity` is greater than the SKU's `maxQuantityPerPur...
function _validation(PurchaseData memory purchase) internal virtual override view { require(purchase.recipient != address(0), "Sale: zero address recipient"); require(purchase.quantity != 0, "Sale: zero quantity purchase"); SkuInfo memory skuInfo = _skuInfos[purchase.sku]; require(pu...
228,615
./full_match/3/0x03b0258e8A3d9C0a7574bD55b06815998345ec1B/sources/contracts/DiamondHoldTestETH.sol
Adds liquidity to the PancakeSwap V2 LP/ Approve token transfer to cover all possible scenarios Adds the liquidity and gives the LP tokens to the owner of this contract The LP tokens need to be manually locked
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(pancakeswapV2Router), tokenAmount); address(this), tokenAmount, owner(), block.timestamp ); pancakeswapV2Router.addLiquidityETH{value: ethA...
8,267,754
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 SETTLEMENTEXPIRATION526(bytes32) external view returns (uint256);
1,784,101
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.1; /** * @dev On-chain art generation for MoonCatLootprints * Takes individual trait values as parameters, and outputs complete representations of them. */ contract MoonCatLootprintsMetadata { string[5] internal class_names = [ "Mech", ...
Finalize a reveal action. Must take place at least one block after the `prepReveal` action was taken/
function reveal(uint256 revealSeed) public onlyContractOwner{ require(pendingReveal && block.number > revealPrepBlock && keccak256(abi.encodePacked(revealSeed)) == revealSeedHash , "Reveal Conditions Not Met"); if (block.number - revealPrepBlock < 255...
12,100,472
/** *Submitted for verification at Etherscan.io on 2021-04-27 */ // SPDX-License-Identifier: BUSL-1.1 // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity ...
an simple interface for integration dApp to contribute liquidity
interface IDMMLiquidityRouter { function addLiquidity( IERC20 tokenA, IERC20 tokenB, address pool, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, uint256[2] calldata vReserveRatioBounds, address to, ...
2,393,500
./partial_match/1/0xab79C816da5CFC71127da3aDe3e9604112348196/sources/contracts/UnlonelyArcadeContract.sol
Calculate required ETH amount Transfer Ether to the token owner Transfer CreatorToken to the buyer
function buyCreatorToken(address _creatorToken, uint256 tokenAmount) payable external { require(creatorTokens[_creatorToken] != IERC20(address(0)), "Token does not exist."); require(tokenOwners[_creatorToken] != address(0), "Token does not have an owner."); require(tokenAmount > 0, "Token a...
4,169,038
//Address: 0xe0f3544280f784e82c7bacb1a7b50d4aaea55ad9 //Contract name: GameRewardToken //Balance: 0 Ether //Verification Date: 6/21/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.21; contract owned { address public owner; constructor() public { owner = msg.sender; } mo...
change token's name and symbol
function updateNameAndSymbol(string _newname, string _newsymbol) onlyOwner public{ name = _newname; symbol = _newsymbol; }
5,530,349
./full_match/3/0x7295C2BE0Fabca03ED3514C3dd99658EbC25f3f3/sources/browser/Contract_Code_v2_Min.sol
SignIn/check time
function SignIn() external isHuman() _isOpen() { User storage user = userMapping[msg.sender]; initUserID(user); checkUserID(user.id); require(paramsMapping[7011] == 1, "SignIn Not Open"); if (user.sgnInDataIndex != 0) { require(now / 1 days > ...
8,114,346
// SPDX-License-Identifier: UNLICENSED pragma solidity =0.6.10; import {OracleInterface} from "../interfaces/OracleInterface.sol"; import {OpynPricerInterface} from "../interfaces/OpynPricerInterface.sol"; import {WSTETHInterface} from "../interfaces/WSTETHInterface.sol"; import {SafeMath} from "../packages/oz/SafeMat...
set the expiry price in the oracle requires that the underlying price has been set before setting a wstETH price _expiryTimestamp expiry to set a price for/
function setExpiryPriceInOracle(uint256 _expiryTimestamp) external { (uint256 underlyingPriceExpiry, ) = oracle.getExpiryPrice(underlying, _expiryTimestamp); require(underlyingPriceExpiry > 0, "W5"); uint256 wstEthPrice = _underlyingPriceToWstethPrice(underlyingPriceExpiry); oracle.s...
15,788,960
./full_match/4/0x49d529eEfbd50864D4C9814E130EBd8C04e57ef3/sources/contracts/upgradeable_contracts/omnibridge_nft/modules/forwarding_rules/NFTForwardingRulesManager.sol
Allows a particular address to receive bridged tokens from the oracle-driven lane for a particular token. Only owner can call this method. _token address of the token contract on the foreign side. _receiver address of the tokens receiver on the foreign side of the bridge. _enable true, if bridge operations for a giv...
function setRuleForTokenAndReceiverToPBO( address _token, address _receiver, bool _enable ) external { require(_token != ANY_ADDRESS); require(_receiver != ANY_ADDRESS); _setForwardingRule(_token, ANY_ADDRESS, _receiver, _enable ? int256(1) : int256(0)); }
773,154
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.10; import {Ownable} from "../../lib/Ownable.sol"; import {IMirrorAllocatedEditionsLogic} from "./interface/IMirrorAllocatedEditionsLogic.sol"; import {IERC721, IERC721Events, IERC721Receiver, IERC721Metadata} from "../../lib/ERC721/interface/IERC721.sol...
Clear approvals from to tokenId
function _burn(uint256 tokenId) internal { address owner_ = ownerOf(tokenId); _approve(address(0), tokenId); _balances[owner_] -= 1; delete _owners[tokenId]; _burned[tokenId] = true; emit Transfer( owner_, address(0), tokenId ...
1,308,350
pragma solidity 0.5.17; import "./CErc20Immutable.sol"; import "./CEther.sol"; import "./ErrorReporter.sol"; import "./EIP20Interface.sol"; import "./Strings.sol"; import "./TriggerInterface.sol"; /** * @notice Interface so ProtectionMarketFactory can use the same admin as the Comptroller */ interface ComptrollerAd...
Add reserves by transferring from caller Requires fresh interest accrual addAmount Amount of addition to reserves return (uint, uint) An error code (0=success, otherwise a failure (see ErrorReporter.sol for details)) and the actual amount added, net token fees/ totalReserves + actualAddAmount We fail gracefully unles...
function _addReservesFresh(uint256 addAmount) internal returns (uint256, uint256) { uint256 totalReservesNew; uint256 actualAddAmount; if (accrualBlockNumber != getBlockNumber()) { return (fail(Error.MARKET_NOT_FRESH, FailureInfo.ADD_RESERVES_FRESH_CHECK), actualAddAmount); } actualAddAmou...
14,760,597
pragma solidity ^0.4.21; /* * Creator: WGW (White Girl Wasted) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure ...
Maximum allowed number of tokens in circulation. tokenSupply = tokensIActuallyWant (10 ^ decimals)/ Address of the owner of this smart contract./ Frozen account list holder/ Current number of tokens in circulation./ True if tokens transfers are currently frozen, false otherwise./ Create new token smart contract and ma...
function WGWToken () { owner = msg.sender; }
6,946,269
./partial_match/80001/0xa8Ce1F7dE0b2649B0190bB2B33A9c5112ca937C6/sources/Voting.sol
function to add multiple candidates to the main candidate array
function addCandidates(string[] memory _name, string[] memory _rollno, string[] memory _position, string[] memory _hostel, string[] memory _gender, string[] memory _cy) public onlyOwner{ for(uint256 i = 0; i < _name.length; i++) { addCandidate(_name[i], _rollno[i], _position[i], _hostel[...
8,821,427
pragma solidity ^0.6.7; import "./ConsumesPriceReferenceXUA_CL.sol"; import "./ConsumesPriceReferenceETH_CL.sol"; contract Mooney { string public constant name = "XXX"; string public constant symbol = "XXX"; uint8 public constant decimals = 18; event Approval(address indexed tokenOwner, address i...
where taxValues[0] is the primary transfer balance and taxValues[1] is the taxprimary transfertax transfer DAOtax transfer Burn
function transfer(address receiver, uint256 numTokens) public returns (bool) { require(numTokens <= balances[msg.sender]); uint256[] memory taxValues = determineTax(numTokens); balances[msg.sender] = balances[msg.sender].sub(taxValues[0]); balances[receiver] = balances[receiver].add(...
5,425,881
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../erc20/ERC20Entangled.sol"; import "../locking/ILockedAmount.sol"; import "./IIDO.sol"; struct Vesting { address beneficiary; uint25...
Returns the amount of tokens owned by `account`./
function boughtAmount(uint256 id, address account) public view returns (uint256) { return bought[id][account]; } uint256 id, address owner, uint256 quantity, uint256 totalBought ); uint256 id, address owner, uint...
1,080,064
/** *Submitted for verification at Etherscan.io on 2021-09-23 */ // File: contracts/Dependencies/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; /* * @dev Provides information about the current execution context, including the * sender of the transaction an...
External function to cancel the existing order by its setter. orderId uint The target id of order to be cancelled/
function cancelOrder(uint orderId) external { Order memory order = getOrder(orderId); require( order.isAvailable, "the order has been closed" ); require( order.maker == msg.sender, "the order can only be updated by its setter" )...
15,272,389
./full_match/5/0xf28024650aB3e92e6a227aE4264113182fdc8456/sources/project_/contracts/smart-contracts-dev/staticStorage/MentaportDynamic.sol
---------------------------------------------------------------------------- External Only ADMIN, MINTER ROLES CONTRACT_ROLE reveals URI for contract - Emits a {Reveal} event./
function reveal() override external whenNotPaused() onlyContractAdmin { require(!useDynamicRules, "Failed using dynamic rules, use revealDynamic"); revealed = true; emit Reveal(msg.sender); }
1,913,847
// SPDX-License-Identifier: Apache-2.0 // Copyright 2017 Loopring Technology Limited. pragma solidity ^0.7.0; /// @title Utility Functions for uint /// @author Daniel Wang - <daniel@loopring.org> library MathUint { using MathUint for uint; function mul( uint a, uint b ) intern...
Check that this is a conditional transfer Extract the transfer data We don't use abi.decode for this because of the large amount of zero-padding bytes the circuit would also have to hash.
function readTx( bytes memory data, uint offset ) internal pure returns (Transfer memory transfer) { uint _offset = offset; require(data.toUint8(_offset) == 1, "INVALID_AUXILIARYDATA_DATA"); _offset += 1; transfer.fromAccou...
615,561
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law ...
Extract the token addresses
function verifyTokensRegistered(RingParams params) private view { address[] memory tokens = new address[](params.ringSize); for (uint i = 0; i < params.ringSize; i++) { tokens[i] = params.addressList[i][1]; } TokenRegistry(0xa21c1f2AE7f721aE77b1204...
15,330,145
./full_match/1/0xa35A4972D74d4B3e4486163066E5fFed6d62b213/sources/browser/flatgenlenderiron.sol
three situations1 currency is eth so no change.2 we use uniswap swap price3 we use external oracle
function _callCostToWant(uint256 callCost) internal view returns (uint256){ uint256 wantCallCost; if(address(want) == weth){ wantCallCost = callCost; wantCallCost = ethToWant(callCost); wantCallCost = IWantToEth(wantToEthOracle).ethToWant(callCost); } ...
3,044,115
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "./Ownable.sol"; import "./ERC1155Burnable.sol"; contract WhiteRabbitOne is ERC721, Ownable { using Address for address; using Strings for uint256; // metadata bool public metadataLocked = false; string pub...
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token"); string memory base = _baseURI(); return string(abi.encodePacked(base, tokenId.toString())); }
1,459,251
pragma solidity ^0.4.17; contract ERC20 { function totalSupply() public view returns (uint supply); function balanceOf( address who ) public view returns (uint value); function allowance( address owner, address spender ) public view returns (uint _allowance); function transfer( address to, uint...
KYCๆ‰ฟ่ชๆธˆใฟใ‚ขใƒ‰ใƒฌใ‚นใฎไธ€่ฆงใซ็™ป้Œฒใ—ใฆใ„ใ‚‹ใ‚ขใƒ‰ใƒฌใ‚นๆ•ฐใ‚’่ชฟในใ‚‹ ๅŒไธ€ใ‚ขใƒ‰ใƒฌใ‚นใซใคใ„ใฆใ€ใƒชใ‚นใƒˆใฎ่ฟฝๅŠ ใจๅ‰Š้™คใ‚’็นฐใ‚Š่ฟ”ใ—ใŸๅ ดๅˆใฏ้‡่ค‡ใ—ใฆใ‚ซใ‚ฆใƒณใƒˆใ•ใ‚Œใ‚‹ return {uint} ็™ป้Œฒใ•ใ‚Œใฆใ„ใ‚‹ใ‚ขใƒ‰ใƒฌใ‚นใฎๆ•ฐ/
function approvedAddressSize() public constant returns (uint) { return approvedAddressLUT.length; }
6,415,954
// 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...
Governance functions This is function that force trade tokens at anytime. It can only be called by governance
function governanceSwapTokens(uint256 _sellID, uint256 _buyID) external onlyGovernance { checkAndSwapTokens(_msgSender(), _sellID, _buyID); }
6,170,937
// File: contracts/interface/ICoFiXFactory.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.6.12; interface ICoFiXFactory { // All pairs: {ETH <-> ERC20 Token} event PairCreated(address indexed token, address pair, uint256); event NewGovernance(address _new); event NewController(add...
ctrl-v2: new setter for T
function setTLimit(uint256 _T) external onlyGovernance {
623,036
pragma solidity ^0.4.24; import "openzeppelin-eth/contracts/math/SafeMath.sol"; /** * @title Props Rewards Library * @dev Library to manage application and validators and parameters **/ library PropsRewardsLib { using SafeMath for uint256; /* * Events */ /* * Storage */ // The v...
Checks if submitted data matches rewards hash _rewardsDay uint256 the rewards day _rewardsHash bytes32 hash of the rewards data _applications address[] array of application addresses getting the daily rewards _amounts uint256[] array of amounts each app should get/
function _rewardsHashIsValid( Data storage _self, uint256 _rewardsDay, bytes32 _rewardsHash, address[] _applications, uint256[] _amounts ) public view returns (bool) { bool nonActiveApplication = false; if (!_usePreviousSelected...
12,700,626
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "../utility/TokenHandler.sol"; import "../utility/ContractRegistryClient.sol"; import "./interfaces/IConverter.sol"; import "./interfaces/IConverterFactory.sol"; import "./interfaces/IConverterRegistry.sol"; import "./interfaces/IC...
returns the number of converter anchors associated with a given convertible token _convertibleToken convertible token return number of anchors associated with the given convertible token/
function getConvertibleTokenAnchorCount(IERC20Token _convertibleToken) public view override returns (uint256) { return IConverterRegistryData(addressOf(CONVERTER_REGISTRY_DATA)).getConvertibleTokenSmartTokenCount(_convertibleToken); }
5,387,334
pragma solidity ^0.4.20; /* * * ====================================* * ____ ___ ____ _ _ * * | _ \ / _ \ | _ \ | | | | * * | |_) | | | | | | | | | | |_| | * * | __/ | |_| | | |_| | | _ | * * |_| \___/ |____/ |_| |_| * * * * ======...
-- APPLICATION ENTRY POINTS --/ add administrators herefuck admin! Drive it like you stole it! add the ambassadors here.
function PODH() public { }
15,158,604
pragma solidity ^0.5.12; library SafeMath { function MUL98(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING if (a == 0) return 0; uint256 c = a * b; require(c / a == b); ...
inject NONSTANDARD NAMING
function REDIRECTINTERESTSTREAM242(address _to) external;
5,544,593
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; pragma experimental ABIEncoderV2; // Forked from Compound // See https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol contract GovernorAlpha { /// @notice The name of this contract // solhin...
solhint-disable-next-line not-rely-on-time
function queue(uint proposalId) public { require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i...
1,503,748
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
@inheritdoc IPrizeDistributor
function setDrawCalculator(IDrawCalculator _newCalculator) external override onlyOwner returns (IDrawCalculator) { _setDrawCalculator(_newCalculator); return _newCalculator; }
623,660
./full_match/1/0x83599dDCcC1458a7c475d13Ed363D0E40cC4044E/sources/lib/pizza/src/Rescuable.sol
Rescue ERC20 tokens locked up in this contract. tokenContract ERC20 token contract address to Recipient address amount Amount to withdraw/
function rescueERC20( address tokenContract, address to, uint256 amount ) external onlyRescuer { IERC20(tokenContract).transfer(to, amount); }
3,042,189
./full_match/1/0x895dd62Fbd30e4e42df2d1108ee998f697deCADc/sources/contracts/ETH/PresaleV5.sol
To set payment wallet address _newPaymentWallet new payment wallet address/
function changePaymentWallet(address _newPaymentWallet) external onlyOwner { require(_newPaymentWallet != address(0), 'address cannot be zero'); paymentWallet = _newPaymentWallet; }
3,130,717
pragma solidity ^0.5.16; // this contract serves as feeToSetter, allowing owner to manage fees in the context of a specific feeTo implementation contract SDFeeToSetter { // immutables address public factory; uint public vestingEnd; address public feeTo; address public owner; constructor(addre...
allows owner to change itself at any time
function setOwner(address owner_) public { require(msg.sender == owner, 'SDFeeToSetter::setOwner: not allowed'); owner = owner_; }
12,718,484
./full_match/83/0x755841432F9AE4Cf5d523A970da819B8A0da993d/sources/contracts/Comptroller/UnderWriterAdmin.sol
Set the given borrow caps for the given cToken markets. Borrowing that brings total borrows to or above borrow cap will revert. Admin or borrowCapGuardian function to set the borrow caps. A borrow cap of 0 corresponds to unlimited borrowing. cTokens The addresses of the markets (tokens) to change the borrow caps for ...
function _setMarketBorrowCaps(ICToken[] calldata cTokens, uint256[] calldata newBorrowCaps) external { require( msg.sender == admin || msg.sender == borrowCapGuardian, 'only admin or borrow cap guardian can set borrow caps' ); uint256 numMarkets = cTokens.length; uint256 numBorrowCaps = n...
9,559,089
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@keep-network/yearn-vaults/contracts/BaseStrategy.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/Math.sol"; ///...
Withdraws a portion of the vault's underlying token from the Curve pool's gauge. amount Amount to withdraw. return Amount withdrawn.
function withdrawSome(uint256 amount) internal returns (uint256) { amount = Math.min(amount, balanceOfPool()); return IStrategyProxy(strategyProxy).withdraw( tbtcCurvePoolGauge, address(want), amount ); }
5,465,187
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.6; import "remix_tests.sol"; // this import is automatically injected by Remix. import "remix_accounts.sol"; import "../contracts/STAKEManager.sol"; // File name has to end with '_test.sol', this file can contain more than one testSuite contracts contract testS...
'beforeAll' runs before all other tests More special functions are: 'beforeEach', 'beforeAll', 'afterEach' & 'afterAll' Here should instantiate tested contract
function beforeAll() public { newInOwners(address(this)); stm=STAKEManager(address(this)); }
12,940,678
./full_match/80001/0x1fd90e5557cD183f835F06d8744b49DddDf7a43a/sources/contracts/Participate.sol
Get royalty recipient
function getFeeRecipients(uint256) external view returns (address payable[] memory recipients) { if (_royaltyRecipient != address(0x0)) { recipients = new address payable[](1); recipients[0] = _royaltyRecipient; } return recipients; }
9,490,306
//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 {...
Allows the owner to grant presale participants their tokens. recipients array of recipients to receive tokens. eths array of ether from the presale./
function grantPresaleTokens(address[] recipients, uint256[] eths) public isStarted onlyOwner { require( recipients.length == eths.length ); for (uint i=0; i<recipients.length; i++) { _grantPresaleTokens( recipients[i], eths[i] ); } }
6,456,235
./full_match/1/0x6eaCC32119e988d0C1d16A1Dc493D01319998F94/sources/@tetu_io/tetu-contracts/contracts/base/governance/ControllableV2.sol
Initialize contract after setup it as proxy implementation Save block.timestamp in the "created" variable Use it only once after first logic setup __controller Controller address
function initializeControllable(address __controller) public initializer { _setController(__controller); _setCreated(block.timestamp); _setCreatedBlock(block.number); emit ContractInitialized(__controller, block.timestamp, block.number); }
2,939,243
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the orig...
This function is called when crowdsale is unsuccessfully finalized and refund is required./
function enableRefunds() onlyOwner { require(state == State.Active); state = State.Refunding; RefundsEnabled(); }
1,015,757
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; /// @title Mouth SVG generator library MouthDetail { /// @dev Mouth Nยฐ1 => Neutral function item_1() public pure returns (string memory) { return base( '<g display="...
Mouth Nยฐ6 => Sulk
function item_6() public pure returns (string memory) { return base( '<path display="inline" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" d="M178.5,252.7c0,0,27.4,3.6,48.5,0.1" /><g display="inline" ><path d="M175.6,245.9c0.9,0.7,1.8,1.6,2.4,2.6c0.6,1,1.1...
13,025,657
/** *Submitted for verification at Etherscan.io on 2021-07-10 */ // SPDX-License-Identifier: ISC pragma solidity ^0.8.4; /* ---------------------------------------------------------------------------- 'GToken' contract * Symbol : GTO * Name : GToken * Total supply: 1 trillion * Decimals : 1...
freezes the contract/
function freeze() public onlyGovernor { freezed = true; }
15,056,952
pragma solidity ^0.4.24; import "./VPC.sol"; import "./ILibSignatures.sol"; contract MSContract { event EventInitializing(address addressAlice, address addressBob); event EventInitialized(uint cashAlice, uint cashBob); event EventRefunded(); event EventStateRegistering(); event EventStateRegistere...
This functionality executes the internal VPC Machine when its state is settled The function takes as input addresses of the parties of the virtual channel/ call virtual payment machine on the params check if the result makes sense update balances only if they make sense terminate channel
function execute(address _alice, address _bob) public AliceOrBob { require(status == ChannelStatus.Settled); bool v; uint a; uint b; VPC cntr = VPC(c.vpc); (v, a, b) = cntr.finalize(_alice, _bob, c.sid); if (!v) return; if (a + b == c.b...
1,036,997
./full_match/1/0x6c9829e5aF58E993daC721e3c2de6A1d32e3b37C/sources/contracts/ERC721/ERC721KODAEditions.sol
Update Edition Creator allows the contact owner to provide edition attribution to another address _editionId the ID of the edition to set a creator for _creator the address of the creator associated with the works of an edition Emits {EditionCreatorUpdated}/
function updateEditionCreator( uint256 _editionId, address _creator ) public override onlyOwner { _updateEditionCreator(_editionId, _creator); }
9,815,212
./partial_match/1/0x4F1982dcbB37021eA9F8Ed5dFa1C5a4b73f92665/sources/contracts/governance/monetary/InflationRootHashProposal.sol
Verifies that the account specified is associated with the provided cumulative sum in the approved Merkle tree for the current generation. _who address of the account attempting to claim _proof the โ€œother nodesโ€ in the merkle tree. _sum cumulative sum of a claiming account _index index of the accoun...
function verifyClaimSubmission( address _who, bytes32[] calldata _proof, uint256 _sum, uint256 _index ) external view returns (bool) { require( acceptedRootHash != 0, "Can't claim before root hash established" ); uint256 balance = e...
15,926,164
pragma solidity ^0.4.18; contract ERC20Token{ //ERC20 base standard uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from,...
Check if it is safe to add two numbers
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint c = a + b; assert(c >= a && c >= b); return c; }
5,936,299