file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/1/0x04aBEb82f41b318eAecbe0A46152F089DcB9Cfa4/sources/src/Gateways/MintGateway.sol
Calculate the hash signed by RenVM. This binds the payload hash, amount, recipient and nonce hash to the signature. Check that the signature hasn't been redeemed. If the signature fails verification, throw an error. `isValidSignature` must return an exact bytes4 value, to avoid a contract mistakingly returning a truthy...
function _mint( bytes32 pHash, uint256 amount, bytes32 nHash, bytes memory sig, address recipient ) internal returns (uint256) { bytes32 sigHash = RenVMHashes.calculateSigHash(pHash, amount, getSelectorHash(), recipient, nHash); require(!status(sigHash), ...
2,943,187
./partial_match/42/0x54DeFB5768f9ED0fC5C3c3e738F853C9A5994370/sources/CollateralManager.sol
Remove it from the the address set lib. remove the inverse mapping.
function removeShortableSynths(bytes32[] calldata synths) external onlyOwner { for (uint i = 0; i < synths.length; i++) { if (_shortableSynths.contains(synths[i])) { _shortableSynths.remove(synths[i]); bytes32 synthKey = _synth(synths[i]).currencyKey(); ...
3,334,187
./partial_match/42/0xF90BEFE0987d4d82742Fc180Db06456De351a996/sources/FlashLoanLiquidateWePiggy.sol
清算ETH && 赎回ETH计算清算的值调用清算方法赎回ETH
function _liquidateETHAndRepayETH(IPETH pTokenBorrow, IPETH pTokenCollateral, address borrower, uint repayAmount, address[] memory path, uint totalDebt) internal { address self = address(this); (,uint seized) = comptroller.liquidateCalculateSeizeTokens(address(pTokenBorrow), address(pTokenCollater...
8,900,749
/** * Testable/debuggable version of SnailToken.sol. * * (c) Takeshi Kodo, under the MIT License (MIT) */ pragma solidity ^0.5.8; import './dhelper.sol'; import './SnailToken.sol'; contract TestableSnailToken is SnailToken { // FIXME: TEST/DEBUG ONLY // BEGIN LOG event Log(string message); event ...
FIXME: TEST/DEBUG ONLY BEGIN TRACK
function trackTotalRates(uint256 _value, uint256 _timestamp) public returns (bool) { uint256 currentDay = _timestamp / DAY_IN_SECONDS; return _trackTotalRates(_value, currentDay); }
12,575,763
./partial_match/1/0x56Bd2ca9095A711fAd20892dB0aC4a23146aD238/sources/HomelessCard.sol
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 ...
function _checkOnERC721Received( address from_, address to_, uint256 tokenId_, bytes memory data_ ) private returns (bool) { if (to_.isContract()) { try IERC721Receiver(to_).onERC721Received(_msgSender(), from_, tokenId_, data_) returns (bytes...
9,392,155
./partial_match/56/0x0d8Ad2624EaA3A0789dc0611d091b085344EFC94/sources/EToken2.sol
Returns asset balance for current address of a particular holder. _holder holder address. _symbol asset symbol. return holder balance./
function balanceOf(address _holder, bytes32 _symbol) constant returns(uint) { uint holderId = getHolderId(_holder); return holders[holderId].addr == _holder ? _balanceOf(holderId, _symbol) : 0; }
11,327,694
./full_match/97/0x7304763DB812DDC2936C797521ae806ec39afb39/sources/BubbleMarketplace.sol
get the token sale price against token id _tokenId uint256 ID of the token _owner address of the token owner/
function getSalePrice(uint256 _tokenId, address _owner) external view returns (address, uint256) { return (saleInfo[_tokenId][_owner].seller, saleInfo[_tokenId][_owner].amount); }
5,040,508
./full_match/5/0x87F6eAa56609F0c1977bD3b48D2F35093f162513/sources/src/proxy/HoprStakingProxyForNetworkRegistry.sol
Owner adds/updates NFT type and rank to the list of eligibles NFTs in batch. nftTypes Array of type indexes of the eligible HoprBoost NFT nftRanks Array of HOPR boost rank, which is associated to the eligible NFT, in string[]/
function ownerBatchAddNftTypeAndRank(uint256[] calldata nftTypes, string[] calldata nftRanks) external onlyOwner { require( nftTypes.length == nftRanks.length, 'HoprStakingProxyForNetworkRegistry: ownerBatchAddNftTypeAndRank lengths mismatch' ); for (uint256 index = 0; index < nftTypes.length;...
1,951,386
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul // WARNING - `executeActionWithAtomicBatchCalls` has a `bytes[]` argument that // requires ABIEncoderV2. Exercise caution when calling that specific function. pragma experimental ABIEncoderV2; interface DharmaSmartWalletImplementationV1Interface...
This call is no longer supported./
function getBalances() external view returns ( uint256 daiBalance, uint256 usdcBalance, uint256 etherBalance, uint256 dDaiUnderlyingDaiBalance, uint256 dUsdcUnderlyingUsdcBalance, ) { revert("Deprecated."); }
2,135,531
/** *Submitted for verification at Etherscan.io on 2022-02-22 */ // File: @openzeppelin/contracts/utils/math/SafeMath.sol // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies o...
use it for giveaway and mint for yourself
function gift(uint256 _mintAmount, address destination) public onlyOwner { require(_mintAmount > 0, "need to mint at least 1 NFT"); uint256 supply = totalSupply(); require(supply + _mintAmount <= maxSupply, "max NFT limit exceeded"); _safeMint(destination, _mintAmount); }
2,068,687
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract UniqlyClaimingByAdmin is Ownable{ /// ----- VARIABLES ----- /// /// ...
Verify Owner require(!_isAddressesOwnerVerified[msg.sender], "Already verified");
function verifyOwner(string memory _claimersName, uint _nonce, bytes memory _signature) external{ require( verifySignForAuthOwner(msg.sender, _claimersName, _nonce, _signature), "Signature is not valid" ); require(!_isNonceRedeemed[_nonce], "Nonce redeemed"); ...
6,407,596
pragma solidity ^0.5.11; contract Box { uint public id; string public title; uint public openingTime; uint public numberOfNotes; address creator; mapping(address => bool) public voted; mapping(uint => string) notes; mapping(address => string) voterNote; constructor (uint _id, stri...
record the submition record the submited note
function submitNote(string memory note, address sender) public { require(!voted[sender], "You can't submit more than once"); require(now <= openingTime, "The box has already been opened"); voted[sender] = true; numberOfNotes++; notes[numberOfNotes] = note; voterNote...
12,884,454
./full_match/1/0x3dCA17feE19A6A3eA43526dF848ed0565165AFa2/sources/contracts/single.sol
Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals
function _burn(uint256 tokenId) internal virtual { address owner = BEP721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); ...
3,096,660
pragma solidity ^0.7.0; import "./Item.sol"; import "./Order.sol"; contract MarketPlace { // All available items at one place mapping(uint32=>uint32) items; uint32 itemsCounter; constructor() { this.itemsCounter = 0; this.ordersCounter = 0; } function insertItem(Item item) p...
All available items at one place
{ mapping(uint32=>uint32) items; uint32 itemsCounter; constructor() { this.itemsCounter = 0; this.ordersCounter = 0; } function insertItem(Item item) public { if(items[item.itemIdentifier]!=0) { require(msg.sender==items[item.itemIdentifier].owner,...
2,562,964
./partial_match/10/0xFAf8FD17D9840595845582fCB047DF13f006787d/sources/contracts/VotingEscrow.sol
increaseAmount called on managed tokens are treated as locked rewards
function _increaseAmountFor(uint256 _tokenId, uint256 _value, DepositType _depositType) internal { EscrowType _escrowType = escrowType[_tokenId]; if (_escrowType == EscrowType.LOCKED) revert NotManagedOrNormalNFT(); LockedBalance memory oldLocked = _locked[_tokenId]; if (_value == ...
3,532,344
pragma solidity ^0.4.23; pragma solidity ^0.4.23; pragma solidity ^0.4.23; pragma solidity ^0.4.23; /** * @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 { add...
Constructor creates a reference to the NFT ownership contract and verifies the owner cut is in the valid range. _coreAddress - address of a deployed contract implementing the Nonfungible Interface.
function setup(address _coreAddress, address _pluginsContract) public onlyOwner { CutieCoreInterface candidateContract = CutieCoreInterface(_coreAddress); require(candidateContract.isCutieCore()); coreContract = candidateContract; pluginsContract = _pluginsContract; }
229,309
pragma solidity 0.4.24; /** * @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...
Only contract owner can burns a specific amount of tokens that he owns. _value The amount of token to be burned./
function burn(uint256 _value) public onlyOwner { require(_value <= balances[owner]); balances[owner] = balances[owner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(owner, _value); emit Transfer(owner, address(0), _value); }
11,850,134
./partial_match/1/0x6afE6C37bF75f80D512b9D89C19EC0B346b09a8d/sources/RariFundController.sol
Sets the master beneficiary of interest fees. beneficiary The master beneficiary of fees on interest; i.e., the recipient of all fees on interest./
function setInterestFeeMasterBeneficiary(address beneficiary) external fundEnabled onlyOwner { require(beneficiary != address(0), "Master beneficiary cannot be the zero address."); _interestFeeMasterBeneficiary = beneficiary; }
2,629,329
pragma solidity 0.5.3; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there...
only collect if 1) there are tokens to collect 2) token is whitelisted 3) token has non-zero balance
function collectTokens(address token) public onlyDelegate nonReentrant { uint256 amountToCollect = IERC20(token).balanceOf(address(this)).sub(userTokenBalances[TOTAL][token]); require(amountToCollect > 0, 'no tokens to collect'); require(tokenWhitelist[token], 'token to collect must be white...
45,183
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4 <0.9.0; import '../../interfaces/IKeep3rHelper.sol'; import '../../interfaces/peripherals/IKeep3rParameters.sol'; import './Keep3rAccountance.sol'; import './Keep3rRoles.sol'; abstract contract Keep3rParameters is IKeep3rParameters, Keep3rAccountance, Keep3rRole...
@inheritdoc IKeep3rParameters
function setLiquidityMinimum(uint256 _liquidityMinimum) external override onlyGovernance { liquidityMinimum = _liquidityMinimum; emit LiquidityMinimumChange(_liquidityMinimum); }
1,770,114
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./UUPSUpgradeableMockUpgradeable.sol"; import "../../proxy/utils/Initializable.sol"; // This contract implements the pre-4.5 UUPS upgrade function with a rollback test. // It's used to test that newer UUPS contracts are considered valid upgrades by olde...
Initial upgrade and setup call Trigger rollback using upgradeTo from the new implementation Check rollback was effective Finally reset to the new implementation and log the upgrade
function _upgradeToAndCallSecureLegacyV1( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); __setImplementation(newImplementation); if (data.length > 0 || forceCall) { __functio...
13,042,028
//Address: 0x7e4d9a47477ea0ad97971595957d52cc0f58d991 //Contract name: ConflictResolution //Balance: 0 Ether //Verification Date: 3/31/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) public pure returns(uint...
Force end of game if player does not respond. Only possible after a time period. to give the player a chance to respond. _gameType Game type. _betNum Bet number. _betValue Bet value. _balance Current balance. _stake Player stake. _endInitiatedTime Time server initiated end. return New game session balance./ follo...
function serverForceGameEnd( uint8 _gameType, uint _betNum, uint _betValue, int _balance, uint _stake, uint _endInitiatedTime ) public view onlyValidBalance(_balance, _stake) returns(int) { require(_endInitiatedTime + SE...
2,519,608
pragma solidity ^0.5.0; import "./libraries/SafeMathM.sol"; import "./libraries/ZapStorage.sol"; import "./libraries/ZapDispute.sol"; import "./libraries/ZapStake.sol"; import "./libraries/ZapLibrary.sol"; import "./token/ZapToken.sol"; /** * @title Zap Oracle System * @dev Oracle contract where miners c...
This function approves a _spender an _amount of tokens to use _spender address _amount amount the spender is being approved for return true if spender appproved successfully/
function approve(address _spender, uint _amount) public returns (bool) { return token.approve(_spender, _amount); }
13,095,097
/** *Submitted for verification at Etherscan.io on 2020-01-30 */ // File: contracts/math/SafeMath.sol pragma solidity 0.5.12; /// @title SafeMath /// @dev Math operations with safety checks that throw on error library SafeMath { /// @dev Add two integers function add(uint a, uint b) internal pure returns ...
Investors can claim refunds here if crowdsale was unsuccessful
function distributeRefunds(address payable[] calldata _investors) external { for (uint i = 0; i < _investors.length; ++i) { refundInvestor(_investors[i]); } }
1,787,026
//Address: 0x8b548505babfd983fc45210499b44e340bb85d76 //Contract name: Hedgely //Balance: 0 Ether //Verification Date: 2/3/2018 //Transacion Count: 944 // CODE STARTS HERE pragma solidity ^0.4.19; // Hedgely - The Ethereum Inverted Market // radamosch@gmail.com // Contract based investment game /** * @title Ownab...
allocate syndicate shares up to the limit.
function allocateEarlyPlayerShare() internal { if (availableEarlyPlayerShares==0) return; availableEarlyPlayerShares--; members[msg.sender].numShares+=1; }
7,240,719
./full_match/137/0x52FB368692b6635104d6834D34EED024D4E6E94a/sources/contracts/WinPay.sol
Update the provider provider Unique provider Id wallet Provider's wallet
function updateProvider(bytes32 provider, address wallet) external onlyLive { if (msg.sender != providers[provider]) { revert NotAuthorized(); } providers[provider] = wallet; emit Provider(provider, wallet); }
3,777,071
/** * @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 of tokens owned by `account`. */ function balanceO...
Updates the goald token. Should never have to be called. / The DAO has been initialized, so carry over the new address.
function setGoaldToken(address newAddress) external { require( ); if (_owner == _goaldToken) { _owner = newAddress; } _goaldToken = newAddress; }
25,286
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; impo...
Set Tokens Info/
function setTokensInfo( uint256[] calldata _boxTokenPrices, address[] calldata _tokenAddrs ) external onlyRole(MANAGER_ROLE) { require( _boxTokenPrices.length == _tokenAddrs.length, "Tokens info length mismatch" ); boxTokenPrices = _boxTokenPrices;...
2,543,837
// SPDX-License-Identifier: MIT pragma solidity = 0.5.16; import "./Carpooling.sol"; import "./MetaVariable.sol"; contract CarpoolingFactory is metaVariables { address public admin; address[] public carpoolingAddress; uint64[] public carpoolingIds; // Service query to join the safe registry enum ...
A user ask the status's service in servicesSafeRegistryState
function getServiceSafeRegistry(address service) public view returns(SafeRegistryState) { return servicesSafeRegistryState[service]; }
5,490,192
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./access/AdminControl.sol"; import "./core/CreatorCore.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } /** * @d...
Core creator interface/ Royalty support for various other standards
interface ICreatorCore is IERC165 { event CreatorUpdated(uint256 indexed creatorId, address indexed creator); event RoyaltiesUpdated(uint256 indexed tokenId, address payable[] receivers, uint256[] basisPoints); event CreatorRoyaltiesUpdated(uint256 indexed creatorId, address payable[] receivers, uint256...
15,844,441
// SPDX-License-Identifier: MIT pragma solidity 0.7.3; import "@openzeppelin/contracts/token/ERC20/ERC20Snapshot.sol"; import "@openzeppelin/contracts/utils/Arrays.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; /** * @title ProofOfHumanity Interface * @dev See https://github.com/Proof-Of-Humanity/Proof-...
Returns true if the submission is registered and not expired. _submission The address of the submission. return Whether the submission is registered or not./
function isHuman(address _submission) public view returns (bool) { bool registered = proofOfHumanity.isRegistered(_submission); return registered; }
12,670,160
/* Copyright [2019] - [2021], PERSISTENCE TECHNOLOGIES PTE. LTD. and the pStake-smartContracts contributors SPDX-License-Identifier: Apache-2.0 */ pragma solidity >=0.7.0; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable...
Set 'minimum values', called from admin minDeposit: deposit minimum value minWithdraw: withdraw minimum value Emits a {SetMinimumValues} event with 'minimum value' set to withdraw./
function setMinimumValues(uint256 minDeposit, uint256 minWithdraw) public virtual override returns (bool success) { require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "TW3"); require(minDeposit >= 1, "TW4"); require(minWithdraw >= 1, "TW5"); _minDeposit = minDeposit; _minWithdraw = minWithdraw; em...
6,369,265
./full_match/80001/0xa6D83ffb971B9d7801491712bA4F84e17c834faA/sources/contracts/paymentProfile.sol
In case a user is supected, Owner could stop the withdrawl
function suspectUser(address _user) public onlyOwner { users[_user].verified = false; }
5,587,234
pragma solidity ^0.4.24; /** * Audited by VZ Chains (vzchains.com) * HashRushICO.sol creates the client's token for crowdsale and allows for subsequent token sales and minting of tokens * Crowdsale contracts edited from original contract code at https://www.ethereum.org/crowdsale#crowdfund-your-idea * Addition...
Function to mint tokens target The address that will receive the minted tokens. amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mintToken(address target, uint256 amount) onlyOwner public returns (bool) { require(amount > 0); require(totalSupply_.add(amount) <= fixedTotalSupply); uint256 addTokens = amount; balance[target] = balance[target].add(addTokens); totalSupply_ = totalSupply_.add(addTo...
14,075,567
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the on...
Updates the max amount allowed to transfer _maxTransfer The new max transfer rate
function setMaxTransfer(uint256 _maxTransfer) external onlyOwner() { require(_maxTransfer <= BPS_DENOMINATOR, "_maxTransfer cannot exceed BPS_DENOMINATOR"); emit MaxTransferChanged(maxTransfer, _maxTransfer); maxTransfer = _maxTransfer; }
1,419,945
./partial_match/42/0xbb085B58D5F5bDA0bEF47B5246913B60A1D17BfC/sources/DEFOEWFPools.sol
Deposits in the specified pool to startCheck Deposit amountCheck Pool
function deposit(uint256 _pid, uint256 _amount, address tokenAddress) external nonReentrant { PoolTemp memory temp; require(existingToken[tokenAddress], "Token not yet registered"); require(_amount > 0, "deposit something"); uint256 countPool = poolLists.length; require(_pid < countPool, "Not a valid Poo...
3,348,959
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Interface for permit /// @notice Interface used by DAI/CHAI for permit interface IERC20PermitAllowed { /// @notice Approve the spender to spend some tokens via the holder signature /// @dev This is the permit interface used by DAI...
Interface for permit Interface used by DAI/CHAI for permit
interface IERC20PermitAllowed { function permit( address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s ) external; pragma solidity >=0.5.0; }
2,496,979
pragma solidity ^0.4.24; library NameFilter { /** * @dev filters name strings * -converts uppercase to lower case. * -makes sure it does not start/end with a space * -makes sure it does not contain multiple spaces in a row * -cannot be only numbers * -cannot start with 0x * -res...
============================================================================== _ _ _|__|_ _ _ _ . (_|(/_ | | (/_| _\ . (for UI & viewing things on etherscan)=====_|======================================================================= return the price buyer will pay for next 1 individual key. -functionhas...
function getBuyPrice() public view returns(uint256) { uint256 _rID = rID_; uint256 _now = now; if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0))) return ( (ro...
516,463
/** *Submitted for verification at Etherscan.io on 2021-09-16 */ pragma solidity 0.8.6; pragma abicoder v2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by...
_nameArg Token name _symbolArg Token symbol _rewardsDistributorArg mStable Rewards Distributor _balRecipient contract that can redistribute the $BAL _priceCoefficient Initial pricing coefficient/
function initialize( bytes32 _nameArg, bytes32 _symbolArg, address _rewardsDistributorArg, address _balRecipient, uint256 _priceCoefficient ) external initializer { __StakedToken_init(_nameArg, _symbolArg, _rewardsDistributorArg); balRecipient = _balRecipi...
10,984,013
pragma solidity ^0.4.24; /* ******************** https://mobstreet.me/exchange ******************** * * * ███╗ ███╗ ██████╗ ██████╗ * ████╗ ████║██╔═══██╗██╔══██╗ * ██╔████╔██║██║ ██║██████╔╝ * ██║╚██╔╝██║██║ ██║██╔══██╗ ...
data setup no point in continuing execution if OP is a poor russian hacker prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world (or hackers) and yes we know that the safemath function automatically rules out the "greater then" equasion. we can't give people infinit...
{ uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, dividendFee_), 100); uint256 _referralBonus = SafeMath.div(_undividedDividends, 3); uint256 _fundPayout = SafeMath.div(SafeMath.mul(_incomingEthereum, fundFee_), 100); uint256 _dividends = SafeMath.sub(_undi...
6,846,173
./full_match/80001/0x73f2BD68540Dfb65db040D0Ecb3AfDEA552dA121/sources/node_modules/_sygnum/solidity-base-contracts/contracts/role/base/Operatorable.sol
INTERNAL FUNCTIONS /
function _setOperatorsContract(address _baseOperators) internal { if (_baseOperators == address(0)) revert OperatorableNewOperatorsZeroAddress(); operatorsInst = IBaseOperators(_baseOperators); emit OperatorsContractChanged(msg.sender, _baseOperators); }
5,563,266
pragma solidity 0.6.12; // SPDX-License-Identifier: BSD-3-Clause ...
inject NONSTANDARD NAMING
function TRANSFER674(address, uint) external returns (bool);
5,406,034
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; import "./libraries/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface IToken { function transferFrom(address ...
See {IERC721Enumerable-tokenByIndex}. This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case./ Counter overflow is impossible as the loop breaks when uint256 i is equal to anot...
function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity function tokenByIndex(uint256 index) public view ...
9,988,938
./partial_match/4/0x648806f7735fce321f0a643aC59460a22f5088fF/sources/Contract.sol
Добавление нового голосвания/
function addBallot(uint start, uint end, bytes32[] memory names) public { require( msg.sender == adminestrator, "Only adminestrator can add ballot." ); Ballot memory newBallot; newBallot.startTime = start; newBallot.endTime = end; newB...
8,753,386
pragma solidity 0.7.5; /** * @dev Worldwide OpenBazaar Resource Finder Naming Service(WorfNS) * A simple naming service to register handles on FCFS basis */ contract WNS { event NewHandle(string handle, bytes data, address indexed owner); event NewDisplayName(string handle, string displayName); event Ne...
Method to remove handleS handle Handle to be removed/
function removeHandle( string calldata handle ) external handleExists(handle) onlyHandleOwner(handle) { delete handleNameHashVsHandle[keccak256(abi.encodePacked(handle))]; emit HandleRemoved(handle); }
515,882
pragma solidity ^0.4.18; import { AbsKYCCertifier } from "./AbsKYCCertifier.sol"; import { AbsKYCProject } from "./AbsKYCProject.sol"; import { SafeMath } from "./SafeMath.sol"; import { MultiCertifier } from "./MultiCertifier.sol"; import { Freezable } from "./Freezable.sol"; /* * Copyright (C) 2017-2018 DRI * *...
getCertifier return primary certifier if who has been certified. getCertifier is called by anyone.
function getCertifier(address _who) public view returns (address) { if (whitelists[primaryCertifier][_who]) { return primaryCertifier; } return 0x0; }
981,989
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol
Reads the int224 at `cdPtr` in calldata.
function readInt224( CalldataPointer cdPtr ) internal pure returns (int224 value) { assembly ("memory-safe") { value := calldataload(cdPtr) } }
8,451,789
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import { iOVM_SequencerFeeVault } from "./iOVM_SequencerFeeVault.sol"; import { Lib_PredeployAddresses } from "../../libraries/constants/Lib_PredeployAddresses.sol"; /** * @title OVM_DeployerWhitelist * @dev The Deployer Whitelist is a temporary predeploy used...
Adds or removes an address from the deployment whitelist. _deployer Address to update permissions for. _isWhitelisted Whether or not the address is whitelisted./
function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external onlyOwner { whitelist[_deployer] = _isWhitelisted; allowArbitraryDeployment = false; emit WhitelistStatusChanged(_deployer, _isWhitelisted); }
1,088,137
./full_match/5/0x26368dAD2a0D48178dB82624b6D5a1ac9f3b4C07/sources/contracts/staking/StakingContract.sol
return _distributedTokens the total amount of ERC20 Tokens distributed as rewards for the set staking period
function getRewardForDuration() external view returns (uint256 _distributedTokens) { return rewardRate * rewardsDuration; }
1,853,865
pragma solidity ^0.4.0; import "Mortal.sol" import "Owned.sol" contract LetterOfCredit is Owned, Mortal { //State Machine, stages in the LoC enum Stages { LOCApplicationStart, ImporterBankApproval, ExporterBankApproval, Shipment, ReviewDocuments, ImporterReviewDo...
Bank did not approve, return to shipment stage so the exporter can add the corrected documents. transitionNext will trasition to Shipment stageAt this point the bank and exporter can withdraw their funds
function approveShipmentByImporterBank(bool _isApproved) onlyBy(importerBank) atStage(Stages.ImporterReviewDocuments) transitionNext external{ if (!_isApproved) { stage = Stages.ExporterBankApproval; changeOwner(importer); ReviewDocuments(importer); ShipmentFi...
12,628,081
./partial_match/80001/0x7C682dd6E5d569C2e38EA148032098B839B11c9F/sources/contracts/libraries/TickManagement.sol
Removes tick from the linked list self The mapping containing all tick information for initialized ticks tick The tick that will be removed return prevTick The previous active tick before _tick_ return nextTick The next active tick after _tick_ MIN_TICK and MAX_TICK cannot be removed from tick list
function removeTick(mapping(int24 => Tick) storage self, int24 tick) internal returns (int24 prevTick, int24 nextTick) { (prevTick, nextTick) = (self[tick].prevTick, self[tick].nextTick); delete self[tick]; if (tick == TickMath.MIN_TICK || tick == TickMath.MAX_TICK) { (self[tick].prevTick, self[tic...
8,801,400
//Address: 0x2828d5ae572a3e87febad75323af24ec0a4f2eef //Contract name: CryptoPlanets //Balance: 0.001553745 Ether //Verification Date: 3/6/2018 //Transacion Count: 23 // CODE STARTS HERE pragma solidity ^0.4.18; /* Game Name: CryptoPlanets Game Link: https://cryptoplanets.com/ Rules: - Acquire planets - Steal reso...
Initiate functions that will create the planets
function InitiatePlanets() public onlyCeo { require(planetsAreInitiated == false); createPlanet("Blue Lagoon", 100000000000000000); createPlanet("GreenPeace", 100000000000000000); createPlanet("Medusa", 100000000000000000); createPlanet("O'Ranger", 100000000000000000); ...
1,063,833
./partial_match/1/0x9CdaFB9FAe77E7C1bd7CF28C389008ca8daCF48c/sources/LiquidiyMoney.sol
Add liquidity to uni
function swapAndLiquify(uint256 tokens) private { uint256 toSwapForLiq = ((tokens * taxes.liquidity) / tax) / 2; uint256 tokensToAddLiquidityWith = ((tokens * taxes.liquidity) / tax) / 2; uint256 toSwapForDev = (tokens * taxes.dev) / tax; uint256 toStakingPool = (tokens *...
4,070,760
// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT // pragma solidity >=0.6.0 <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 totalSupp...
Swap tokenA<>tokenB, ETH<>sETH or sETH<>ETH on CureFi. path -> [from, to] amounts -> [amount, expected] addresses -> [pool] function exchange( address _pool, Pool address, could able to get from address _from, From token address address _to, To token address uint256 _amount, ...
function execute( address[] calldata path, uint[] calldata amounts, address[] calldata addresses, string[] calldata data ) external payable returns(bool) { if( path[0] != ETH && IERC20(path[0]).allowance(address(this), CurveFiSwap) < amounts[0] ) { Helper.safeApprove(path[...
6,318,452
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; // import "./Ownable.sol"; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; contract PayFor is Ownable { struct productPriceStruct { uint256 price; bool isValue; } struct paymentsStruct { address listOfPayedBy; uint256 listOfPaym...
return the price for the nth SKU and its product number./
function getSKUInfo(uint256 n) public view returns(uint256, uint256) { require(n >= 0 && n < listOfSKU.length, 'Invalid entry'); uint256 sku = listOfSKU[n]; return ( sku, productMinPrice[sku].price ); }
6,364,695
// SPDX-License-Identifier: MIT pragma solidity >=0.7.2; pragma experimental ABIEncoderV2; import { SafeMath } from '@openzeppelin/contracts/math/SafeMath.sol'; import { IERC20 } from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import { SafeERC20 } from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; impor...
wait for the owner to set the next option
function _setActionIdle() internal { onlyActivated(); state = ActionState.Idle; }
29,697
/** *Submitted for verification at Etherscan.io on 2022-02-18 */ // Dependency file: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) // pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, includ...
bytes4(keccak256(bytes('transfer(address,uint256)')));
function _sendErc20(address tokenAddress, uint256 amount, address to) private { (bool success, bytes memory data) = tokenAddress.call(abi.encodeWithSelector(0xa9059cbb, to, amount)); require(success && (data.length == 0 || abi.decode(data, (bool))), "RecoverableByOwner: ERC20_TRANSFER_FAILED"); ...
10,900,135
./full_match/421613/0xb83dd4e498849aBACa9fb084ad0d16ab83F4A6D1/sources/src/Games/Race.sol
call endRace function (if needed) If ERC20, transfer the tokens
function enterRace( uint256 _raceId, uint256 _tokenId ) external payable whenNotPaused nonReentrant { require(nftManager.getOwnerOf(_tokenId) == msg.sender, "not owner"); require( nftManager.isNftTransferable(_tokenId), "not in a transferable state" ...
11,572,095
./partial_match/1/0xDA2686fd32C6b74d55605CfB48bef331771e7Fc6/sources/contracts/CompassLifetimePass.sol
Check if minting is enabled/
function isMintEnabled() external view returns (bool) { return _isMintEnabled; }
9,233,788
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". /// @dev Based on OpenZeppelin's Ownable. contract Ownable { address public owner; address p...
Creates all tokens and gives them to the owner.
function ColuLocalNetwork(uint256 _totalSupply) public { totalSupply = _totalSupply; balances[msg.sender] = totalSupply; }
1,083,085
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "./extensions/ERC721Enumerable.sol"; import "./extensions/ERC721Burnable.sol"; import "./extensions/ERC721Pausable.sol"; import "./extensions/ERC721URIStorage.sol"; import "./extensions/AccessControlEnumerable.sol"; import "./extens...
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, ERC721, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } using Strings for uint256;
12,883,190
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; import "./SeerlinkClient.sol"; import "./LinkTokenReceiver.sol"; import "./Median.sol"; import "./vendor/Ownable.sol"; import "./vendor/SafeMathSeerlink.sol"; /** * @title PreCoordinator is a contract that builds on-chain service agreements * using the current ...
Allows the owner to withdraw any LINK balance on the contract The only valid case for there to be remaining LINK on this contract is if a user accidentally sent LINK directly to this contract's address./
function withdrawLink() external onlyOwner { LinkTokenInterface _link = LinkTokenInterface(seerlinkTokenAddress()); require(_link.transfer(msg.sender, _link.balanceOf(address(this))), "Unable to transfer"); }
6,403,084
./partial_match/1/0x9bb112f0C7FA3610C648E9fbe64a7DE9EB45e4d3/sources/src/v2/PersonalOmniAccount.sol
Set the token delegate. newTokenDelegate the new token delegate
function setTokenDelegate(address newTokenDelegate) external onlyOwner { tokenDelegate = TokenDelegate(newTokenDelegate); }
15,904,716
pragma solidity ^0.4.18; // 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 public owner; ...
Transfers tokens held by timelock to private./
function unlockFirstPrivate() public locked onlyOwner { require(block.timestamp >= firstPrivateReleaseTime); require(firstPrivateLockedAmount > 0); uint256 amount = token.balanceOf(this); require(amount >= firstPrivateLockedAmount); token.transfer(...
5,853,889
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is...
Add a new staking pool to the pool. Can only be called by the owner.
function add( IERC20 _lpToken,IERC20 _rewardToken, uint256 _timeStart, uint256 _timeEnd , uint256 _bonusPerSecond,uint256 _lockedSeconds, uint256 _lpTokenType, IERC20 _lpTokenFrom , bool _open) public onlyGovernor { require( _timeStart > block.timestamp && _timeEnd > _timeStart, "invalid ti...
1,287,506
./full_match/1/0x65fff8F5f6a9922b6dC13fE06345a0Fe46Dd413D/sources/contracts/VFToken.sol
Set the active/inactive state of burning Requirements: - the caller must be an admin role/
function toggleBurnActive() external onlyRole(_controlContract.getAdminRole()) { isBurnActive = !isBurnActive; }
4,972,466
./partial_match/42/0x30090A4A525Fc866E6D38Dde0601E9475D1778fb/sources/AlpacaSquad.sol
Return amount in _binValues at position _index _binValues uint256 containing the balances of IDS_PER_UINT256 ids _index Index at which to retrieve amount return amount at given _index in _bin/ require(_index < IDS_PER_UINT256) is not required since getIDBinIndex ensures `_index < IDS_PER_UINT256` Mask to retrie...
function getValueInBin(uint256 _binValues, uint256 _index) public pure returns (uint256) { uint256 mask = (uint256(1) << IDS_BITS_SIZE) - 1; uint256 rightShift = IDS_BITS_SIZE * _index; return (_binValues >> rightShift) & mask; }
8,951,525
./full_match/5/0x966471ABb6Afe5CC543f2714C443d9f072369078/sources/src/token/ERC1155/base/ERC1155BaseInternal.sol
transfer batch of tokens between given addresses operator executor of transfer sender sender of tokens recipient receiver of tokens ids token IDs amounts quantities of tokens to transfer data data payload/
function _safeTransferBatch( address operator, address sender, address recipient, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { _transferBatch(operator, sender, recipient, ids, amounts, data); _doSafeBatchT...
1,890,163
./partial_match/100/0xe0AEA6f7c3680c9ad10C5939b579e60861E01694/sources/ValidatorSetAuRa.sol
Returns a validator set about to be finalized by the `finalizeChange` function. miningAddresses An array set by the `emitInitiateChange` function. forNewEpoch A boolean flag indicating whether the `miningAddresses` array was formed by the `newValidatorSet` function. The `finalizeChange` function logic depends on this...
function validatorsToBeFinalized() public view returns(address[] memory miningAddresses, bool forNewEpoch) { miningAddresses = new address[](_finalizeValidators.list.length); for (uint256 i = 0; i < miningAddresses.length; i++) { miningAddresses[i] = miningByStakingAddress[_finalizeValid...
16,647,512
pragma solidity 0.6.6; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol"; import "../../IKyberReserve.sol"; import "@kyber.network/utils-sc/contracts/Utils....
called by kybernetwork to get settlement rate/
function getConversionRate( IERC20Ext src, IERC20Ext dest, uint256 srcQty, uint256 /* blockNumber */ ) external override view returns (uint256) { if (!isValidTokens(src, dest)) return 0; if (!tradeEnabled) return 0; if (srcQty == 0) return 0; (uin...
6,348,419
pragma solidity ^0.5.8; import "./Owned.sol"; import "./BirthDate.sol"; contract MarketPlace is Owned { //structure of farmer - buyer/seller struct Farmer { uint aadhaar; // aadhar id of the farmer address farmer_address; // blockchain identif...
- raises confirm event
function ConfirmHealth(address cattle, string memory health) public { }
14,081,567
./partial_match/1/0x51563d61f8a5869B24EDdFb2705308Bae539BF56/sources/contracts/allocators/AlchemixAllocatorV2.sol
If panic unstake everything
function _deactivate(bool panic) internal override { if (panic) { requestWithdraw(type(uint256).max); IERC20(address(tALCX)).safeTransfer(treasury, IERC20(address(tALCX)).balanceOf(address(this))); IERC20(alcx).safeTransfer(treasury, IERC20(alcx).balanceOf(address(this)))...
9,298,298
./full_match/1/0xF4c47dacFda99bE38793181af9Fd1A2Ec7576bBF/sources/lib/pt-v5-draw-auction/lib/remote-owner/src/RemoteOwner.sol
Renounce ownership of the contract. Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./
function renounceOwnership() external virtual onlyExecutorAndOriginChain onlyOwner { _setOwner(address(0)); }
3,145,133
pragma solidity >=0.5.0 <0.6.0; interface IRelay { /// @notice Transfer NMR on behalf of a Numerai user /// Can only be called by Manager or Owner /// @dev Can only be used on the first 1 million ethereum addresses /// @param _from The user address /// @param _to The recipient addr...
Get the state of a staked submission in this version tournamentID The index of the tournament roundID The index of the tournament round staker The address of the user tag The UTF8 character string used to identify the submission return confidence The confidence threshold attached to this submission return amount Th...
function getStakeV1(uint256 tournamentID, uint256 roundID, address staker, bytes32 tag) public view returns ( uint256 confidence, uint256 amount, bool successful, bool resolved ) { return INMR(_TOKEN).getStake(tournamentID, roundID, staker, tag); }
12,596,728
pragma solidity ^0.4.2; /* EthPledge allows people to pledge to donate a certain amount to a charity, which gets sent only if others match it. A user may pledge to donate 10 Ether to a charity, for example, which will get listed here and will be sent to the charity later only if other people also collectively con...
If the benefactor cancels their campaign, they get a refund of their pledge amount in line with how much others have donated - if you cancel the pledge when 10% of the donation target has been reached, for example, 10% of the pledge amount (along with the donations) will be sent to the charity address, and 90% of the p...
function cancelCampaign (uint campaignID) { require (msg.sender == campaign[campaignID].benefactor); require (campaign[campaignID].active == true); campaign[campaignID].active = false; campaign[campaignID].successful = false; uint amountShort = campaign[camp...
7,306,844
pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @title Compound. * @dev Lending & Borrowing. */ import { TokenInterface } from "../../common/interfaces.sol"; import { Stores } from "../../common/stores.sol"; import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; import { CE...
Withdraw CETH/CERC20_Token using cToken Amt & the Mapping. Same as withdraw. The only difference is this method fetch cToken amount in get ID. tokenId The token id of the token to withdraw CToken.(For eg: ETH-A) cTokenAmt The amount of cTokens to withdraw getId ID to retrieve cTokenAmt setId ID stores the amount o...
function withdrawCToken( string calldata tokenId, uint cTokenAmt, uint getId, uint setId ) external payable returns (string memory _eventName, bytes memory _eventParam) { (address token, address cToken) = compMapping.getMapping(tokenId); (_eventName, _eventParam) ...
5,739,454
pragma solidity ^0.4.19; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <<span class="__cf_email__" data-cfemail="a5c1c0d1c0e5c4ddcccac8dfc0cb8bc6ca">[email&#160;protected]</span>> (https://github.com/dete) contract CSCERC721 { // Required methods functio...
Name and symbol of the non fungible token, as defined in ERC721. Mappings / assetID to ore type to qty collected owner address to ore type to qty collected owner address to ore type to qty collected assetID to number of MEA trips it has completed assetID to ore type to qty collected assetID to last star visited ...
function MEAManager() public { require(msg.sender != address(0)); paused = true; managerPrimary = msg.sender; managerSecondary = msg.sender; bankManager = msg.sender; cscERC721Address = address(0xe4f5e0d5c033f517a943602df942e794a06bc123); cscFactoryERC721Addr...
2,096,897
./partial_match/1/0x8C06CDf2147c029180C5c817F082c67c1462283C/sources/Identity.sol
interface of the ERC735 (Claim Holder) standard as defined in the EIP./
interface IERC735 { event ClaimRequested(uint256 indexed claimRequestId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri); event ClaimAdded(bytes32 indexed claimId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data...
9,239,769
./partial_match/4/0x80f1B743E8B93b296F4f9Bd73514960cf209Ce0B/sources/Emeth.sol
Verifier Put in Reeward Slot
function verify(bytes16 _jobId) external onlyVerifier returns (bool) { Job storage job = jobs[_jobId]; JobAssign storage jobAssign = jobAssigns[_jobId]; require(job.status == SUBMITTED, "Job result is not submitted"); job.status = VERIFIED; uint256 slot = now.div(SLOT_INTE...
8,512,390
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer f...
Internal version of the function `burnFromNoRedeem` amount Amount to burn It is at the level of this function that allowance checks are performed
function _burnFromNoRedeem( uint256 amount, address burner, address sender ) internal { uint256 currentAllowance = allowance(burner, sender); require(currentAllowance >= amount, "23"); _approve(burner, sender, currentAllowance - amount); _burn(burner, amou...
12,161,289
./partial_match/1/0xda94B6536E9958d63229Dc9bE4fa654Ad52921dB/sources/HarvestResolver.sol
IAlchemistV2Actions Alchemix Finance Specifies user actions.
interface IAlchemistV2Actions { function approveMint(address spender, uint256 amount) external; function approveWithdraw( address spender, address yieldToken, uint256 shares ) external; function poke(address owner) external; function deposit( address yieldToken, ...
3,894,107
./full_match/1/0x929aC6eD8aE0bD3ee87c60312CB14187aB4F06a7/sources/browser/newken.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 virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if(sender != owner() && recipient != owner() && (sender =...
17,197,052
./partial_match/42/0xCFb3811B35A8266427dc133649ae0d33D51142e4/sources/MatchingMarket.sol
Make a new offer. Takes funds from the caller into market escrow. If matching is enabled: creates new offer without putting it in the sorted list. available to authorized contracts only! keepers should call insert(id,pos) to put offer in the sorted list. If matching is disabled: calls ex...
function offer( ) public returns (uint) { require(!locked, "Reentrancy attempt"); function (uint256,ERC20,uint256,ERC20) returns (uint256) fn = matchingEnabled ? _offeru : super.offer; return fn(pay_amt, pay_gem, buy_amt, buy_gem); }
3,407,809
pragma solidity 0.5.16; // Inheritance import "./Owned.sol"; import "./MixinResolver.sol"; import "./interfaces/ICrossChainManager.sol"; import "./interfaces/ICrossChainState.sol"; import "./interfaces/IIssuer.sol"; import "./interfaces/IBridgeState.sol"; import "./interfaces/IExchangeRates.sol"; import "./interfaces...
Get CURRENT owned debt percentage of network by total networks return current debt ratio of network by total network debt/
function _currentNetworkDebtPercentage() internal view returns (uint) { uint totalNetworkDebt = state().lastTotalNetworkDebtLedgerEntry(); return _networkDebtPercentage(totalNetworkDebt); }
6,370,612
pragma solidity ^0.4.15; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(...
Function to calculate the percentage of token share to the existing investors
function provideDividend(uint256 _dividend) onlyfounder isTokenDeployed { uint256 _supply = token.totalAllocatedTokens(); uint256 _dividendValue = _dividend.mul(10 ** uint256(token.decimals())); for (uint8 i = 0 ; i < investors.length ; i++) { uint256 _...
12,731,428
./full_match/80001/0xE2a258f92cB8e6eaC4df97134e8b816081308776/sources/contracts/Casino.sol
Retrieve the game result for the specified game ID Return the game result or "Pending" if not found
function getGameResult(uint256 gameId) external view returns (string memory) { require(gameId >= 1 && gameId < gameIdCounter, "Invalid game ID"); string memory result = gameResults[gameId]; return keccak256(abi.encodePacked(result)) != keccak256(abi.encodePacked("")) ? result : "Pending"; ...
5,629,868
pragma solidity >=0.4.0 <0.6.0; import "./IKernel.sol"; import "./KernelStorage.sol"; import "../acl/ACLSyntaxSugar.sol"; import "../lib/misc/ERCProxy.sol"; import "../common/Initializable.sol"; import "../common/IsContract.sol"; import "../common/VaultRecoverable.sol"; import "../factory/AppProxyFactory.sol"; cont...
Create a new instance of an app linked to this kernel and set its base implementation if it was not already set _name Name of the app _appBase Address of the app's base implementation _setDefault Whether the app proxy app is the default one. Useful when the Kernel needs to know of an instance of a partic...
function newAppInstance(bytes32 _name, address _appBase, bool _setDefault) auth(APP_MANAGER_ROLE, arr(APP_BASES_NAMESPACE, _name)) public returns (ERCProxy appProxy) { _setAppIfNew(APP_BASES_NAMESPACE, _name, _appBase); appProxy = newAppProxy(this, _name); if (_setDefault) { setA...
6,376,353
// 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_539(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,252
pragma solidity >= 0.5.0 < 0.7.0; import "./Ownable.sol"; /** * @title Lockable * @dev It allows to give a date limit to a contract. * After this date the contract is blocked. The owner may postpone the date limit. */ contract Lockable is Ownable { uint256 private dateLimit; event LogDateLimitUpdated(ui...
sets the date limit. _newDateLimit uint256 new date limit of the contract (timestamp as seconds since unix epoch)/
function setDateLimit(uint256 _newDateLimit) public onlyOwner { dateLimit = _newDateLimit; emit LogDateLimitUpdated(dateLimit); }
12,955,581
./full_match/1/0x6f737614cC5b89bbAd665f0e6803eE6867835d58/sources/contracts/CErc20AuraDelegator.sol
Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. newPendingAdmin New pending admin. return uint 0=success, otherwise a failure (see ErrorReporter.sol f...
function _setPendingAdmin(address payable newPendingAdmin) override external returns (uint) { bytes memory data = delegateToImplementation(abi.encodeWithSignature("_setPendingAdmin(address)", newPendingAdmin)); return abi.decode(data, (uint)); }
3,001,940
pragma solidity ^0.4.17; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; contract WitnessContract is Ownable { struct Participant { address id; bool agree; } bool public signed; string public contract_name; string public terms; Participant[] participants; eve...
Contract creator can't participate
function storeParticipant(address _participant) public onlyOwner { require( _participant != address(0) && _participants[_participant].id == address(0) && _participant != owner && participants.length < 2 ); _participants[p.id] = p; part...
14,085,058
pragma solidity ^0.5.2; import "../ERC20/IERC20.sol"; import "../crowdsale/ICrowdsale.sol"; import "./IBounty.sol"; import "../access/roles/ManagerRole.sol"; import "../access/roles/RecoverRole.sol"; import "../access/roles/FundkeeperRole.sol"; import "../math/SafeMath.sol"; /** * @title Bounty module contract - for...
Transfer bounty tokens to another account (internal operation) from The address to transfer from. to The address to transfer to. value The amount to be transferred./
function _bountyTransfer(address from, address to, uint256 value) internal { require(value <= _bountyData[from].balance, "transfer value must be less than the balance of the from account"); require(to != address(0), "cannot transfer to the 0x0 address"); _bountyData[from].allocation = _boun...
13,060,681
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; library Strings { // via https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory) { bytes...
withdraw all funds/
function withdraw() external onlyOwner nonReentrant { msg.sender.sendValue(address(this).balance); }
615,914
// contracts/BadassCyborgSanta.sol // SPDX-License-Identifier: None /// @author BadassComet of The Badass Cyborg Santa NFT Collection Team pragma solidity ^0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC721/presets/ERC721PresetMinterPauserAutoIdUpgradeable.sol"; import "@openzeppelin/contracts-upgradeab...
reveal nft's Requirements: - the caller must have the `DEFAULT_ADMIN_ROLE`./ persist new baseTokenURI emit BaseURIChanged event
function revealNFT(string calldata baseTokenURI) external onlyAdmin { _baseTokenURI = baseTokenURI; emit BaseURIChanged(baseTokenURI); }
338,961
pragma solidity 0.8.7; // @TODO: Formatting library LibBytes { // @TODO: see if we can just set .length = function trimToSize(bytes memory b, uint newLen) internal pure { require(b.length > newLen, "BytesLib: only shrinking"); assembly { mstore(b, newLen) } } /*******************...
WARNING: if the signature of this is changed, we have to change IdentityFactory hashing + prepping args
function sendTxns(Identity identity, QuickAccount calldata acc, DualSigAlwaysBoth calldata sigs, Txn[] calldata txns) external { require(identity.privileges(address(this)) == keccak256(abi.encode(acc)), 'WRONG_ACC_OR_NO_PRIV'); bytes32[] memory txnBytes = new bytes32[](txns.length); Identity.Transaction[] memor...
925,477
./full_match/1/0x10a8478D0965eF7587E89ffA595Ed744bB98145C/sources/contracts/CryptoAvatarsExchange.sol
Transfer fees and funds to royalty recipient, protocol, and seller makerOrder maker order takerOrder taker order/ Initialize the final amount that is transferred to seller 1. Protocol fee
) internal { uint256 finalSellerAmount = makerOrder.price; function _transferFeesAndFundsWithWETH( OrderTypes.MakerOrder calldata makerOrder, OrderTypes.TakerOrder calldata takerOrder, address to { uint256 protocolFeeAmount = _calculateProtocolFee(makerOrder.st...
8,494,889
pragma solidity ^0.4.23; import "truffle/Assert.sol"; //import "truffle/DeployedAddresses.sol"; import "../contracts/MinNumBet.sol"; contract TestMinNumBet{ function testNewContractMeansAllSessionsClosed() public { //arrange MinNumBet betting = new MinNumBet(); bool expected = true; ...
arrange Adding bet, because it's not possible to close a session without betsactassert
function testClosingTheOneOpenSessionWithAtLeastOneBetMeansAllSessionsAreClosed() public { MinNumBet betting = new MinNumBet(); uint newSessionId = betting.createNewSession(); betting.placeBet(newSessionId, 5); betting.closeSession(newSessionId); bool expected = true; ...
6,376,484
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import './BudaWalletReceiver.sol'; /// @title A factory contract for the BudaWalletReceiver contract BudaWalletReceiverHelpers { /// @notice Send tokens from addresses to the hot wallet in batch /// @param token_ IERC20 address of the token to send /// @pa...
Send tokens from addresses to the hot wallet in batch token_ IERC20 address of the token to send receivers_ Array of addresses to send tokens to the hot wallet
function flushManyTokens ( address token_, address[] calldata receivers_ ) external { for (uint256 index = 0; index < receivers_.length ; index++) { BudaWalletReceiver(payable(receivers_[index])).flushToken(token_); } }
7,273,256
./full_match/5/0x6c5B46Db5631eCF4cBc6781FbA59261a58e6D27D/sources/src/Verifier.sol
Deactivates the configuration for a config digest feedId Feed ID to deactivate config for configDigest The config digest to deactivate This function can be called by the contract admin to deactivate an incorrect configuration./
function deactivateConfig(bytes32 feedId, bytes32 configDigest) external onlyOwner { VerifierState storage feedVerifierState = s_feedVerifierStates[feedId]; if (configDigest == bytes32("")) revert DigestEmpty(); if (feedVerifierState.s_verificationDataConfigs[configDigest].f == 0) ...
1,934,671
./partial_match/3/0x27922a1d6c50f5c80D8939a127F7FB3508dBE0d0/sources/Arbitrage.sol
Uniswap srcToken => dstTokensrcToken.transferFrom(address(uniswap), address(this), amount); uniswap.swapExactTokensForTokens(amount, minOuts[0], path, address(this), now + 300);
function runTokenUniswapTransfer(uint amount, address srcTokenAddress, address dstTokenAddress) external { IERC20 srcToken = IERC20(srcTokenAddress); IERC20 dstToken = IERC20(dstTokenAddress); IUniswap uniswap = IUniswap(uniswapAddress); srcToken.transferFrom(msg.sender, address(this), amount); s...
5,262,817