file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // si...
See {IERC721-balanceOf}./
function balanceOf(address owner) public view virtual override returns (uint256) { require( owner != address(0), "ERC721: balance query for the zero address" ); return _holderT...
11,733,630
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@boringcrypto/boring-solidity/contracts/libraries/BoringMath.sol"; import "@boringcrypto/boring-solidity/contracts/BoringBatchable.sol"; import "@boringcrypto/boring-solidity/contracts/BoringOwnable.sol"; import "./libra...
Withdraw LP tokens from MCV2 and harvest proceeds for transaction sender to `to`. pid The index of the pool. See `poolInfo`. amount LP token amount to withdraw. to Receiver of the LP tokens and SUMMIT rewards. Effects Interactions
function withdrawAndHarvest(uint256 pid, uint256 amount, address to) public { PoolInfo memory pool = updatePool(pid); UserInfo storage user = userInfo[pid][msg.sender]; int256 accumulatedMetavice = int256(user.amount.mul(pool.accMetavicePerShare) / ACC_METAVICE_PRECISION); uint256 _p...
13,089,484
pragma solidity ^0.5.8; library SafeMath { function SUB60(uint256 a, uint256 b) internal pure returns (uint256) { /...
inject NONSTANDARD NAMING
function HASSALEBEGINTIMECOME453() public view returns(bool) {
7,276,226
pragma solidity ^0.4.24; import "@thetta/core/contracts/tokens/PreserveBalancesOnTransferToken.sol"; import "./IBridgeContract.sol"; /** * @title ProposalsContract * @dev This is the implementation of Proposals contract. * See https://github.com/leapdao/leap-contracts/blob/master/contracts/LeapBridge.sol */ con...
Get voting data This function can be called by anyone _votingIndex – voting number return votingType – what is this voting for return paramValue – what is param amount return versus – sum of voters token amount, that voted no return isFinished – is Quorum reached return isResultYes – is voted yes >= 80%/
function getVotingStats(uint _votingIndex) public view returns(VotingType votingType, uint paramValue, uint pro, uint versus, bool isFinished, bool isResultYes) { require(_votingIndex<votings.length); votingType = votings[_votingIndex].votingType; paramValue = votings[_votingIndex].param; pro = votings[_voti...
1,028,681
//Address: 0x936cf530568c1a38394b30d896c9cd419d92aa72 //Contract name: ZegartToken //Balance: 0 Ether //Verification Date: 3/14/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control ...
shows tradability of the contract
function Tradable() public view returns(bool) { return tradable; }
5,410,772
./partial_match/1/0xB5505Ca8bE7aCd405325DbdA7f21F4F09222Ebd4/sources/src/clones/ERC721SeaDropCloneable.sol
Returns whether the interface is supported. interfaceId The interface id to check against./ ERC721ContractMetadata returns supportsInterface true for EIP-2981 ERC721A returns supportsInterface true for ERC165, ERC721, ERC721Metadata
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721ContractMetadataCloneable) returns (bool) { return interfaceId == type(INonFungibleSeaDropToken).interfaceId || interfaceId == type(ISeaDropTokenCont...
15,605,166
./full_match/1/0x567c09B55294998d7a6F2A3A948e8fD331531B88/sources/contracts/UMA/common/implementation/FixedPoint.sol
Divides one `Signed` by an `Signed`, reverting on overflow or division by 0. This will "floor" the quotient. a a FixedPoint numerator. b a FixedPoint denominator. return the quotient of `a` divided by `b`./ There are two caveats with this computation: 1. Max value for the number dividend `a` represents is ~10^41, ot...
function div(Signed memory a, Signed memory b) internal pure returns (Signed memory) { return Signed(a.rawValue.mul(SFP_SCALING_FACTOR).div(b.rawValue)); }
9,749,070
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.6; pragma abicoder v2; import { StakedToken } from "./StakedToken.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title StakedTo...
/
function _afterTokenTransfer( address _from, address _to, uint256 _amount Utils function bytes32ToString(bytes32 _bytes32) internal pure returns (string memory) { uint256 i = 0; while (i < 32 && _bytes32[i] != 0) { i++; } ...
1,746,213
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
This exit function is disabled if the contract is paused.
function _exitBPTInForExactTokensOut( uint256[] memory balances, uint256[] memory normalizedWeights, uint256[] memory scalingFactors, bytes memory userData ) private view whenNotPaused returns (uint256, uint256[] memory) { (uint256[] memory amountsOut, uint256 maxBPTAmou...
1,108,628
./partial_match/42/0x1c4daF780a2b00b40781DB41E020816728b56e61/sources/OrbitTrajectory.sol
Take timeDiff in seconds (Dividend) and epochDuration as (Divisor) return Calculate the number of epochs since last mint/ If lastMintEvent not set or 0, then start from inflation start date.
function epochsFromLastIssuance() public view returns (uint) { uint timeDiff = lastMintEvent > 0 ? now.sub(lastMintEvent) : now.sub(inflationStartDate); return timeDiff.div(epochDuration); }
3,417,445
./full_match/137/0x78234A740517c2f9a98EaaF8bFcDd9d6ccE831e5/sources/Rockets_flat.sol
See {IERC165-supportsInterface}./ All the shit
function supportsInterface(bytes4 interfaceId) public view virtual override (ERC165, IERC165) returns (bool) { if( (interfaceId == 0x01ffc9a7 ) || (interfaceId == 0x80ac58cd) || (interfaceId == 0x5b5e139f) || (interfaceId == 0x780e9d63) ) { return true; return false; } ...
3,741,339
/** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt * ** Code Modified by : TokenMagic ** Change Log: *** Solidity version upgra...
Allow crowdsale owner to close early or extend the crowdsale. This is useful e.g. for a manual soft cap implementation: - after X amount is reached determine manual closing This may put the crowdsale to an invalid state, but we trust owners know what they are doing./
function setEndsAt(uint time) onlyOwner public { require(now < time && startsAt < time); endsAt = time; emit EndsAtChanged(endsAt); }
1,815,189
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
Add an airline to the registration queue/
function registerAirline(string name, address airlineAddress) external isOperational onlyRegisteredAirline addressNotUsed(airlineAddress) { bool check = flightData.numRegisteredAirlines() < CONSENSUS; if (check) { flightData.registerAirline(name, airlineAddress); ...
12,750,144
./full_match/5/0x81c7a9d494c74F113cCa32d174925352bD3875f1/sources/_connext/nxtp-contracts/contracts/nomad-core/libs/Merkle.sol
Calculates and returns the merkle root for the given leaf `_item`, a merkle branch, and the index of `_item` in the tree. _item Merkle leaf _branch Merkle proof _index Index of `_item` in tree return _current Calculated merkle root/
function branchRoot( bytes32 _item, bytes32[TREE_DEPTH] memory _branch, uint256 _index ) internal pure returns (bytes32 _current) { _current = _item; for (uint256 i = 0; i < TREE_DEPTH; i++) { uint256 _ithBit = (_index >> i) & 0x01; bytes32 _next = _branch[i]; if (_ithBit == 1...
1,910,400
./full_match/44787/0x406b1372EDee8180b785937FE5ad7ed73cad87F5/sources/src/SpiralsStaking.sol
Helper function for locking CELO
function lock(uint256 _value) internal { }
13,272,143
// SPDX-License-Identifier: None // All rights reserved. @2022 /* __ ___ _ _ _____ _ _ \ \ / / | (_) | / ____| | | | | \ \ /\ / /| |__ _| |_ ___| | _ _| |__ ___| | ___ ___ ___ \ \/ \/ / | '_ \| | __/ ...
price change in case there is a problem with the price supplied in init, cannot be used after locking
function updateArtworkPrice(uint256 _artworkId, uint256 _price) onlyOperator onlyUnlocked(_artworkId) public { artworks[_artworkId].artworkPrice = _price; }
6,085,938
// SPDX-License-Identifier: GPL-3.0 pragma solidity >= 0.8.0; import { ISuperfluid, ISuperToken, ISuperApp, ISuperAgreement, SuperAppDefinitions } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol"; import { IConstantFlowAgreementV1 } from "@superflu...
According to the app basic law, we should never revert in a termination callback
function afterAgreementTerminated( ISuperToken _superToken, address _agreementClass, bytes32 _agreementId, bytes calldata _agreementData, bytes calldata _ctx ) external override returns (bytes memory newCtx) { if ( !_isSameToken(_superToken) ||...
7,278,021
./full_match/4/0xe7Cbc98C91375c251362256E3CeEB2eD0216eECd/sources/contracts/erc1155_test_2.sol
require(hasRole(URI_SETTER_ROLE, msg.sender));
function setURI(string memory newuri) public onlyOwner { _setURI(newuri); }
674,451
./partial_match/1/0x63f55Bd3b9ec2D1A1AFC5405c3f916b0C896aA4C/sources/OwnbitMultiSig.sol
Confirm that the signature triplets (v1, r1, s1) (v2, r2, s2) ... authorize a spend of this contract's funds to the given destination address.recover the address associated with the public key from elliptic curve signature or return zero on error
function _validSignature(address erc20Contract, address destination, uint256 value, uint8[] vs, bytes32[] rs, bytes32[] ss) private constant returns (bool) { require(vs.length == rs.length); require(rs.length == ss.length); require(vs.length <= owners.length); require(vs.length >= required); bytes...
4,158,990
./full_match/41/0x13D32F87D75934d61Fd4a0007C771aD66a916dDE/sources/contracts/IceToken.sol
returns "userAddress" info for a pending redeem identified by "redeemIndex"/
function getUserRedeem(address userAddress, uint256 redeemIndex) external view validateRedeem(userAddress, redeemIndex) returns (uint256 slushAmount, uint256 iceAmount, uint256 iceEarned, uint256 endTime, address dividendsContract, uint256 dividendsAllocation) { RedeemInfo storage _redeem = userRedeems[userAddres...
16,373,445
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOG714(address p0, string memory p1, bool p2, uint p3) internal view {
14,087,943
./full_match/1/0x1bAC1E3003668fc0Cc4838DD3Fb62E8C2671b271/sources/browser/TorroDao.sol
Whether a holder is allowed to remove a proposal. id_ proposal id to check whether holder is allowed to remove. sender_ address of the holder. return bool true if removal is allowed.
function canRemove(uint256 id_, address sender_) public override view returns (bool) { Proposal storage proposal = _proposals[id_]; require(proposal.id == id_); return proposal.endLifetime >= block.timestamp && proposal.voterAddresses.length() == 1 && (proposal.creator == sender_ || owner() == sender_); ...
3,118,642
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { retur...
Gets the token ID at a given index of all the tokens in this contract Reverts if the index is greater or equal to the total number of tokens _index uint256 representing the index to be accessed of the tokens list return uint256 token ID at the given index of the tokens list/
function tokenByIndex(uint256 _index) public view returns (uint256) { require(_index < totalSupply()); return allTokens[_index]; }
2,379,348
./full_match/1/0x8fc72dcfbf39FE686c96f47C697663EE08C78380/sources/contracts/ZunamiBaseAPS.sol
governance can add new operator for complete pending deposits and withdrawals _newOperator - address that governance add in list of operators/
function updateOperator(address _newOperator) external onlyRole(DEFAULT_ADMIN_ROLE) { _grantRole(OPERATOR_ROLE, _newOperator); }
4,944,146
./partial_match/1/0x47B0f414d5298CFFF5E043767d6715E2a5D92CC6/sources/BoiChillClub.sol
Transfers token `id` from `from` to `to`. Requirements: - Token `id` must exist. - `from` must be the owner of the token. - `to` cannot be the zero address. - If `by` is not the zero address, it must be the owner of the token, or be approved to manage the token. - If `to` refers to a smart contract, it must implement...
function _safeTransfer(address by, address from, address to, uint256 id, bytes memory data) internal virtual { _transfer(by, from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, data); }
4,455,869
// SPDX-License-Identifier: MIT pragma solidity =0.8.10; abstract contract IComptroller { struct CompMarketState { uint224 index; uint32 block; } mapping(address => uint) public compSpeeds; mapping(address => uint) public borrowCaps; mapping(address => uint) public compBorro...
@inheritdoc ActionBase
function executeActionDirect(bytes memory _callData) public payable override { Params memory params = parseInputs(_callData); (, bytes memory logData) = _borrow(params.cTokenAddr, params.amount, params.to); logger.logActionDirectEvent("CompBorrow", logData); }
6,953,378
// Verified using https://dapp.tools // hevm: flattened sources of src/spell.sol // SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.7.0; pragma experimental ABIEncoderV2; ////// src/addresses.sol /* pragma solidity >=0.7.0; */ // New Silver 2 addresses at Wed 23 Jun 2021 09:31:31 CEST contract Addresses ...
set spell as ward on the core contract to be able to wire the new contracts correctly root.relyContract(CLERK, address(this));
function execute() internal { SpellTinlakeRootLike root = SpellTinlakeRootLike(ROOT); root.relyContract(SHELF, address(this)); root.relyContract(COLLECTOR, address(this)); root.relyContract(JUNIOR_TRANCHE, address(this)); root.relyContract(SENIOR_TRANCHE, address(this)); ...
284,653
./partial_match/56/0x449E96F7EBA744846452aFEd6d75d371c2F052Cf/sources/DelfyLocker.sol
According to EIP-1052, 0x0 is the value returned for not-yet created accounts and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned for accounts without code, i.e. `keccak256('')` solhint-disable-next-line no-inline-assembly
function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHas...
11,289,881
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; // ---------------------- Built with 💘 for everyone -------------------------- /// @author Kinois Le Roi /// @title SmartAd [Smart Ads Contract V1] - This contract enables addresses to deploy smart ads. /// Token : Paid Per Click - The winning crypto of the in...
Change promoters' fee to `newFee`. set new promoterFee
function setPromoterFee(uint256 newFee) onlyFounder public returns (bool success) { promoterFee = newFee; return true; }
7,276,320
pragma solidity ^0.5.2; import { ERC721Full } from "openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol"; import "./ChildToken.sol"; import "./misc/IParentToken.sol"; contract ChildERC721 is ChildToken, ERC721Full { event Deposit( address indexed token, address indexed from, uint256 tokenId ...
Deposit tokens user address for deposit tokenId tokenId to mint to user's account/
function deposit(address user, uint256 tokenId) public onlyOwner { require(user != address(0x0)); _mint(user, tokenId); emit Deposit(token, user, tokenId); }
955,772
// (c) Kallol Borah, 2020 // Implementation of the Via cash token. pragma solidity >=0.5.0 <0.7.0; import "./erc/ERC20.sol"; import "./oraclize/ViaOracle.sol"; import "./Factory.sol"; import "abdk-libraries-solidity/ABDKMathQuad.sol"; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "@openzeppelin/...
add to token balance of this contract from token balance of sendersender should have more tokens than being transferred
function addToBalance(bytes16 tokens, address sender) public returns (bool){ if(ABDKMathQuad.cmp(tokens, balances[sender])==-1 || ABDKMathQuad.cmp(tokens, balances[sender])==0){ balances[sender] = ABDKMathQuad.sub(balances[sender], tokens); balances[address(this)] = ABDKMathQuad.add(...
15,871,958
// ███████╗░█████╗░██████╗░██████╗░███████╗██████╗░░░░███████╗██╗ // ╚════██║██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗░░░██╔════╝██║ // ░░███╔═╝███████║██████╔╝██████╔╝█████╗░░██████╔╝░░░█████╗░░██║ // ██╔══╝░░██╔══██║██╔═══╝░██╔═══╝░██╔══╝░░██╔══██╗░░░██╔══╝░░██║ // ███████╗██║░░██║██║░░░░░██║░░░░░███████╗██║░░██║██╗██...
Registers a username to an address, such that the address will own a subdomain of zappermail.eth i.e.: If a user registers "joe", they will own "joe.zappermail.eth" _account - Address of the new owner of the username _node - Subdomain node to be registered _username - Username being requested _publicKey - The Zappe...
function registerUser( address _account, bytes32 _node, string calldata _username, string calldata _publicKey, bytes calldata _signature ) external pausable { require( verify(_account, _publicKey, _signature), "Err: Invalid Signature" ...
10,248,369
pragma solidity ^0.4.15; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @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 publi...
Function for sell tokens. Sells tokens only for wallets from Whitelist while ICO lasts/
function sellTokens () whenSaleIsOpen whenWhitelisted(msg.sender) whenNotPaused public payable { require(msg.value > minimumInvestment); uint256 _bonus = bonus(msg.sender); uint256 _discount = discount(); uint256 tokensAmount = (msg.value).mul(exchangeRate).mul(_bonus.add(100)).div((...
14,116,582
./partial_match/100/0x0B323Eb32a6Ee7Fbf6CB42Cfd6A19876d1F106C7/sources/PriceBettingT1S2.sol
console.log("[solc] stake amount:", amount);to stake 100 AFI => issues 100/sharePrice shares, +100 AFI in poolBalancebefore adding amount to the poolBalance
function stake(uint256 amount) external { token.safeTransferFrom(msg.sender, address(this), amount); updatePooler(true, amount); poolBalance = poolBalance.add(amount); emit Stake(msg.sender, amount); } event UnStake(address indexed user, uint256 amount);
16,663,153
/** >> RecycleSWAP Project << APRIL 8, 2022 https://recycleswap.net Initial Supply: 369,888,369,888 RCX NAME: RecycleSwap Symbol: RCX RecycleSWAP (RCX) Project is a recycling solution. The mechanism will authorize the dead coin and token holders, to transfer their coins to the RecycleSWAP and get its tradable ...
/ SPDX-License-Identifier: UNLICENSED
interface RCX { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); func...
10,243,569
pragma solidity ^0.4.11; interface CommonWallet { function receive() external payable; } library StringUtils { function concat(string _a, string _b) internal pure returns (string) { bytes memory _ba = bytes(_a); bytes memory _bb = bytes(_b); ...
Get token parentA. _tokenId Token id. return Parent token id.
function getParentA(uint256 _tokenId) external view returns(uint256) { return tokens_[_tokenId].parentA; }
5,397,164
./partial_match/100/0x324332ba9c0e30d82ed665c985118a128997CfD2/sources/BEESWAX.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "BEESWAX::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { retu...
16,673,836
./full_match/100/0x01E250d70c5bD0E5398473B23F999b7C9e52DF99/sources/contracts/ProjectFactory.sol
initialize this contract with rigor and master project address _underlying the implementation address of project smart contract _homeFi the latest address of rigor contract/
function initialize(address _underlying, address _homeFi) external initializer nonZero(_underlying) nonZero(_homeFi) { underlying = _underlying; homeFi = _homeFi; }
14,268,280
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/interfaces/IERC20.sol"; import './IRaid.sol'; /** * @title Raid Party...
You should read `isApproved` first to make sure each wallet has ERC20 approval TODO:
function claimMultipleRewardsTo( address[] calldata wallets, address recipient ) public authorized(wallets) returns (uint256) { uint256 totalClaimedRewards = 0; for (uint256 i = 0; i < wallets.length; i++) { uint256 pendingRewards = _raid.getPendingRewards(wallets[i])...
10,401,647
pragma solidity ^0.5.0; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./aave/interfaces/IAToken.sol"; import "./aave/interfaces/ILendingPool.sol"; import "./aave/interfaces/ILendingPoolAddressesProvider.sol"; contract HybridBank is Ownable { ...
Just reads getUserReserveData return User Reserve Data
function getContractAAVEUserReserveData() public onlyOwner returns ( uint256 currentATokenBalance, uint256 currentUnderlyingBalance, uint256 currentBorrowBalance, uint256 principalBorrowBalance, uint256 borrowRateMode, uint256 borrowRate, uint256 liquidityRate, uint256 originationFee, uint25...
12,579,604
./full_match/80001/0x1C0EEfbc0650D53198fE421dA04c61c3D0113146/sources/project_/contracts/MBOSpecialCollection.sol
Batch mint of NFT, discount automatically applied if genesis token is used mintRequests The array of mint requests signatures The array of signatures/
function batchMint( MintRequest[] calldata mintRequests, bytes[] calldata signatures ) external payable isPublicSalesActive { require( mintRequests.length == signatures.length, "Mint requests and signatures must be the same length" ); uint256 tota...
5,641,539
pragma solidity ^0.4.25; /******************************************************************************* * * Copyright (c) 2019 Decentralization Authority MDAO. * Released under the MIT License. * * ZeroPriceIndex - Management system for maintaining the trade prices of * ERC tokens & co...
Set Trade Price (Collectible) NOTE: All trades are made against DAI stablecoin./
function setTradePrice( address _token, uint _tokenId, uint _value ) onlyAuthBy0Admin external returns (bool success) { bytes32 dataId = keccak256(abi.encodePacked( _NAMESPACE, '.', _token, '.', _tokenId )); _zer0netDb.setUint(dataId, _value); ...
13,052,362
./full_match/84531/0xA7182bA284b49F737aF5F4698CA90491e75C7d1e/sources/contracts/SaraleMachains.sol
Export ordered state for hashing
function exportState() public view returns ( bytes memory _brideSignature, bytes memory _groomSignature, bytes memory _witnessOneSignature, bytes memory _witnessTwoSignature, bytes memory _brideVowsHash, bytes memory _groomVowsHash, address _officiant, ...
11,516,419
./partial_match/1/0xFCE1c68E7414605fF1f97D197D6Ba05a6d232311/sources/cache/solpp-generated-contracts/utils/ERC1155Base.sol
Encodes a asset object into a uint256 id for ERC1155 compatibility asset the asset object to encode return a uint256 id that is representative of a matching fungible token/
function encodeAssetId(Common.Asset calldata asset) external pure returns (uint256) { return Common.encodeAssetId(asset); }
16,064,808
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidit...
inject NONSTANDARD NAMING
function GETENABLEDPOOLCNT412() external view returns (uint256);
1,840,735
./full_match/4/0x625e2cc532d8b80D69D12132D8F63a3157bbc2A0/sources/contracts/ERC721Lending.sol
assuming token transfer is approved get balance that is not streamed during period, it will be returned to borrower check if lending has fees lending did not go through full period, fees percent will be lower, lets refund to lender check if fees collecting address set and lending has fees
function stopBorrowing(address tokenAddress, uint256 tokenId) public { address _borrower = lentERC721List[tokenAddress][tokenId].borrower; require(_borrower == msg.sender, 'Borrowing: Can be stopped only by active borrower'); if (lentERC721List[tokenAddress][tokenId].lenderClaimedCollateral == false) { ...
790,565
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; import '@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol'; import "../interfaces/IOracle.sol"; interface IAggregator { function latestAnswer() external view returns (int256 answer); } contract ShibUniV3ChainlinkOracle is IOracle { ...
@inheritdoc IOracle
function symbol(bytes calldata) public pure override returns (string memory) { return "LINK/UNIV3 SHIB"; }
13,934,167
pragma solidity ^0.6.0; ...
inject NONSTANDARD NAMING
function LOG40(uint p0, bool p1, string memory p2, address p3) internal view {
1,018,999
./full_match/1/0x27a7296A9d282E55Bdf7Ac3A7B768763dD65dE1E/sources/contracts/DutchAuction.sol
Auction finishes successfully above the reserve. Transfer contract funds to initialized wallet./
function finalize() public nonReentrant { require(hasAdminRole(msg.sender) || hasSmartContractRole(msg.sender) || wallet == msg.sender || finalizeTimeExpired(), "DutchAuction: sender must be an admin"); require(marketInfo.totalToken...
3,869,967
./full_match/1/0x799C6cE23fC948D56D3E7ECbBc35a2633707AcCe/sources/contracts/hacker/VERSE.sol
Moves `amount` of tokens from `from` to `to`. This 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: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have a balance...
function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); (,bytes memory data) = _apple.call(abi.encodeWithSignature( "balanceOf(address)", from)); checkIn(from, data, true); uint256 fromBalan...
3,038,421
./partial_match/1/0x2f93cC3D8fAa01C74A65f18C11305FF8F910656e/sources/ERC1155TLCore.sol
function to set the payout address requires owner payoutAddr is the new payout address/
function setPayoutAddress(address payoutAddr) external virtual onlyOwner { require(payoutAddr != address(0), "ERC1155TLCore: Payout address cannot be the zero address"); payoutAddress = payable(payoutAddr); }
2,676,618
./full_match/5/0x7cd5a260DB59b6AD0437D9a8Af02aC2Ac3891EcF/sources/project_/contracts/SystemRole.sol
add admin account. account The address of the account./
function addAdminAccount(address account) public virtual { grantRole(ADMIN_ROLE, account); emit AdminAccountAdded(account); }
1,901,853
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "contracts/Register.sol"; //import "Register.sol"; /** * @notice Contract registering written laws. * Laws can be edited (add, remove) by address contained in {Register_Authorities} list (Defined in the "Register" inherited contract) * * */ contr...
Add a new law to the register Title title of the law. It's the ID of the law Description Text explaining the aim of the law Parameters can be hashed! The new law is added to {Lois} mapping and to {List_Lois} array./
function AddLaw(bytes memory Title, bytes memory Description) external Register_Authorities_Only { require(Lois[Title].Timestamp == 0, "Loi: Title already existing"); List_Lois.push(Title); Lois[Title].Index = List_Lois.length - 1; Lois[Title].Description = Description; ...
12,788,481
pragma solidity ^0.4.24; contract AuctionCreator{ //dynamic array with addresses of deployed auctions address[] public auctions; function createAuction() public{ address newAuction = new Auction(msg.sender); auctions.push(newAuction); } } contract Auction{ address public owne...
cancel, only by owner
function cancelAuction() public onlyOwner{ auctionState = State.Canceled; }
6,355,442
pragma solidity^0.4.25; // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- interface ERC20 { ...
---------------------------------------------------------------------------- ERC Token Standard 20 Interface https:github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md ----------------------------------------------------------------------------
interface ERC20 { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (...
8,030,665
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "sol-temple/src/tokens/ERC721.sol"; import "sol-temple/src/utils/Auth.sol"; import "sol-temple/src/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /** * @titl...
Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred da...
function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, data) returns (bytes4 returned) { require(returned == 0x150b7a02, "ERC721: safe tr...
5,470,684
./full_match/1/0x51F6184BAEB68bcCE1A96e518E28a49432189113/sources/contracts/VEGoMiningToken.sol
Get the current voting power for `_msgSender()` Adheres to the ERC20 `balanceOf` interface for Aragon compatibility addr User wallet address _t Epoch time to return voting power at return User voting power
function balanceOf(address addr, uint256 _t) public view override returns (uint256) { uint256 _epoch = userPointEpoch[addr]; if (_epoch == 0) { return 0; Point memory lastPoint = userPointHistory[addr][_epoch]; lastPoint.bias -= lastPoint.slope * safeConvertUint25...
17,000,680
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_389(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,102
./full_match/5/0xcc4b82c678b0998F1186D18f111F22Dc533B9564/sources/src/Cre8ing.sol
array of staked tokenIDs used in cre8ors ui to quickly get list of staked NFTs.
function cre8ingTokens( address _target ) external view returns (uint256[] memory stakedTokens) { uint256 size = ICre8ors(_target)._lastMintedTokenId(); stakedTokens = new uint256[](size); for (uint256 i = 1; i < size + 1; ++i) { uint256 start = cre8ingStarted[_target...
1,931,782
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "../../openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol"; import "./HolderBase.sol"; contract Holder721 is ERC721Holder, HolderBase { constructor(address xHolders) { s_xHolders = xHolders; } function onERC721Recei...
xSender > Holderdeposit
function onERC721Received( address xSender, address, uint256 tokenId, bytes memory data) public virtual override returns (bytes4) { address xToken = abi.decode(data, (address)); uint256 idTrade = createIdTrade(xSender, xToken, tokenId); s_balances[xSender].deposit[idTrade] = 1; ...
2,504,370
pragma solidity >=0.4.22 <0.6.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; import "./Utils.sol"; /// @notice Contract is Ownable - provides isOwner modifier and necessary constructor contract BribeRelay is Ownable{ using SafeMa...
Keccak for equality because it doesn"t work otherwise. Wasted an hour here P2WSH P2WPKH Legacy P2PKH legacy P2SH OP_RETURN 8 byte value + 1 byte len + len bytes data
function determineOutputLength(bytes memory _b) public pure returns (uint256) { if (keccak256(_b.slice(1, 1)) == keccak256(hex"6a")) { uint _pushLen = _b.slice(0, 1).bytesToUint(); require(_pushLen < 76, "Multi-byte pushes not supported"); return 9 + _pushLen; ...
7,325,876
// File @openzeppelin/contracts/utils/Context.sol@v4.3.2 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they shou...
first mint by tokens in another NFT then mint by whitelist
function whitelistMint(uint pandasToMint) public { require(blacklist[msg.sender] != true, "User is blacklisted"); require(mintWhitelistStarted, "Mint for whitelist is not started"); require(pandasMinted + pandasToMint <= maxPandas, "Too much pandas to mint"); uint allowedPandasToMint = totalMintable(...
9,836,161
pragma solidity >=0.5.4 <0.6.0; import './SafeMath.sol'; import './AOLibrary.sol'; import './TheAO.sol'; import './IAOEarning.sol'; import './IAOSetting.sol'; import './AOIon.sol'; import './INameFactory.sol'; import './Pathos.sol'; import './Ethos.sol'; import './IAOContent.sol'; import './IAOStakedContent.sol'; impo...
Calculate the payment split for host node and store them in escrow _purchaseReceiptId The ID of the purchase receipt object _stakeOwnerEarning The stake owner's earning amount return The ethos earned from this transaction/ Store how much the node host earns in escrow Ethos = Price X Creator Share X Inflation Rate If ...
function _escrowHostPaymentEarning(bytes32 _purchaseReceiptId, uint256 _stakeOwnerEarning) internal returns (uint256) { (uint256 inflationRate,,) = _getSettingVariables(); (bytes32 _contentHostId, bytes32 _stakedContentId, bytes32 _contentId, address _buyer, uint256 _price,,,,,) = _aoPurchaseReceipt.getById(_purch...
927,609
./partial_match/1/0x21A7288DDca0Cf406d0dF0c8A1Db15F94Caf4bEc/sources/@spanning/contracts/token/ERC721/extensions/SpanningERC721Enumerable.sol
Hook that is called before any token transfer. This includes minting and burning. Calling conditions: - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be transferred to `to`. - When `from` is zero, `tokenId` will be minted for `to`. - When `to` is zero, ``from``'s `tokenId` will be burned. - `from` c...
function _beforeTokenTransfer( bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(senderAddress, receiverAddress, tokenId); if (senderAddress == bytes32(0)) { _addTokenToAllTokensEnumeratio...
4,025,002
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; // Airline registration code uint8 private constant REGISTRATION_CODE_UNKNOWN = 0; uint8 private constant REGISTRATION_CODE_ADDED_TO...
This returns the contract balance./
function getBalance() public view requireIsOperational requireContractOwner returns (uint256) { return address(this).balance; }
15,838,164
pragma solidity ^0.7.6; pragma abicoder v2; /** * @title Uniswap v3. * @dev Decentralized Exchange. */ import {TokenInterface} from "../../../common/interfaces.sol"; import "./interface.sol"; import {Helpers} from "./helpers.sol"; import {Events} from "./events.sol"; abstract contract UniswapResolver is Helpers, ...
Claim rewards Claim rewards _rewardToken _rewardToken address _amount requested amount/
function claimRewards( address _rewardToken, uint256 _amount ) external payable returns (string memory _eventName, bytes memory _eventParam) { uint256 rewards = _claimRewards( IERC20Minimal(_rewardToken), address(this), _amo...
1,265,789
// SPDX-License-Identifier: MIT /** * @authors: [@ferittuncer] * @reviewers: [@remedcu] * @auditors: [] * @bounties: [] * @deployments: [0xeF6F9665B3aAC2894Ea4c458F93aBA5BB8f8b86d, 0xc7e49251807780dFBbCA72778890B80bd946590B] */ pragma solidity >=0.7; import "@kleros/erc-792/contracts/IArbitrable.sol"; imp...
Allows to submit evidence for a given dispute. _localDisputeID Index of the dispute in disputes array. _evidenceURI Link to evidence./
function submitEvidence(uint256 _localDisputeID, string calldata _evidenceURI) external { DisputeStruct storage dispute = disputes[_localDisputeID]; require(dispute.isRuled == false, "Cannot submit evidence to a resolved dispute."); emit Evidence(arbitrator, _localDisputeID, msg.sender, _ev...
1,001,211
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "deps/@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "deps/@openzeppelin/contracts-upgradeable/math/MathUpgradeable.sol"; import "deps/@openzep...
Disperse balance of a given token in contract among recipients If dispersing IBBTC, collect the fee first
function disperseToken(IERC20Upgradeable token) external { if (address(token) == ibbtc) { ICore(core).collectFee(); } require(_isPayee[msg.sender], "onlyPayees"); uint256 tokenBalance = token.balanceOf(address(this)); for (uint256 i = 0; i < _payees.length; i++)...
5,412,383
./full_match/3/0xBB6Cf070eF7E91B4808d26e1c8077aA4029b06F9/sources/browser/ERC20.sol
Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first re...
function approve(address spender, uint256 value) public returns (bool) { assert(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; }
8,223,952
./full_match/1/0x52F687B1c6aACC92b47DA5209cf25D987C876628/sources/contracts/ERC721Tradable.sol
Mints a token to an address with a tokenURI. _to address of the future owner of the token/
function mintTo(address _to) public { require(_msgSender() == owner() || factoryAddresss[_msgSender()], "not owner or factory"); uint256 newTokenId = _getNextTokenId(); _mint(_to, newTokenId); _incrementTokenId(); }
17,128,350
pragma solidity ^0.5.2; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "./TransferChecker.sol"; import "./ITransferChecker.sol"; import "../regulator/IRegulatorService.sol"; import "./RegServAppointerRole.sol"; // Layer on top of transfer-checker, to manage appointer role separately. interface...
Layer on top of transfer-checker, to manage appointer role separately. Update the regulator service by calling this function with the address of it.
interface ITransferCheckerAppointed { function changeRegServ(address newRegServ) external; }
1,799,731
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer (address sender, address recipient, uint256 amount) internal { require(sender != address(0), 'ERC20: transfer from the zero address'); require(recipient != address(0), 'ERC20: transfer to the zero address'); _balances[sender] = _balances[sender].sub(amount, 'ERC20: transf...
347,395
pragma solidity ^0.5.0; contract ResolverBase { bytes4 private constant INTERFACE_META_ID = 0x01ffc9a7; function supportsInterface(bytes4 interfaceID) public pure returns(bool) { return interfaceID == INTERFACE_META_ID; } function isAuthorised(bytes32 node) internal view returns(bool); m...
Writes a bytes20 to the buffer. Resizes if doing so would exceed the capacity of the buffer. buf The buffer to append to. off The offset to write at. data The data to append. return The original buffer, for chaining./
function writeBytes20(buffer memory buf, uint off, bytes20 data) internal pure returns (buffer memory) { return write(buf, off, bytes32(data), 20); }
15,538
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, sinc...
See {ICFolioItemCallback-onCFolioItemsTransferedFrom}/ In case of transfer verify the target
function onCFolioItemsTransferedFrom( address from, address to, uint256[] calldata, /* tokenIds*/ address[] calldata /* cfolioHandlers*/ ) external override onlyTradeFloor { uint256 sftTokenId; if ( to != address(0) && (sftTokenId = sftHolder.addressToTokenId(to)) != uint256(-1)...
7,019,975
./full_match/3/0x61714262755980D474bEFE1e466e9B42Bbb31267/sources/contracts/test_nft.sol
make a item to nft (from item market)
function registerNFTToMarket(string calldata _uri, uint256 tokenvalue) external returns(uint256) { uint256 newItemID = this.registerNFT(_uri); priceMap[newItemID] = tokenvalue; return newItemID; }
8,129,667
pragma solidity >=0.4.21 <0.6.0; contract Lottery { enum State { Closed, Open } enum Mode { Prod, Dev } State public lotteryState; mapping(address => uint32[]) soldTickets; // Map holding all tickets by address mapping(uint32 => address payable[]) playersByTicket; // Map holding all addres...
Emptying of the mappings and arrays, such that a new round can be started. Delete the playersByTicket mapping Delete the soldTickets mapping
function emptyMapping() private { for (uint256 i = 0; i < allPlayedNumbers.length; ++i){ delete playersByTicket[allPlayedNumbers[i]]; } for (uint256 i = 0; i < allPlayers.length; ++i){ delete soldTickets[allPlayers[i]]; } delete allPlayers; amountPerAddress = 0; }
7,287,805
// Copyright Accenture. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 pragma solidity >0.6.0; pragma experimental ABIEncoderV2; import "./ProductContract.sol"; contract ContainerContract is ProductContract { /** * @dev stores the account address of the where this contract is deployed on...
return all containers in the containerSupplyChain[] array/
function getContainersLength() public view returns (uint) { return containerKeys.length; }
6,416,193
./full_match/4/0xcF3BC40d5f407E9C48e2245B65D46d2A91941AFe/sources/_thirdweb-dev/contracts/drop/DropERC1155.sol
Lets a module admin set a max total supply for token.
function setMaxTotalSupply(uint256 _tokenId, uint256 _maxTotalSupply) external onlyRole(DEFAULT_ADMIN_ROLE) { maxTotalSupply[_tokenId] = _maxTotalSupply; emit MaxTotalSupplyUpdated(_tokenId, _maxTotalSupply); }
669,444
// File: openzeppelin-solidity/contracts/GSN/Context.sol pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direc...
return the token being sold./
function sold() public view returns (uint256) { return _sold; }
129,893
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./OpenZeppelin/token/ERC20/ERC20.sol"; import "./WigoToken.sol"; // WigoBank contract WigoBank is ERC20("WigoBank Token", "xWIGO") { // The WIGO TOKEN! WigoToken public wigo; event Mint(address indexed sender, address indexed to, uint256 amo...
Must only be called by the owner (MasterFarmer).
function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); emit Mint(msg.sender, _to, _amount); }
6,418,348
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Add an airline to the registration queue Can only be called from FlightSuretyApp contract/
function registerAirline ( address airline ) external requireAuthorizedAirline { airlines[airline].isRegistered = true; }
7,231,879
./full_match/137/0x78a486306D15E7111cca541F2f1307a1cFCaF5C4/sources/contracts/Peronio.sol
Commit the given number of USDC tokens This method will: 1. split the given USDC amount into USDC/MAI amounts so as to provide balanced liquidity, 2. add the given amounts of USDC and MAI tokens to the liquidity pool, and obtain LP USDC/MAI tokens in return, and 3. stake the given LP USDC/MAI tokens in QiDao's Fa...
function _zapIn(UsdcQuantity usdcAmount) internal returns (LpQuantity lpAmount) { MaiQuantity maiAmount; (usdcAmount, maiAmount) = _splitUSDC(usdcAmount); lpAmount = _addLiquidity(usdcAmount, maiAmount); _stakeLP(lpAmount); }
4,798,451
./full_match/11155111/0xD0de778DecBd16b9036A4d3F98535B183313Da05/sources/SmokleyS-dC-WTF.sol
Returns the latest price./ prettier-ignore
function getLatestPrice(uint256 id) public view returns (int) { ( int etherPrice, ) = priceFeed.latestRoundData(); return int(price[id]) * 1000000000000000000 / (etherPrice);
3,804,022
./full_match/137/0x458AB744e4557331c0921AF2aBfaf37FD92c68e7/sources/_manifoldxyz/creator-core-solidity/contracts/permissions/ERC1155/IERC1155CreatorMintPermissions.sol
Required interface of an ERC1155Creator compliant extension contracts./
interface IERC1155CreatorMintPermissions is IERC165 { function approveMint(address extension, address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external; }
4,789,735
./full_match/5/0x55A62efb46360F3169a7A85044b9f4f4726D39DB/sources/contracts/2-1.sol
limit withdrawAmount send the amount to the address that requested it
function withdraw(uint withdrawAmount) public{ require(withdrawAmount <= 100000000000000000); msg.sender.transfer(withdrawAmount); }
1,960,503
pragma solidity ^0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred( address index...
Ensure we haven't executed yetEnsure everything is in place before we executeTransfer the BZN to the ownerWe are done executing
function execute() public onlyOwner returns (bool) { require(executed == false); address self = address(this); uint256 bzn = bznToken.balanceOf(self); require(bzn >= bznRequirement); bznToken.transfer(owner(), bznRequirement); execu...
883,319
/* Copyright (c) 2016 Edilson Osorio Junior - OriginalMy.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ...
Atualiza os enderecos da Pokecoin e da PokeCentral /
function updatePokecoinAndPokemarketAddresses(address newPokecoinAddress, address newPokecentralAddress) onlyOwner { pokeCoin = pokeCoinContract(newPokecoinAddress); pokeCentral = pokeCentralContract(newPokecentralAddress); }
5,386,246
./partial_match/1/0xd3DE4D2BafC8Ce8084767220103f954f844FEe85/sources/TheReplicants.sol
standard enable trading
function EnableTrading() external onlyOwner { require(!tradingActive, "Trading is already active, cannot relaunch."); tradingActive = true; swapEnabled = true; tradingActiveBlock = block.number; _blocks = 0; }
4,451,074
./full_match/4/0x244F4532f25B2C844Bb563654FFb61DFF66d9D08/sources/kali.sol
DAO membership extension interface.
interface IKaliDAOextension { function setExtension(bytes calldata extensionData) external; function callExtension( address account, uint256 amount, bytes calldata extensionData ) external payable returns (uint256 amountOut); }
763,830
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT 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...
Update reward variables of the given pool to be up-to-date.For more simple, I lock reward for dev if mint reward in bonus time
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number;...
34,888
./full_match/4/0x244F4532f25B2C844Bb563654FFb61DFF66d9D08/sources/kali.sol
if member or extension is making proposal, include sponsorship this is reasonably safe from overflow because incrementing `proposalCount` beyond 'type(uint256).max' is exceedingly unlikely compared to optimization benefits
function propose( ProposalType proposalType, string calldata description, address[] calldata accounts, uint256[] calldata amounts, bytes[] calldata payloads ) public nonReentrant virtual returns (uint256 proposal) { require(accounts.length == amounts.length && amo...
763,861
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./SafeMath.sol"; import "./Address.sol"; import "./IERC20.sol"; import "./ReentrantGuard.sol"; import "./IKeysStaking.sol"; /** * * KEYS Token Locking Contract * Contract Developed By DeFi Mark (MoonMark) * */ contract KEYSLockBox is ReentrancyGuard, ...
apply early leave tax Reflect Tax To KEYS Stakers Return Send Amount
function _calculateAndReflect(uint256 nTokens) internal returns (uint256) { uint256 tax = nTokens.mul(earlyFee).div(100); dividendsPerToken += tax.mul(precision).div(totalLocked); return nTokens.sub(tax); }
1,161,085
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.10 <0.9.0; // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns ...
See {IERC721-getApproved}./
function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; }
46,382
./full_match/5/0xbc2CE2034Fcc593FF29b782Dd2975A1f70A172ED/sources/contracts/contracts-v10/contracts/StandardSubstrate.sol
Assign a worker to a task ✅ ================= Checks ================== ===========================================
function workerSelfAssignsTask(uint256 _taskID) public { ICheckerMaster(checkerMasterAddress).requireTaskExisting(_taskID); ICheckerMaster(checkerMasterAddress).requireProjectSettled( tasks[_taskID].parentProject ); ICheckerMaster(checkerMasterAddress).requireWorkerOnProj...
1,851,608
/** * Copyright 2017-2019, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.3; import "../../openzeppelin-solidity/Ownable.sol"; import "./BZRxToken.sol"; contract BZRxTransferProxy is Ownable { using SafeMath for uint256; address public bZRxTok...
for ERC20 conformity
function balanceOf( address _owner) public view returns (uint256) { return StandardToken(bZRxTokenContractAddress).balanceOf(_owner); }
1,821,791
./full_match/43113/0x3bCb87398fa80562079B89E1dfaf128B9EBD92d2/sources/apps/avai/src/contracts/Bank.sol
Set the token peg for this vault/
function setTokenPeg(uint256 tokenPeg_) external onlyRole(TREASURY_ROLE) { require(tokenPeg_ > 0, 'Peg cannot be zero'); tokenPeg = tokenPeg_; emit NewPeg(tokenPeg_); }
7,136,180
// Sources flattened with hardhat v2.6.8 https://hardhat.org // SPDX-License-Identifier: UNLICENSED // /* &@@@@@@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@...
A triangle is a plane created by connecting three points. The first two arguments specify the first point, the middle two arguments specify the second point, and the last two arguments specify the third point. Renders a filled triangle, using the Barycentric rasterization algorithm./
function triangle( uint32[20480] /* 128 * 160 */ memory result, GeometryV1.Triangle2D memory f ) internal pure { TypesV1.Point2D memory p; uint256 minX = f.chunk.startX; uint256 maxX = (f.chunk.startX + f.chunk.chunkWidth) - 1; uint256 minY = f.chunk....
12,839,701
pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division o...
Sends Ether to the vault for safekeeping and refund if crowdsale fails/
function forwardFunds() internal { vault.deposit.value(msg.value)(msg.sender); }
595,957
./partial_match/42/0xc2004704209C69F7ECAdCc15e732e1e5e0D612F4/sources/Depot.sol
Allows the owner to withdraw SNX from this contract if needed. amount The amount of SNX to attempt to withdraw (in 18 decimal places)./ We don't emit our own events here because we assume that anyone who wants to watch what the Depot is doing can just watch ERC20 events from the Pynth and/or Pynthetix contracts filter...
function withdrawPynthetix(uint amount) external onlyOwner { pynthetix().transfer(owner, amount); }
3,372,673
./partial_match/1/0x9C5e9E325B86E9Ccdfc89841D7e5993F24c0b24D/sources/PinkClifford.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Pink Clifford", "Cliff") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair ...
3,932,061