file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity 0.5.15; contract IAugur { function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA...
inject NONSTANDARD NAMING
function BALANCEOFMARKETOUTCOME21(IMarket _market, uint256 _outcome, address _account) public view returns (uint256);
2,553,979
pragma solidity ^0.5.0; /** * @title BT **/ interface tokenTransfer { function totalSupply() external view returns (uint256); function balanceOf(address receiver) external returns(uint256); function transfer(address receiver, uint amount) external; function transferFrom(address _from, address _to, uin...
����24Сʱ�ֺ콱�������ܽ��� / vip���� = ƽ���ֺ콱��
function settlementBonus() private { for(uint i = 0;i<vipTodayBonus.length;i++){ uint todayBonus = vipTodayBonus[i]; if(todayBonus == 0){ break; } uint length = vipLength[i]; if(length == 0){ length = 1; ...
7,221,457
./partial_match/1313161554/0xAE20c9F0c4a7E0098D322F690DFea6534E105614/sources/MasterChef.sol
Add a new lp to the pool. Can only be called by the owner.
function add( uint256 _allocPoint, IERC20 _lpToken, uint16 _depositFeeBP ) external onlyOwner nonDuplicated(_lpToken) { require(_depositFeeBP <= MAX_DEPOSIT_FEE, "add: invalid deposit fee basis points"); uint256 lastRewardTime = block.timestamp > startTime ? block.timesta...
16,945,359
./partial_match/1/0xE9cF49A1B2f05a5A5880dF08d5699f076f748E8B/sources/ThyrantinuToken.sol
Dividend-Paying Token Optional Interface Roger Wu (https://github.com/roger-wu) OPTIONAL functions for a dividend-paying token contract.
interface ThyrantinuDividend { function withdrawableDividendOf(address _owner) external view returns (uint256); function withdrawnDividendOf(address _owner) external view returns (uint256); function accumulativeDividendOf(address _owner, address _token) ...
9,414,280
./full_match/97/0x792beC4a54b3A89b216F0d40bfF7f44bFFed6A7F/sources/contracts/Golden_Poo_Master_.sol
Store value in variable num value to store/
function editVersion(uint256 num) public { _version = num; }
3,268,775
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.6; // ---------------------------------------------------------------------------- // 'HAPPYHOUR' Staking smart contract // // Enter our universe : cocktailbar.finance // // Come join the disscussion: https://t.me/cocktailbar_discussion // // ...
Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), Reverts with custom message when dividing by zero. Counterpart to Solidity's `%` operator. This function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remain...
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
14,862,478
./partial_match/1/0xFa7461f07Be51F50c1A5c928b16E868E7b17Ed73/sources/TokenGeyser.sol
Transfers amount of deposit tokens from the user. amount Number of deposit tokens to stake. referrer User's Referrer/
function stake(uint256 amount, address referrer) external { _stakeFor(msg.sender, msg.sender, amount, referrer); }
2,594,249
./full_match/11155111/0xEDe858A8Ba5792F2D0597E46E895e54D96fcF7Bf/sources/project:/contracts/NFTBox.sol
Sets the price of each NFT during the initial sale. price The price of each NFT during the initial sale | precision:18/
function setCurrentPrice(uint256 price) external onlyOwner { currentPrice = price; }
3,796,232
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./interfaces/IAssetManager.sol";...
Update and pay last week's premium.
function updatePremium(uint256 assetIndex_) external { uint256 week = getWeekByTime(now); require(buyer.weekToUpdate() == week, "buyer not ready"); require(poolInfo[assetIndex_].weekOfPremium < week, "already updated"); uint256 amount = buyer.premiumForGuarantor(assetIndex_); ...
1,085,042
pragma solidity ^0.5.1; contract tokenRecipientInterface { function receiveApproval(address _from, uint256 _value, address _token, bytes memory _extraData) public; } contract ERC20TokenInterface { function totalSupply() public view returns (uint256 _totalSupply); function balanceOf(address _owner) publi...
User can transfer tokens with this method, method is disabled if emergencyLock is activated _to Reciever of tokens _value The amount of tokens that will be sent return if successful returns true/
function transfer(address _to, uint256 _value) lockAffected public returns (bool success) { require(_to != address(0x0) && _to != address(this)); balances[msg.sender] = safeSub(balanceOf(msg.sender), _value); balances[_to] = safeAdd(balanceOf(_to), _value); emit Transfer(msg.sender, ...
1,845,132
pragma solidity ^0.4.21; // ---------------------------------------------------------------------------- // 'DiipCoin' token contract // // Deployed to : 0xeB086DF649c34bFb1E074B272fB8139095648eFF // Symbol : DIIP // Name : diipCoin // Decimals : 0 // // // (c) by Moritz Neto with BokkyPooBah / Bok Con...
------------------------------------------------------------------------ Constructor ------------------------------------------------------------------------
function DiipCoin() public { symbol = "DIIP"; name = "DiipCoin"; decimals = 0; _totalSupply = 100000000; balances[0xeB086DF649c34bFb1E074B272fB8139095648eFF] = _totalSupply; emit Transfer(address(0), 0xeB086DF649c34bFb1E074B272fB8139095648eFF, _totalSupply); m...
6,285,027
./full_match/80001/0xafB8D3F0d92461d3c860E4F7FA1B28a5BF8a1cF8/sources/MintingNFT.sol
This is a function of ERC721Enumerable interface /
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); }
874,114
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // 'FAO' 'FarmerAndOne Token' token contract // // Symbol : FAO // Name : FarmerAndOne Token // Total supply: 5000,000,000.000000000000000000 // Decimals : 18 // // Enjoy. // // (c) Bokky...
------------------------------------------------------------------------ Transfer `tokens` from the `from` account to the `to` account The calling account must already have sufficient tokens approve(...)-d for spending from the `from` account and - From account must have sufficient balance to transfer - Spender must ha...
function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); ...
570,248
// SPDX-License-Identifier: MIT pragma solidity ^0.5.17; import "@openzeppelinV2/contracts/token/ERC20/IERC20.sol"; import "@openzeppelinV2/contracts/math/SafeMath.sol"; import "@openzeppelinV2/contracts/utils/Address.sol"; import "@openzeppelinV2/contracts/token/ERC20/SafeERC20.sol"; import "../../interfaces/yearn/...
WithdrawAll sends 'want' to 'vault'
function withdrawAll(address _strategy) external { require(msg.sender == governance, "!governance"); IStrategy(_strategy).withdrawAll(); }
2,527,730
pragma solidity 0.7.6; pragma abicoder v2; //SPDX-License-Identifier: MIT import "hardhat/console.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./interfaces/IArbitrator.sol"; // ht...
Sign the agreement up-to setting `_settingId` Callable by any party _settingId Last setting ID the user is agreeing with/ if (partiesInfo[msg.sender].depositedAmount < partiesInfo[msg.sender].collateralAmount) { partiesInfo[msg.sender].collateralToken.safeTransferFrom( msg.sender, address(this), parties...
function sign(uint256 _settingId) public { uint256 lastSettingIdSigned = partiesInfo[msg.sender].lastSettingIdSigned; require (state != UnbreakableVowState.TERMINATED, "ERROR_CAN_NOT_SIGN_TERMINATED_VOW"); require(lastSettingIdSigned != _settingId, "ERROR_SIGNER_ALREADY_SIGNED"); require(_settingId < ...
1,760,105
./full_match/43113/0xF935B8A31775b6727bB867fAba4a2dE731CaC2CE/sources/snipe.sol
Sets the threshold price in main per other 1e18.
function setThresholdPriceMainPerOther(uint256 mainPerOther1e18) external onlyAdmin { require(ignoreChecks || mainPerOther1e18 >= 3000000000000000, "use TOKEN/AVAX * 10^18"); require(ignoreChecks || mainPerOther1e18 <= 10000000000e18, "use TOKEN/AVAX * 10^18"); thresholdPriceMainPerOther = m...
13,151,695
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarvest; uint256 maxDebtPerHarvest; uint256 lastReport; uint...
harvest takes priority
function tendTrigger(uint256 gasCost) public view override returns (bool) { if (harvestTrigger(gasCost)) { return false; } getProtocolCollatRatios(address(want)); uint256 currentCollatRatio = getCurrentCollatRatio(); if (currentCollatRatio >= liquidationThre...
5,808,510
./full_match/3/0x36FC843b2e318b7499696ADC8a7a49aD90066C76/sources/contracts/Transfer.sol
get contract balance
function ContractBalanceGet()public view returns(uint){ return address(this).balance; }
14,151,038
pragma solidity 0.6.1; contract BigFlexToken { string internal _name; string internal _symbol; uint256 internal _granularity; uint256 internal _totalSupply = 0; mapping(address => uint256) internal _balances; mapping(address => bool) internal _isDefaultOperator; mapping(address => mapping(...
Добавляет нового оператора для msg.sender
function authorizeOperator(address operator) external { require(operator != msg.sender, "Err. You can't auth the holder"); _isAuthOperator[msg.sender][operator] = true; _isRevokedOperator[msg.sender][operator] = false; emit AuthorizedOperator(operator, msg.sender); }
5,375,723
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) 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 functio...
Set Mint Stage/
function setStage(uint8 _stage) public onlyOwner { require(stage < 4, "FuDaoVerseDAN: Exceeded maximum number of stages"); stage = _stage; }
13,708,002
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "../interfaces/IPool.sol"; import "../interfaces/ICorePool.sol"; import "./ReentrancyGuard.sol"; import "./SyndicatePoolFactory.sol"; import "../utils/SafeERC20.sol"; import "../token/SyntheticSyndicateERC20.sol"; import "../interfaces/IMigrator.sol"; /** ...
Executes SyntheticSyndicateERC20.mint(_to, _values) on the bound SyntheticSyndicateERC20 instance Reentrancy safe due to the SyntheticSyndicateERC20 design/ solhint-disable-next-line just delegate call to the target
function mintSSyn(address _to, uint256 _value) internal { SyntheticSyndicateERC20(ssynr).mint(_to, _value); }
5,539,105
./full_match/1/0xd5b8Ae7F5dD3C38E508d2cb98bB1890336aD0D7f/sources/contracts/PLAK721.sol
Allows owners to mint for free
function mint(address to) onlyOwner public virtual returns (uint256) { _tokenIds.increment(); uint256 newId = _tokenIds.current(); _safeMint(to, newId); emit PaymentLinksAccessKeyMinted(newId); return newId; }
9,697,110
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; import "./TellorStake.sol"; import "./TellorGetters.sol"; import "./Utilities.sol"; import "./ITellor.sol"; import "./SafeMath.sol"; /** @author Tellor Inc. @title Tellor @dev Main functionality for Tellor Oracle system **/ contract Tellor is TellorStake,Ut...
Allows for a fork to be proposed _propNewTellorAddress address for new proposed Tellor/
function proposeFork(address _propNewTellorAddress) external { require(uints[_LOCK] == 0, "no rentrancy"); uints[_LOCK] = 1; _verify(_propNewTellorAddress); uints[_LOCK] = 0; bytes32 _hash = keccak256(abi.encode(_propNewTellorAddress)); uints[_DISPUTE_COUNT]++; ...
9,847,223
./partial_match/1/0xcE57701b4045C0B992f9B80Ad150e12e5423695C/sources/contracts/avalanche/Avalanche.sol
Some of the LP tokens kept by the unstaking fee will be locked forever in the PWDR contract, the rest will be converted to PWDR and distributed to stakers Remove the liquidity from the Uniswap PWDR-ETH pool and buy PWDR with the ETH received The _transfer function in the PWDR.sol contract automatically calls avalanche...
function _withdraw(address _user, uint256 _amount) internal AvalancheActive NonZeroAmount(_amount) HasStakedBalance(_user) HasWithdrawableBalance(_user, _amount) { _updatePool(); UserInfo storage user = userInfo[_user]; uint256 unstaking...
2,838,671
./full_match/4/0xCEE93B4937bb41d8b5dB77459c60E6d79c769f3e/sources/contracts/4_ERC20Basic.sol
4. approve delegate
function approve(address delegate, uint numTokens) public returns (bool) { allowed[msg.sender][delegate] = numTokens; emit Approval(msg.sender, delegate, numTokens); return true; }
781,357
./full_match/44/0x531b99fDdFb0823eDb6e0eF77b9A7Db6EDFF6B52/sources/SnowFactory.sol
issue mapping token, only can be called by inboundLane originalToken the original token address recipient the recipient of the issued mapping token amount the amount of the issued mapping token/
function issueMappingToken( address originalToken, address recipient, uint256 amount ) public onlyMessageEndpoint whenNotPaused { address mappingToken = getMappingToken(remoteBacking, originalToken); require(mappingToken != address(0), "MappingTokenFactory:mapping token h...
13,237,070
//Address: 0x763de7eb97a80f12784436aabf3911d3d9ac823a //Contract name: PCICO //Balance: 0 Ether //Verification Date: 11/14/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.13; contract SafeMath { function safeAdd(uint256 x, uint256 y) internal returns(uint256) { uint256 z = x + y; ...
First we check the ETH cap, as it's easier to calculate, return the contribution if the cap has been reached already If all is fine with the ETH cap, we continue to check the minimum amount of tokens
function () payable external { require(now >= startDate); require(now <= endDate); require(msg.value > 0); uint256 checkedReceivedEth = safeAdd(totalReceivedEth, msg.value); uint256 tokens = safeMult(msg.value, getCurrentTokenPrice()); require(t...
891,198
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.6.12; pragma experimental ABIEncoderV2; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assum...
deposit - safe swap function that the sender side fills with all the relevet information for the swap/
this function deels with Ether and token20 swaps @param to: address of the recipient @param token0: the address of the token he is sending to the recipient @param value0: the amount being sent to the recipient side in the selected token in token0 @param fees0: the amount o...
11,697,624
//SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.4; interface IStakingGame { struct UserProgress { uint256 choice1; uint256 choice2; uint256 choice3; bool ready; // started playing the game (sacrificed susu) bool participated; // entered the party and perform...
finished as in got a role, but not went to the party yet ppl who started the game doesn't mean they finished it how many variation of choices were made
interface IStakingGameQuery { function players(uint256) external view returns (address); function getStatus(address _player) external view returns (UserProgress memory progress); function getPlayers() external view returns (address[] memory); function getStatuses() external vi...
6,353,847
pragma solidity 0.5.0; /** * @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) { if (a == 0) { return 0; ...
Allow the token holder to upgrade some of their tokens to a new contract. Check upgrate state Validate input value Take tokens out from circulation Token Upgrader reissues the tokens
function upgrade(uint _value) external { UpgradeState state = getUpgradeState(); require(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading); require(_value != 0); balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply_ = totalSupply_.sub...
947,900
./full_match/1/0x492B6F8A53D1c42cC2DD352788a6C02c557BE9F5/sources/contracts/integrations/curve/common/Stablz3CRVMetaPoolIntegration.sol
Construct an amounts array for a given stablecoin amount _stablecoin Stablecoin address _amount Amount of tokens return amounts Array of amounts with the stablecoin index set to the amount
function _constructAmounts(address _stablecoin, uint _amount) internal view returns (uint[4] memory amounts) { amounts[_stablecoinIndex[_stablecoin]] = _amount; return amounts; }
3,190,078
//Address: 0x08c622055b66b8c8bc6925f49ea443fa7bdf4bb7 //Contract name: SafeTimeLock //Balance: 0 Ether //Verification Date: 3/14/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; /// @title Ownable contract Ownable { address public owner; address public newOwnerCandidate; eve...
Constructor function/
function SafeTimeLock() { epm = token(0xc5594d84B996A68326d89FB35E4B89b3323ef37d); startTime = now; endTime = startTime + DURATION; }
1,018,786
./full_match/4/0xAe3A60dF4E2e5663a72B85603D34AA9EEbFfFcDD/sources/browser/PublicPortal.sol
transferXIOToContract function is responsible for transfering XIO to this contract. _xioQuantity, Amount of XIO tokens./
function transferXIOToContract(uint256 _xioQuantity) private { portalMemberBalance[msg.sender] = portalMemberBalance[msg.sender].add( _xioQuantity ); IERC20(XIO_CONTRACT).transferFrom( msg.sender, address(this), _xioQuantity ); ...
12,325,062
// ________ ________ ___ ________ ___ ___ ___ ___ //|\ ____\|\ __ \|\ \ |\ __ \ |\ \ / /|\ \ / /| //\ \ \___|\ \ \|\ \ \ \ \ \ \|\ \ \ \ \/ / | \ \/ / / // \ \ \ __\ \ __ \ \ \ \ \ __ \ \ \ / / \ \ / / // \ \ \|\ \ \ \ \ \ \ \____\ \ \ \ ...
Claim lost Hammies from Original Contract
function claimLostHammiesAndStake(uint256 _count, bool stake, uint256 status) public { uint256 numReserved = claimableHammies[msg.sender]; require(numReserved > 0, "You do not have any claimable Hammies"); require(_count <= numReserved, "You do not have that many Claimable Hammies"); ...
1,154,545
pragma solidity ^0.7.5; pragma abicoder v2; import "./lib/LibSafeMath.sol"; import "./ERC1155Mintable.sol"; import "./mixin/MixinOwnable.sol"; contract ProofOfCultureMinter is Ownable { using LibSafeMath for uint256; struct _HashtagContainer { string originalHashtag; string normalizedHashtag; uint256...
Returns all claimed hashtags as an array/
function getAllClaimedHashtags() public view returns (string[] memory) { return claimedHashtags; }
130,416
./full_match/9001/0x7A5c119ec5dDbF9631cf40f6e5DB28f31d4332a0/sources/src/Facets/CalldataVerificationFacet.sol
Extracts the main parameters from the calldata data The calldata to extract the main parameters from return bridge The bridge extracted from the calldata return sendingAssetId The sending asset id extracted from the calldata return receiver The receiver extracted from the calldata return amount The min amountfrom the ...
function extractMainParameters( bytes calldata data ) public pure returns ( string memory bridge, address sendingAssetId, address receiver, uint256 amount, uint256 destinationChainId, bool hasSourceSwaps, ...
11,534,522
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IterableMapping.sol"; import "./SafeMathLibs.sol"; import "./GetStuck.sol"; /// @title Dividend-Paying Token Optional Interface /// ...
View the amount of dividend in wei that an address has earned in total. accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner) = (magnifiedDividendPerShare balanceOf(_owner) + magnifiedDividendCorrections[_owner]) / magnitude _owner The address of a token holder. return The amo...
function accumulativeDividendOf(address _owner) public view override returns(uint256) { return (magnifiedDividendPerShare*balanceOf(_owner)).toInt256Safe() .add(magnifiedDividendCorrections[_owner]).toUint256Safe() / magnitude; }
938,256
./partial_match/97/0x2bCd10B8e70D6FB0276b4F6BB0FfF0f2aB3E9A16/sources/EmiRouter.sol
token address of token amountTokenDesired desired amount of token amountTokenMin minimum amount of token amountETHMin minimum amount of ETH ref referral address return amountToken added liquidity of token return amountETH added liquidity of ETH return liquidity/
function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address ref ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidit...
11,435,176
./partial_match/1/0x80b20c979Bd807472e70f29124fAfed8e78791eA/sources/MCAP.sol
Public variables of the token / This creates an array with all balances / Initializes contract with initial supply tokens to the creator of the contract /
function MCAP() { initialSupply = 50000000; name ="MCAP"; decimals = 8; symbol = "^"; }
4,135,977
pragma solidity ^0.4.24; // Is needed to call functions in the Snow contract. contract Snow { function buy(address) public payable returns(uint256); function withdraw() public; function redistribution() external payable; function myTokens() public view returns(uint256); function myDividends(bool) p...
returns player earnings per vaults -functionhash- 0x63066434 return winnings vault return general vault return affiliate vault/ setup local rID if round has ended. but round end has not been run (so contract has not distributed winnings) if player is winner if player is not the winner
function getPlayerVaults(uint256 _pID) public view returns(uint256 ,uint256, uint256) { uint256 _rID = rID_; if (now > round_[_rID].end && round_[_rID].ended == false && round_[_rID].plyr != 0) { if (round_[_rID].plyr == _pID) { ...
359,381
./full_match/83/0x48ef19252C6c59c5CF1e5Bd87DAeE0A2c5BA7cEE/sources/contracts/CToken/CToken.sol
The liquidator liquidates the borrowers collateral. The collateral seized is transferred to the liquidator. borrower The borrower of this cToken to be liquidated liquidator The address repaying the borrow and seizing collateral cTokenCollateral The market in which to seize collateral from the borrower repayAmount ...
function liquidateBorrowFresh( address liquidator, address borrower, uint256 repayAmount, address cTokenCollateral ) internal returns (uint256, uint256) { uint256 allowed = IComptroller(comptroller).liquidateBorrowAllowed( address(this), address(cTokenCollateral), liquidator, ...
9,556,691
// contracts/CustoMoose.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./IToken.sol"; import "./Library.sol"...
Mint internal, this is to avoid code duplication./
function mintInternal() internal returns (uint256 tokenId) { uint256 _totalSupply = totalSupply(); require(_totalSupply < MAX_SUPPLY); require(!Library.isContract(msg.sender)); uint256 thisTokenId = _totalSupply; tokenIdToConfig[thisTokenId] = config(); tokenIdToSto...
6,255,424
./partial_match/1/0xE405EA33148a2b6FCbA3125b469dF87229a08d5A/sources/Moonpudgy.sol
if numberMinted(msg.sender) > 0 -> no whitelist, no free.
function mintToken(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active"); require(numberOfTokens <= maxTokensPerTx, "Exceed max tokens per tx"); require(numberOfTokens > 0, "Must mint at least one"); require(totalSupply() + numberOfTokens <= MAX_TOKENS, "...
16,094,679
/** *Submitted for verification at Etherscan.io on 2020-06-08 */ pragma solidity ^0.5.17; // @notice SECURITY TOKEN CONTRACT // @dev ERC-1404 with ERC-20 with ERC-223 protection Token Standard Compliant // @author Geoffrey Tipton at AEN // ---------------------------------------------------------------------------- /...
------------------------------------------------------------------------ don't accept ETH/
function() payable external { revert(); }
956,724
./partial_match/1/0xAE69a93945133c00B9985D9361A1cd882d107622/sources/TokenizedStrategy.sol
Get the price per share. This value offers limited precision. Integrations that require exact precision should use convertToAssets or convertToShares instead. return . The price per share./
function pricePerShare() external view returns (uint256) { return convertToAssets(10 ** _strategyStorage().decimals); } SETTER FUNCTIONS
16,059,395
// SPDX-FileCopyrightText: 2021 ShardLabs // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/Reen...
Allows the operator owner to update the rewardAddress. _rewardAddress new reward address.
function setOperatorRewardAddress(address _rewardAddress) external override whenNotPaused checkIfRewardAddressIsUsed(_rewardAddress) { (uint256 operatorId, NodeOperator storage no) = getOperator(0); no.rewardAddress = _rewardAddress; operatorOwners[_rewar...
6,084,893
// SPDX-License-Identifier: MIT /* Borrowed heavily from Synthetix * MIT License * =========== * * Copyright (c) 2021 Synthetix * * 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 res...
Update the reward and emit the `RewardAdded` event - PRIVILEGES REQUIRED: Admins with the role "REWARDS_DISTRIBUTOR_ROLE" bankNodeId The id of the bank node reward The reward amount
function notifyRewardAmount(uint32 bankNodeId, uint256 reward) external onlyRole(REWARDS_DISTRIBUTOR_ROLE) { _notifyRewardAmount(bankNodeId, reward); } IERC20(tokenAddress).safeTransfer(owner, tokenAmount); emit Recovered(tokenAddress, tokenAmount);
6,480,674
//SPDX-License-Identifier: MIT pragma solidity =0.8.13; pragma experimental ABIEncoderV2; import "@openzeppelin-v4/contracts/utils/introspection/IERC165.sol"; import "@openzeppelin-v4/contracts/utils/math/SafeCast.sol"; import "./AbstractAccumulator.sol"; import "../interfaces/IPriceAccumulator.sol"; import "../inte...
maxAge The maximum age of the quotation, in seconds. If 0, fetches the real-time price. @inheritdoc IPriceOracle
function consultPrice(address token, uint256 maxAge) public view virtual override returns (uint112 price) { if (token == quoteTokenAddress()) return uint112(10**quoteTokenDecimals()); if (maxAge == 0) return fetchPrice(token); ObservationLibrary.PriceObservation storage observation = obser...
14,056,214
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) ...
_bid will throw if the bid or funds transfer fails
function bidEth(uint256 _tokenId) external payable whenNotPaused { _bidEth(_tokenId, msg.value); uint256 prizeAmount = (msg.value * prizeCut) / 10000; prizeAddress.transfer(prizeAmount); _transfer(msg.sender, _tokenId); }
6,389,674
pragma solidity ^0.4.24; interface itoken { function freezeAccount(address _target, bool _freeze) external; function freezeAccountPartialy(address _target, uint256 _value) external; function balanceOf(address _owner) external view returns (uint256 balance); // function totalSupply() external view retur...
called by the owner to pause, triggers stopped state/
function pause() onlyOwner public { itoken tk = itoken(address(ownedContract)); tk.pause(); }
1,496,913
pragma solidity ^0.4.18; contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other t...
internal function to pay out the winner
function _payoutWinner(uint winner, uint loser, uint take, uint fee) private returns(bool) { return true; } else { }
12,654,413
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.2; /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value)...
set cooldown period
function updateDynastyValue(uint256 newDynasty) public onlyGovernance { require(newDynasty > 0); logger.logDynastyValueChange(newDynasty, dynasty); dynasty = newDynasty; WITHDRAWAL_DELAY = newDynasty; auctionPeriod = newDynasty.div(4); replacementCoolDown = currentEpo...
1,356,633
./full_match/1/0x0d7cD88C78910ff1b6B90d0e647d671eB861890e/sources/contracts/StakingPool.sol
unique counting sort
function _sort(uint256[] memory data, uint256 setSize) internal pure { uint256 length = data.length; bool[] memory set = new bool[](setSize); for (uint256 i = 0; i < length; ++i) { set[data[i]] = true; } uint256 n = 0; for (uint256 i = 0; i < setSize; ++i) { if (set[i]) { d...
8,493,919
// SPDX-License-Identifier: UNLICENSED pragma solidity >0.4.0 <0.8.0; /** * @title Block Sat Oracle Gateway interface. * @author Taurai Ushewokunze * @dev this gateway provides an instance of the Block Sat Oracle for user clients and and instance of the Block Sat Dispatch for nodes. * The versions provided ...
Block Sat Oracle Gateway interface. Taurai Ushewokunze this gateway provides an instance of the Block Sat Oracle for user clients and and instance of the Block Sat Dispatch for nodes. The versions provided of both Oracle and Dispatch are usually backwards compatible./
interface IBSOGateway { function getOracle() external view returns (address _bsoAddress, string memory _version); function getDispatch() external view returns (address _bsoDispatchAddress, string memory _version); pragma solidity >0.4.0 <0.8.0; }
13,005,722
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
create a new tokenId
function _mintKHand(uint256 lootId) internal returns (uint256) { string memory hand = ILoot(loot).getHand(lootId); uint256 kHandId = attributeToKLoot[hand]; if (kHandId == 0) { currentTokenId++; kHandId = currentTokenId; kLootToAttrType[kHandId] = AttrType...
6,243,412
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; contract UserModule { /** * @dev User function to supply. * @param token_ address of token. * @param amount_ amount to supply. * @param to_ address to send vTokens to. * @return vtokenAmount_ amount of vTokens sent to the `to_` a...
extra eth/stETH amount to leave in the vault for easier swaps./
function idealExcessAmt() public view returns (uint256) {}
6,644,136
/** *Submitted for verification at Etherscan.io on 2021-08-12 */ // Dependency file: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While...
Return VRF coordinator./
function getVrfCoordinator() external view returns (address) { return vrfCoordinator; }
10,939,693
./full_match/5/0x8a324A30C8ca1E9CFcea267C2116968cAacEd1D6/sources/contracts/OpenNFTsV3.sol
mint minter address of minter jsonURI json URI of NFT metadata
function mintOpenNFT(address minter, string memory jsonURI) external override(IOpenNFTs) onlyMinter returns (uint256) { _tokenIds.increment(); uint256 newItemId = _tokenIds.current(); _safeMint(minter, newItemId); _setTokenURI(newItemId, jsonURI);...
1,907,636
./partial_match/42/0x4E657A526b7f12695A9388b6462CA4eFBF68AC2D/sources/CompoundLeverageModule.sol
MANAGER ONLY: Removes this module from the SetToken, via call by the SetToken. Only callable by SetToken manager. Compound Settings and manager enabled cTokens are deleted. Markets are exited on Comptroller (only valid if borrow balances are zero)/ Sync Compound and SetToken positions prior to any removal action Note: ...
function removeModule() external override { ISetToken setToken = ISetToken(msg.sender); sync(setToken); for (uint256 i = 0; i < compoundSettings[setToken].borrowCTokens.length; i++) { address cToken = compoundSettings[setToken].borrowCTokens[i]; _exitMarket(setToke...
9,090,579
pragma solidity ^0.6.4; pragma experimental ABIEncoderV2; import "../curation/ICuration.sol"; import "../epochs/IEpochManager.sol"; import "../governance/Governed.sol"; import "../token/IGraphToken.sol"; import "../upgrades/GraphProxy.sol"; import "../upgrades/GraphUpgradeable.sol"; import "./IStaking.sol"; import "....
Slash the indexer stake. _indexer Address of indexer to slash _tokens Amount of tokens to slash from the indexer stake _reward Amount of reward tokens to send to a beneficiary _beneficiary Address of a beneficiary to receive a reward for the slashing/ Only able to slash a non-zero number of tokens Rewards comes fro...
function slash( address _indexer, uint256 _tokens, uint256 _reward, address _beneficiary ) external override onlySlasher { Stakes.Indexer storage indexerStake = stakes[_indexer]; require(_tokens > 0, "Slashing: cannot slash zero tokens"); require(_tokens...
5,377,316
/** *Submitted for verification at Etherscan.io on 2021-04-08 */ /// SPDX-License-Identifier: MIT /* ▄▄█ ▄ ██ █▄▄▄▄ ▄█ ██ █ █ █ █ ▄▀ ██ ██ ██ █ █▄▄█ █▀▀▌ ██ ▐█ █ █ █ █ █ █ █ ▐█ ▐ █ █ █ █ █ ▐ █ ██ █ ▀ ▀ */ /// Special thanks to Keno and Boring for rev...
Unstake crXSUSHI `amount` into SUSHI from BENTO for benefit of `to` by batching calls to `bento`, `crXSushiToken` and `sushiBar`.
function unstakeSushiFromCreamFromBentoTo(address to, uint256 amount) external { }
7,942,031
/** *Submitted for verification at Etherscan.io on 2021-09-25 */ // File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap o...
Deposit LP tokens to MasterChef for MMO allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accBgtPerShare).div(1e12).sub(user.rewardDe...
15,390,595
// contracts/TokenVesting.sol // SPDX-License-Identifier: Apache-2.0 // Based on Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts/pr...
Creates a vesting contract that vests its balance of any ERC20 token to the beneficiary, gradually in a linear fashion until start + duration. By then all of the balance will have vested. beneficiary_ address of the beneficiary to whom vested tokens are transferred start_ the time (as Unix time) at which point vestin...
function initialize(address beneficiary_, uint256 start_, uint256 duration_, bool revocable_) external initializer { require(beneficiary_ != address(0), "TokenVesting: beneficiary is the zero address"); require(duration_ > 0, "TokenVesting: duration is 0"); require((start_ + duration_) > blo...
12,575,462
// Wow Internet Labz Pvt. Ltd. (connect@wowlabz.com) pragma solidity ^0.4.15; import './lifecycle/Pausable.sol'; import './math/SafeMath.sol'; import './BloodlineBLCToken.sol'; /** * The BloodlineBLCSale smart contract is used for selling BloodlineBLCToken * tokens (BLC). It does so by converting ETH received into...
The owner can unlock the fund with this function. The use- case for this is when the owner decides after the deadline to allow contributors to be refunded their contributions. Note that the fund would be automatically unlocked if the minimum funding goal were not reached./
function ownerUnlockFund() external afterDeadline onlyOwner { fundingGoalReached = false; }
973,865
./full_match/3/0xeE9977857789b0e41F7F1BB08821BF8eC3017176/sources/contracts/Staking.sol
Return coefficient in decimals. If coefficient more than 1, all holders will be able to receive awards.
function monitorSecurityMargin() external view override onlyOwner returns (uint256) { uint256 _toWithdraw = safeMul(aggregatedNormalizedAmount, getCompoundRate(), _getDecimals()); if (_toWithdraw == 0) return _getDecimals(); return safeMul(token.balanceOf(address(this)), _getDecimals(), _to...
8,208,920
pragma solidity >=0.6.0 <0.8.0; import "./BottoGovernance.sol"; import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; contract BottoGovernanceV2 is BottoGovernance, ReentrancyGuardUpgradeable { using SafeMath for uint256; using TransferHelper for address; uint256 public total...
Sweeps excess tokens to a specified recipient address _token address of token to recover _recipient payable address for token beneficiary Token amount is recovered; only excess non-staked tokens & due rewards in case of BOTTO
function recover(address _token, address payable _recipient) public virtual override onlyOwner nonReentrant { uint256 _balance = IERC20(_token).balanceOf(address(this)); if (_token == botto) { _balance = _balance.sub( totalStak...
1,060,775
./partial_match/42/0x7141e41176B829Da70C4E8a86b264b50268aBF6d/sources/KovandETH.sol
Goals: 1. if the _tokensToRedeem being claimed does not drain the vault to below 160% 2. pull out the amount of ether the senders' tokens entitle them to and send it to them this ensures that the CDP will be boostable by DefiSaver before it can be bitten
function redeem(uint _tokensToRedeem) public { (uint collateralToUnlock, uint fee, uint collateralToReturn) = calculateRedemptionValue(_tokensToRedeem); bytes memory proxyCall = abi.encodeWithSignature( "freeETH(address,address,uint256,uint256)", makerManager, ...
8,842,133
./full_match/100/0x0Ac7ac8C6Eb5BbBEbE2d02E6B6f5B2B8e05759f1/sources/contracts/LP.sol
Get current fee type `feeType` profit share./
function _getFee(FeeType feeType) internal view returns (uint64) { return fees[uint256(feeType)]; }
14,285,442
./full_match/137/0x602f47c53fbd3D6F6783F26E01623cCfd53268D0/sources/main-contract/main-contract/XUSDPrime.sol
Function to set the BMP Violator Charged Text Message
function setPenaltyChargedText(string memory newText) public onlyOwner { penaltyChargedText = newText; }
4,787,729
./full_match/80001/0x04c9158030F4274699E96CDA1155F9589E8DbFCc/sources/contracts/YKR.sol
Collects and distributes the primary sale value of NFTs being claimed.
function _collectPriceOnClaim( address _primarySaleRecipient, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken ) internal override { if (_pricePerToken == 0) { return; } (address platformFeeRecipient, uint16 platformFeeBps) ...
839,832
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.3; import './libs/SafeERC20.sol'; import './libs/Ownable.sol'; import './libs/SafeMath.sol'; /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, with a cliff and vesting pe...
return true if the vesting is revocable./
function getRevocable() external view returns (bool) { return revocable; }
5,463,660
./full_match/3/0xdD68B0bfd32B0AF623AEbCB5b2414A2a7CEccf25/sources/contracts/m.sol
Get a reference to the sale structtransfer tokentransfer amt to seller (remove _networkFees)check if excess is present then transfer back
function purchaseToken(uint256 _tokenId) external payable { SaleData storage saleData = tokenIdToSale[_tokenId]; require(msg.value>=saleData.sellingPrice); address payable _sellerWallet = payable(saleData.seller); address payable _buyerWallet = payable(msg.sender); _transfe...
8,220,316
./full_match/1/0xFbeC16EECD4558297FB3deA9934A162Ef76b14bd/sources/src/bases/SafeModule.sol
Executes a transaction through the target intended to be executed by the avatar and returns the call status and the return data of the call to Address being called value Ether value being sent data Calldata operation Operation type of transaction: 0 = call, 1 = delegatecall/
function _moduleExecAndReturnData(address to, uint256 value, bytes memory data, ISafe.Operation operation) internal returns (bool success, bytes memory returnData) { return safe().execTransactionFromModuleReturnData(to, value, data, operation); }
3,085,366
./full_match/1/0xe92B32D8F55564E0EeDbD665ffd810Cc918f5627/sources/src/oracles/ProxyOracle.sol
Check the last exchange rate without any state changes @inheritdoc IOracle
function peek(bytes calldata data) public view override returns (bool, uint256) { return oracleImplementation.peek(data); }
4,991,213
./partial_match/1/0x6601d3f885D1A91FfE63B4b4A834Cf9E2490C2D8/sources/src/settled-physical/CrossMarginPhysicalEngine.sol
solhint-disable-next-line reason-string
function initialize(address _owner) external initializer { if (_owner == address(0)) revert(); _transferOwnership(_owner); __ReentrancyGuard_init_unchained(); initialDomainSeparator = _computeDomainSeparator(); } Override Upgrade Permission
4,198,915
./partial_match/42/0xCa01f0cf66Df67a2B4629dC0482FA6a82d06C5D8/sources/assignmentToken.sol
TODO: transfer `_value` tokens from `_from` to `_to` NOTE: `_from` needs to have enough tokens and to have allowed sender to spend on his behalf NOTE: transfer value needs to be sufficient to cover fee
function transferFrom(address _from,address _to,uint256 _value) public returns (bool) { require(_transferFrom(_from,msg.sender,_value)); require(_transfer(_from,_to,_value)); return true; }
9,062,751
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) {...
Add a new LP to the pool. Can only be called by the owner. DO NOT add the same LP token more than once. Rewards will be messed up if you do. allocPoint AP of the new pool. _lpToken Address of the LP ERC-20 token. _rewarder Address of the rewarder delegate.
function add(uint256 allocPoint, IERC20 _lpToken, IRewarder _rewarder, IStrategy _strategy, uint256 _depositFee, bool _withUpdate) public onlyOwner nonDuplicated(_lpToken){ if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number; totalAllocPoint = t...
13,737,316
//-------------DEPENDENCIES--------------------------// // 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 on the compil...
Mints a token to an address with a tokenURI. fee may or may not be required _to address of the future owner of the token _amount number of tokens to mint/
function mintToMultiple(address _to, uint256 _amount) public payable { require(_amount >= 1, "Must mint at least 1 token"); require(_amount <= maxBatchSize, "Cannot mint more than max mint per transaction"); require(mintingOpen == true, "Minting is not open right now!"); req...
14,731,452
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "./SafeMath.sol"; import "./IUniswapV2Router02.sol"; import "./IUniswapV2Factory.sol"; import "./IFactoryV2.sol"; import "./IERC20.sol"; import "./IUniswapV2Pair.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; contrac...
todo max whale fees
function setWhaleFeesPercentage(uint256 _whaleFeePercent) external onlyOwner { whaleFeePercent = _whaleFeePercent; }
12,942,782
/** * Copyright BOOSTRY Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing,...
譲渡可否を更新 発行体のみ実行可能 _transferable 譲渡可否
function setTransferable(bool _transferable) public override onlyOwner() { transferable = _transferable; }
1,066,370
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; import "@...
It allows the admin to recover wrong tokens sent to the contract _tokenAddress: the address of the token to withdraw _tokenAmount: the number of tokens to withdraw This function is only callable by admin./
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner { require( _tokenAddress != address(stakedToken), "Cannot be staked token" ); require( _tokenAddress != mapOfRewardTokens[TOKEN1] && ...
15,872,120
pragma solidity ^0.4.24; /* ******************** https://mobstreet.me/exchange ******************** * * * ███╗ ███╗ ██████╗ ██████╗ * ████╗ ████║██╔═══██╗██╔══██╗ * ██╔████╔██║██║ ██║██████╔╝ * ██║╚██╔╝██║██║ ██║██╔══██╗ ...
add tokens to the pool take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder calculate the amount of tokens the customer receives over his purchase add tokens to the pool
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) antiEarlyWhale(_incomingEthereum) internal returns(uint256) if(tokenSupply_ > 0){ tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); profitPerShare_ += (_dividends * magnitude ...
6,846,174
./full_match/11155111/0x1b502402EB8fD08e657a4a2Bd6424AEc899D3c38/sources/contracts/core/base/ERC721Time.sol
Refactored from the original OZ ERC721 implementation: approve or revoke approval from `operator` to operate on all tokens owned by `owner`. Emits a {ApprovalForAll} event./
function _setOperatorApproval( address owner, address operator, bool approved ) internal virtual { _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); }
3,800,587
./partial_match/1/0xeF0dfe8cF872B4dF3681Ad37A17Ef5e2D473B877/sources/SCMinter.sol
Removes stablecoin from the list of valid tokens Stablecoins can't be removed from the list of minted tokens to protect users: they can always be redeem once created.
function removeStablecoin(address token) external onlyOwner onlyValidTokens(token) { validTokens[token] = false; }
4,037,163
/** *Submitted for verification at Etherscan.io on 2022-02-19 */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0; // File: soulswap-core/contracts/interfaces/IERC20.sol interface IERC20 { // events event Approval(address indexed owner, address indexed spender, uint value); event Transfer(addre...
refund dust eth, if any
function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable virtual override ensure(deadline) returns ( ...
15,255,343
./partial_match/42/0x82eb7e525E6E4E8aa6Ba8A8C9B228C0419DE94B7/sources/REFLECTmxx.sol
Destroys `amount` tokens from message sender, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address./
function burn(uint256 amount) public virtual { _beforeTokenTransfer(msg.sender, address(0), amount); _balances[msg.sender] = _balances[msg.sender].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(msg.sender, address(0), amount)...
3,302,406
./full_match/122/0xFAE02d404c327A1Eb2fB38eb89C38860a02D70e6/sources/contracts/LiquidStakingPool.sol
Set Unpause can only be called if currently paused/
function _unpause() internal whenStopped { _paused = false; }
16,366,206
./full_match/11155111/0x1A1F1D20C404D9C2399a56166256d25fe3e2A93D/sources/contracts/SubscriptionsCollection.sol
Returns the deadline for the payment of a subscription. tier: subscription tier subscriptionOwner: subscription owner/
function getSubscriptionDeadline(uint256 tier, address subscriptionOwner) public view onlyExistentSubscription(tier, subscriptionOwner) returns (uint256 deadline) { return _subscriptions[subscriptionOwner][tier].deadline; }
3,804,124
./full_match/100/0x99cff71Da8FB4Af922f94874d76DAd24F741Bc6F/sources/contracts/Core.sol
Indicate the condition `conditionId` with oracle ID `oracleConditionId` as canceled. Set oracleCondId to zero if the function is not called by an oracle. conditionId the current match or game ID oracleCondId the current match or game ID in oracle's internal system/
function cancel(uint256 conditionId, uint256 oracleCondId) internal { Condition storage condition = conditions[conditionId]; if (condition.timestamp == 0) revert ConditionNotExists(); if ( condition.state == ConditionState.RESOLVED || condition.state == ConditionState...
14,281,625
./full_match/80001/0x8D2C372317524a8Af5313883434411fd3DAE55d9/sources/contracts/lib/Executor.sol
Internal function to transfer ERC1155 tokens from a given originator to a given recipient. Sufficient approvals must be set, either on the respective conduit or on this contract itself. token The ERC1155 token to transfer. from The originator of the transfer. to The recipient of the t...
function _transferERC1155( address token, address from, address to, uint256 identifier, uint256 amount, bytes32 conduitKey, bytes memory accumulator ) internal { _assertNonZeroAmount(amount); _triggerIfArmedAndNotAccumulatable(accumulator,...
878,165
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import "./SpookyToken.sol"; ...
Good practice to update pools without messing up the contract This MUST be done or pool rewards will be calculated with new boo per second This could unfairly punish small pools that dont have frequent deposits/withdraws/harvests
function setBooPerSecond(uint256 _booPerSecond) external onlyOwner { massUpdatePools(); booPerSecond = _booPerSecond; }
14,125,291
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import { DSTest } from "ds-test/test.sol"; import { Hevm } from "./Hevm.sol"; /// @notice Extended testing framework for DappTools projects. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/test/utils/DSTestPlus.sol) contrac...
Ensure max is inclusive in cases where x != 0 and max is at uint max. Account for decrementing x to make max inclusive.
function bound( uint256 x, uint256 min, uint256 max ) internal pure returns (uint256 result) { require(max >= min, "MAX_LESS_THAN_MIN"); uint256 size = max - min; if (x < min) x += size * (((min - x) / size) + 1); result = min + ((x - min) % size); if (max == type(uint256).max && x != 0) result++;...
907,717
./partial_match/1/0x762169c7040875EA0925367d7feC1071C7F27c20/sources/ANONYMOUS.sol
solhint-disable-next-line no-inline-assembly
function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; return (codehash != accountHash && codehash != 0x0); }
15,548,464
pragma solidity ^0.4.19; contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x); } function mul(uint x, uint y) internal pure returns (uint z...
`msg.sender` approves `_spender` to spend `_amount` tokens on its behalf. This is a modified version of the ERC20 approve function to be a little bit safer _spender The address of the account able to transfer the tokens _amount The amount of tokens to be approved for transfer return True if the approval was success...
function approve(address _spender, uint256 _amount) returns (bool success) { if (isContract(controller)) { if (!TokenController(controller).onApprove(msg.sender, _spender, _amount)) revert(); } return super.approve(_spender, _amount); }
566,301
pragma solidity 0.5.12; contract compraVendaImovel { //dados do Vendedor string public nomeVendedor; string public rgVendedor; string public cpfVendedor; address payable carteiraVendedor; event pagamentoRealizado (uint valor); //dados do cpfComprador string publ...
dados do Vendedordados do cpfComprador dados do imovel
{ string public nomeVendedor; string public rgVendedor; string public cpfVendedor; address payable carteiraVendedor; event pagamentoRealizado (uint valor); string public nomeComprador; string public rgComprador; string public cpfComprador; address...
12,536,815
// SPDX-License-Identifier: GPL-3.0 /// @title The Degen Glads auction house // LICENSE // // GladsAuctionHouse.sol is a modified version of Nounders DAO's NounsAuctionHouse.sol: // https://github.com/nounsDAO/nouns-monorepo/blob/8f614378f93c1f6fec35a254eb424f70e84925dd/packages/nouns-contracts/contracts/NounsAuction...
Unpause the Glads auction house. This function can only be called by the owner when the contract is paused. If required, this function will start a new auction./
function unpause() external override onlyOwner { _unpause(); if (auction.startTime == 0 || auction.settled) { console.log("createAuction"); _createAuction(); } }
12,911,041
// SPDX-License-Identifier: UNLICENSED // test pragma solidity ^0.8.0; import "./Profile.sol"; import "./Trace.sol"; contract ProductSC { // state management //1. Machine State for the product contract // 1 Activated = The participants can use functions in the product contract. // 0 Deactivated = The...
3. For Logistic process (The third node of one-line supply chain)Scope Manufacturer sends the product to the chosen Logistic or Oracle. Valiadation 1. msg.sender account type = manufacturer 2. receiver = retailerId 3. logistic = logistic or oracle set product contract addresstrace.setProductContractAddress(address(this...
function sendProduct( uint256 _pid, address receiver, address logistic, string memory trackingNumber ) public isProductIdExist(_pid) OnlyProductReadyToSend(_pid) isManufacturerOnly onlyActivatedMachineState { require( ...
6,447,206
//Address: 0x19e059dbc65cae13253541935612bdb433508524 //Contract name: GCToken //Balance: 0 Ether //Verification Date: 5/7/2018 //Transacion Count: 6 // CODE STARTS HERE pragma solidity ^0.4.21; // File: node_modules\zeppelin-solidity\contracts\ownership\Ownable.sol /** * @title Ownable * @dev The Ownable contra...
Update the end of ICO time. _icoEndTime Expected ICO end time/
function setIcoEndTime(uint _icoEndTime) public onlyOwner { require(_icoEndTime >= now); icoEndTime = _icoEndTime; }
2,525,870
pragma solidity 0.6.10; pragma experimental ABIEncoderV2; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warn...
A new gas measurement is performed inside innerRelayCall, since due to EIP150 available gas amounts cannot be directly compared across external calls This external function can only be called by RelayHub itself, creating an internal transaction. Calls to the recipient (preRelayedCall, the relayedCall, and postRelayedCa...
function innerRelayCall( GsnTypes.RelayRequest calldata relayRequest, bytes calldata signature, bytes calldata approvalData, IPaymaster.GasLimits calldata gasLimits, uint256 totalInitialGas, uint256 maxPossibleGas ) external returns (RelayCallStat...
7,427,915
./partial_match/1/0x08E1451D4f34cD67E9b4647bCcb251483EeeC6D7/sources/MultiSigStub.sol
Allows to replace an owner with a new owner. Transaction has to be sent by wallet. owner Address of owner to be replaced. owner Address of new owner.
function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i = 0; i < owners.length; i++) { if (owners[i] == owner) { owners[i] = newOwner; break; ...
9,309,983