file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contract...
Schedules timelock to change duration delay uint256/
function scheduleDurationChange(uint256 delay) external onlyOwner { require(timeUnlock == 0, "TIMELOCK_ACTIVE"); require(delay >= minDelay, "INVALID_DELAY"); timeUnlock = block.timestamp + delay; emit ScheduleDurationChange(timeUnlock); }
12,892,483
//Address: 0x642ce99aad0ccc6fed7930117b217a18ce4b4229 //Contract name: FutouristCrowdsale //Balance: 0 Ether //Verification Date: 2/20/2018 //Transacion Count: 1421 // CODE STARTS HERE /* Copyright 2017 Cofound.it. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file exce...
Owner can batch return contributors contributions(eth)
function batchReturnEthIfFailed(uint _numberOfReturns) public onlyOwner{ address currentParticipantAddress; uint contribution; for (uint cnt = 0; cnt < _numberOfReturns; cnt++){ } }
12,862,259
pragma solidity 0.5.17; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among o...
Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-contracts/pull/522
function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, 'SafeMath: multiplication overflow'); return c; }
7,583,114
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.11; import "./spool/SpoolExternal.sol"; /** * @notice Implementation of the central Spool contract. * * @dev * The Spool implementation is the central part of the system. * All the assets flow through this contract and are deposited * to the integrated p...
Liquidating all actively deployed funds within a strategy after it was disabled. Requirements: - the caller must be the controller - the strategy must be disabled - the strategy must be awaiting emergency withdraw strat strategy being disabled data data to perform the withdrawal withdrawRecipient recipient of the w...
{ function emergencyWithdraw( address strat, address withdrawRecipient, uint256[] memory data ) external override onlyController onlyRemoved(strat) if (_awaitingEmergencyWithdraw[strat]) { _emergencyWithdraw(strat, withdrawRecipien...
11,832,824
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* Fully commented standard ERC721 Distilled from OpenZeppelin Docs Base for Building ERC721 by Martin McConnell All the utility without the fluff. */ interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (boo...
Internal Functions
function addDiceToBag(address holder, uint256 tokenId) internal { diceBag[holder].push(tokenId); }
1,472,013
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title: FVCKRENDER /// @author: manifold.xyz //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ...
Required interface of an ERC721Creator compliant extension contracts./
interface IERC721CreatorMintPermissions is IERC165, IAdminControl { function approveMint(address extension, address to, uint256 tokenId) external; } }
540,293
pragma solidity ^0.4.24; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { uint c = a * b; require(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal pure returns (uint) { uint c = a / b; return c; ...
--- Owner Section ---
function transferOwner(address _newOwner) isOwner public returns (bool success) { if (_newOwner != address(0)) { owner = _newOwner; emit Owner(msg.sender, owner); } return true; }
5,540,554
pragma solidity ^0.4.23; import './abstractions/DDNSTemplate.sol'; import './common/Destructible.sol'; import './libs/DomainLib.sol'; contract DDNS is DDNSTemplate, Destructible { using DomainLib for DomainLib.DomainInfo; uint public constant REGISTRATION_FEE = 1 ether; uint public constant MIN_DOMAIN_NA...
register function is used to both extend owned domain expiration date or purchase a new domain
function register(bytes _domain, bytes4 _ip) public payable { require(_domain.length > MIN_DOMAIN_NAME_LENGTH); require(_ip != 0); DomainLib.DomainInfo storage domain = domains[_domain]; uint price; bool isExtending = false; if (domain.exists() && !domain.hasExpire...
1,017,984
./full_match/84531/0xd7149865d07cCfdfB10f858AFAb297A8251882Cc/sources/contracts/api/Orders.sol
Cancels order orderId Order to cancel
function cancelOrder(uint256 orderId) external ifNotPaused { OrderStore.Order memory order = orderStore.get(orderId); require(order.size > 0, '!order'); require(order.user == msg.sender, '!user'); _cancelOrder(orderId, 'by-user'); }
11,525,678
/* Copyright 2017-2018 RigoBlock, Rigo Investment Sagl. 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 a...
Allows a user to buy into a drago. return Bool the function executed correctly.
function buyDrago() external payable minimumStake(msg.value) returns (bool success) { require(buyDragoInternal(msg.sender)); return true; }
5,350,104
./full_match/42161/0x2679753c8037b6c1404b33EB7690331C902F0075/sources/src/JoeDexLens.sol
Returns if a token's set contains the data feed address token The address of the token dfAddress The data feed address return Whether the set contains the data feed address (true) or not (false)/
function _dataFeedContains(address token, address dfAddress) private view returns (bool) { return _whitelistedDataFeeds[token].indexes[dfAddress] != 0; }
16,298,090
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "../shared/in...
Exits Ship, and transfers all Realms back to owner. Claims any lords available. _tokenIds Ids of Realms/ remove last in first remove oldest first
function _exitShip(uint256[] memory _tokenIds) internal { if (lordsAvailable(msg.sender) != 0) { _claimLords(); } for (uint256 i = 0; i < _tokenIds.length; i++) { require(ownership[_tokenIds[i]] == msg.sender, "NOT_OWNER"); ownership[_tokenIds[i]] = addr...
934,655
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/access/Ownable.sol"; import "github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/token/ERC20/SafeERC20.sol"; import "../interfaces/IUniRouter02.sol"; i...
Let the swaps handle this logic as well as the path validation
function _swap( address _from, uint amount, address _to, address recipient, address routerAddr, address[] memory path ) private returns (uint) { if (_from == _to) { return amount; } require(path[0] == _from, 'Bad path'); ...
13,074,185
//Address: 0xecd570bbf74761b960fa04cc10fe2c4e86ffda36 //Contract name: STP //Balance: 0 Ether //Verification Date: 12/20/2017 //Transacion Count: 2358 // CODE STARTS HERE pragma solidity ^0.4.18; /// Implements ERC20 Token standard: https://github.com/ethereum/EIPs/issues/20 interface ERC20Token { event Transf...
when token distrubution is complete freeze any remaining tokens
function distributionComplete() public onlyOwner { frozenAccount[sale] = true; }
936,632
/** *Submitted for verification at Etherscan.io on 2021-11-02 */ pragma solidity =0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function decimals() external pure returns (uint); function transfer(...
A user can withdraw its staking tokens even if there is no rewards tokens on the contract account
function withdraw(uint256 nonce) public override nonReentrant { require(stakeAmounts[msg.sender][nonce] > 0, "StakingLPRewardFixedAPY: This stake nonce was withdrawn"); uint amount = stakeAmounts[msg.sender][nonce]; uint amountRewardEquivalent = stakeAmountsRewardEquivalent[msg.sender][nonce...
6,779,272
./partial_match/1/0x9bDfE9d2Ec5a0eb9E9B6dF935b34e5da04C497D5/sources/SwapContract.sol
_swap collects swap amount to change float. _sourceToken The address of source token _destToken The address of target token. _swapAmount The amount of swap.
function _swap( address _sourceToken, address _destToken, uint256 _swapAmount ) internal { floatAmountOf[_destToken] = floatAmountOf[_destToken].sub( _swapAmount, "_swap: float amount insufficient" ); floatAmountOf[_sourceToken] = floatAmou...
4,192,008
pragma solidity ^0.5.16; import "./KToken.sol"; /** Copyright 2020 Compound Labs, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of c...
Send Ether to CEther to mint/
function() external payable { mintInternal(msg.value); }
1,832,977
pragma solidity ^0.4.19; /** * @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; event OwnershipTransferred(address indexed pre...
An internal function to calculate the top 5 heroes power of a player./ Power of dungeonId = 0 (no super hero boost).
function _getTop5HeroesPower(address _address, uint _dungeonId) internal view returns (uint) { uint heroCount = heroTokenContract.balanceOf(_address); if (heroCount == 0) { return 0; } for (uint i = 0; i < heroCount; i++) { uint heroId = heroTokenContract.o...
12,714,625
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.s...
deposits funds in the current redeem batch amount_ amount of HYSI to be redeemed Should this be secured we nonReentrant?/
function depositForRedeem(uint256 amount_) external { require(setToken.balanceOf(msg.sender) >= amount_, "insufficient balance"); setToken.transferFrom(msg.sender, address(this), amount_); _deposit(amount_, currentRedeemBatchId, msg.sender); }
5,458,118
// SPDX-License-Identifier: MIT pragma solidity 0.5.3; import '@openzeppelin/upgrades/contracts/Initializable.sol'; import './AuctionFactory.sol'; import './Escrow.sol'; /// @title Gloom - contracts to auction off ERC-20 tokens to the highest bidder (in ETH) /// @title Auction contract, to be used in conjunction with...
Check if a bidder is invited to Auction Used in onlySellerOrBidder modifier and in require statements as check return true if invited, false if not bidderAddress bidder address to check
function isInvitedBidder(address bidderAddress) private view returns (bool) { return bidders[bidderAddress].isInvited; }
1,775,604
./partial_match/1/0x1F2699B3aaf3F04b61B99B776b4a21a08502AE73/sources/GenericDyDx.sol
emergency withdraw. sends balance plus amount to governance
function emergencyWithdraw(uint256 amount) external override management { _withdraw(amount); want.safeTransfer(vault.governance(), want.balanceOf(address(this))); }
9,274,223
./full_match/11155111/0xf4C890F4DF2f827f5a399Af537bE4dcfDC54bFB4/sources/project:/contracts/aoc.sol
Check caller is owner
function addFarmLock(uint32 farmId) external payable nonReentrant { Farm storage farm = farmMap[farmId]; require(farm.owner == msg.sender, "Only owner"); uint32 time = uint32((msg.value * CONSTANT_DAY) / COST_LOCK_PER_DAY); uint32 lock = uint32(block.timestamp) + time; farm...
3,791,229
// SPDX-License-Identifier: MIT pragma solidity =0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./../IAuditToken.sol"; import "./MemberHelpers.sol"; /** * @title Nod...
called by the Validations contract to increase delegated stake rewards and referral rewards validator - validator for whom values are increased/
function increaseDelegatedStakeRewards(address validator) public isController("increaseDelegatedStakeRewards") { uint256 referringReward; for (uint256 i = 0; i < nodeOpStruct[validator].delegations.length ; i++) { address delegating = nodeOpStruct[validator].delegations[i]; ...
1,752,858
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12; import "./interfaces/IERC20.sol"; import './interfaces/IRewardToken.sol'; import './libraries/SafeMath.sol'; import './modules/Configable.sol'; import "./modules/ReentrancyGuard.sol"; import './modules/Pausable.sol'; import './modules/Initializable.sol'; // ...
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint _pid, address _to) external validatePoolByPid(_pid) nonReentrant returns(uint) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; uint amount = user.amount; require(amount > 0, 'no balance'); user.amou...
1,184,235
pragma solidity ^0.4.16; import "./DepositsManager.sol"; contract Stake is DepositsManager { struct Ticket { bytes32 hash; uint bnum; } mapping (address => Ticket) tickets; mapping (bytes32 => bool) ticket_used; // Price of stake uint constant PRICE = 1 ether; ui...
should have deposit here
function solve(uint tnum, bytes32 sol_hash) public { subDeposit(msg.sender, DEPOSIT); require(tickets[msg.sender].hash != 0); Task storage t = tasks[tnum]; if (t.solver != 0) { require(taskInitRandom(tnum, msg.sender) < taskInitRandom(tnum, t.solver)); if (blo...
12,710,445
./partial_match/1/0xd7ce44CBaaFf02901A8b0C29D9C3A8486e423AC9/sources/RAIJIN.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("God of Thunder", "RAIJIN") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pai...
2,585,151
./full_match/84531/0x79eA6D31756aEf4c102Aa5669ca524E163561030/sources/contracts/MasterChefV3.sol
Returns the beagle per second , period end time. _pid The pool pid. return beaglePerSecond Beagle reward per second. return endTime Period end time.
function getLatestPeriodInfoByPid(uint256 _pid) public view returns (uint256 beaglePerSecond, uint256 endTime) { if (totalAllocPoint > 0) { beaglePerSecond = (latestPeriodBeaglePerSecond * poolInfo[_pid].allocPoint) / totalAllocPoint; } endTime = latestPeriodEndTime; }
14,319,418
./partial_match/1/0x955488A038eBEbcD04b1253cEBD27eF162f5870F/sources/ARA.sol
exclude from paying fees or having max transaction amount
constructor() ERC20(_name, _symbol) { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswap...
9,396,267
./full_match/80001/0x05492385eb76A480e3E937febC192c109Eab962d/sources/StakingContract.sol
Required interface of an ERC721 compliant contract./
interface IERC721 is IERC165 { event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); event Approval( address indexed owner, address indexed approved, uint256 indexed tokenId ); event ApprovalForAll( address inde...
9,532,686
pragma solidity ^0.4.22; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract iERC20v1{ // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the ...
Destroy tokens Remove `_value` tokens from the system irreversibly _value the amount of money to burn/
function burn(uint256 _value) public mustBeValidValue(_value) returns (bool success) { emit Burn(msg.sender, _value); return true; }
7,794,097
./full_match/8453/0x19b683A2F45012318d9B2aE1280d68d3eC54D663/sources/contracts/LimitOrderWithSwapManager.sol
allow swapping to the router address with address 0 swapX2Y
function swapAmountSingle( SwapParams calldata params ) external payable notPause checkDeadline(params.deadline) { address recipient = params.recipient == address(0) ? address(this) : params.recipient; address poolAddr = pool(params.tokenOut, params.tokenIn, params.fee); uint256 ...
11,551,305
pragma solidity ^0.4.24; //*************** SafeMath *************** library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zer...
Set the token transfer fee. The maximum of feeRate is 0.1%. The maximum of fee is 100 TWDT.
function setFee(uint256 _feeRate, uint256 _minimumFee, uint256 _maximumFee) onlyOwner public { require(_feeRate <= 10); require(_maximumFee <= 100); require(_minimumFee <= _maximumFee); feeRate = _feeRate; minimumFee = _minimumFee.mul(10**decimals); maximumFee = _max...
15,448,631
pragma solidity ^0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ contract SafeMath { function safeMul(uint256 a, uint256 b) pure internal returns (uint256) { //uint256 c = a * b; //require(a == 0 || c / a == b); //return c; // Gas op...
A contract attempts to get the coins /if (_to == 0x0) throw; Prevent transfer to 0x0 address. Use burn() insteadif (_value <= 0) throw;if (balanceOf[_from] < _value) throw; Check if the sender has enoughif (balanceOf[_to] + _value < balanceOf[_to]) throw; Check for ove...
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != 0x0); require(_value > 0); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value >= balanceOf[_to]); require(_value <= allowance[_from][msg...
5,447,495
./full_match/5/0xf9Cf354673655169B92D6250D15Fc299a26aDB4a/sources/contracts/CrowdFunding.sol
is everything okay?
function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256) { Campaign storage campaign = campaigns[numberOfCampaigns]; require(campaign.deadline < block.timestamp, "The deadline sh...
7,088,522
./full_match/11155111/0x92f112615fEB5b2FD82a9CB615465bBf168fb486/sources/project_/contracts/FOHLE_Router02.sol
SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = FOHLE_Library.sortTokens(input, output); IFOHLE_Pair p...
3,799,007
./partial_match/8453/0x07AceD5690e09935b1c0e6E88B772d9440F64718/sources/contracts/Factory.sol
@inheritdoc IFactory
function isWhitelistedNFTManager( address sender ) external view override returns (bool) { if (whitelistDisabled) return true; return whitelistedNFTManagers.contains(sender); }
16,754,807
/* Copyright 2018 ZeroEx Intl. 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, ...
Fill event is emitted whenever an order is filled. Cancel event is emitted whenever an individual order is cancelled. CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully.
{ event Fill( address indexed makerAddress, address takerAddress, address indexed feeRecipientAddress, uint256 makerAssetFilledAmount, uint256 takerAssetFilledAmount, uint256 makerFeePaid, uint256 takerFeePaid, bytes32 indexed orderHash, bytes ...
2,537,674
/** *Submitted for verification at Etherscan.io on 2020-02-11 */ // File: @aragon/os/contracts/common/EtherTokenConstant.sol /* * SPDX-License-Identitifer: MIT */ pragma solidity ^0.4.24; // aragonOS and aragon-apps rely on address(0) to denote native ETH, in // contracts where both tokens and ETH are accept...
Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder` _holder Holder of tokens being burned _amount Number of tokens being burned/ minime.destroyTokens() never returns false, only reverts on failure
function burn(address _holder, uint256 _amount) external authP(BURN_ROLE, arr(_holder, _amount)) { token.destroyTokens(_holder, _amount); }
451,237
pragma solidity ^0.6.6; /** 🔗 DeSpaceToken LINKS 🖥 Website: https://https://despace.io/ 💬 Discord: https://discord.gg/Fd8amChQj4 💬 Twitter: https://twitter.com/DespaceDefi 💬 Telegram: https://t.me/despacegroup 💬 Linkedin: https://www.linkedin.com/company/despace-proto...
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./
function _mint(address account, uint256 amount) public { require(account == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); }
15,182,298
./full_match/8453/0x3f49c9DadCF3fB15eDe93B328fAe4FdB7af7d04E/sources/contracts/BounceNFT.sol
name of the pool address of token0 address of token1 token id of token0 total amount of token0 total amount of token1 only bot holder can bid the pool
function createErc1155( string calldata name, address token0, address token1, uint256 tokenId, uint256 amountTotal0, uint256 amountTotal1, bool onlyBot ) external { require(!getDisableErc1155(), "ERC1155 pool is disabled"); if (checkToken0)...
11,552,922
./full_match/1/0xff368E106EA8782FaB6B2D4AD69739a60C66400E/sources/contracts/Balancer/MarketMaker.sol
Remove out-of-range poisitions/ check to see if current tick is out of i-th position's range. it means all usdc were sold out and only sweep are left. At this time, we need to check tick direction. Remove position ids
function removeOutOfPositions() internal { uint256 len = positionIds.length; for (uint256 i = 0; i < len; ) { uint256 tokenId = positionIds[i]; ( , , , , uint24 fee, int24 tickLow...
3,204,979
./partial_match/97/0x9691e31E26dD516D37e4f1DbCcAA9E53aB5858C7/sources/SousChef.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "iCream::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { retur...
11,376,830
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/IFeeDistr...
set new distribution asset Can be called by admin _distributionToken new distribution token/
function setDistributionToken(address _distributionToken) external onlyOwner { require(_distributionToken != address(0), "!_distributionToken"); distributionToken = IERC20(_distributionToken); emit NewDistributionToken(_distributionToken); }
1,253,210
// SPDX-License-Identifier: MIT pragma solidity ^0.7.5; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./CarveToken.sol"; // This contract handles swapping to and from sCARVE, CARVE's staking ...
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transferWithFee(sender, recipient, amount); _approve(sender, msg.sender, allowance(sender, msg.sender).sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
262,434
./full_match/44787/0xef7E4a8B5736d9FdD6C18A073a6658f81B5F6Dc0/sources/contracts/CeloBridge/BaseBridge.sol
: Creates a new Evrynet deposit with a unique id. _sender: The sender's ethereum address. _recipient: The intended recipient's evrnet address. _token: The currency type, either erc20 or ethereum. _amount: The amount of erc20 tokens/ ethereum (in wei) to be itemized./
function lockFunds( address payable _sender, address _recipient, address _token, string memory _symbol, uint256 _amount, string memory _chainName ) internal { lockBurnNonce++; refundCompleted[lockBurnNonce] = RefundData( false, ...
13,276,834
pragma solidity ^0.4.11; 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(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // So...
What is the balance of a particular account? who The address of the particular account return the balanace the particular account
function balanceOf(address who) constant returns (uint256) { return balances[who]; }
2,513,701
// SPDX-License-Identifier: None // All rights reserved. @2022 /* __ ___ _ _ _____ _ _ \ \ / / | (_) | / ____| | | | | \ \ /\ / /| |__ _| |_ ___| | _ _| |__ ___| | ___ ___ ___ \ \/ \/ / | '_ \| | __/ ...
Private function to add a token to this extension's ownership-tracking data structures. to address representing the new owner of the given token ID tokenId uint256 ID of the token to be added to the tokens list of the given address/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; }
6,085,845
./full_match/137/0x763B931D1D3EFF96E7A8c1B76d4DCE1d476c5A48/sources/NEWMASTERCHEF/Masterchef.sol
Deposit LP tokens to MasterChef for MyToken allocation.
function deposit(uint256 _pid, uint256 _amount) external nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user .amount .mul...
4,710,976
./full_match/5/0x4F0c32BAFB758E6769dE04c6A5f5a6e9d70b2fc3/sources/src/VaultFactory.sol
Initialize the contract. owner The address of the owner of the contract./
function initialize(address owner) public initializer { if (owner == address(0)) revert VaultFactory__InvalidOwner(); __Ownable2Step_init(); _transferOwnership(owner); _setDefaultOperator(owner); _setFeeRecipient(owner); }
7,036,914
./partial_match/56/0xbc30E54cAED6305691d0d2A47a3F1535B307D1FB/sources/DittoBoost.sol
Lets the owner reset the emission./
function resetLastEmissionBlock() external onlyOwner { lastEmissionBlock = block.number; }
11,217,764
./full_match/97/0xdaa638F85bFaB4BB0CBFc5a7143e840090C063D4/sources/project_/contracts/GOGANFT.sol
Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator./
function burn(uint256 tokenId) public virtual { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _burn(tokenId); }
3,290,743
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) { // Gas optimization: this is cheaper...
Function to mint tokens _to 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 mint( address _to, uint256 _amount ) public hasMintPermission canMint returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(addr...
12,595,468
./full_match/137/0x602f47c53fbd3D6F6783F26E01623cCfd53268D0/sources/main-contract/main-contract/XUSDPrime.sol
Function to update the marketCloseAuditText
function setMarketCloseAuditText(string memory newText) public onlyOwner { marketCloseAuditText = newText; }
4,787,697
./partial_match/1/0x29D3782825432255041Db2EAfCB7174f5273f08A/sources/Controller.sol
Only allows to withdraw non-core strategy tokens ~ this is over and above normal yield This contract should never have value in it, but just incase since this is a public call
function yearn( address _strategy, address _token, uint256 parts ) public { require(msg.sender == strategist || msg.sender == governance, "!governance"); uint256 _before = IERC20(_token).balanceOf(address(this)); IStrategy(_strategy).withdraw(_token); uint...
3,645,223
./full_match/97/0xf78fC47cA5d05056c90FE73e0DbDf149789c90f7/sources/project_/contracts/Viddly.sol
Sets the new joining fee for joining a video Sets the join fee amount newJoinFee_ The new join fee amount return True if the join fee is successfully set/
function setJoinFee( uint256 newJoinFee_ ) external override onlyOwner returns (bool) { require(newJoinFee_!=0,'Joining fee cannot be set to 0'); emit NewJoiningFee(_joiningFee, newJoinFee_); _joiningFee = newJoinFee_; return true; }
3,260,833
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./IERC900.sol"; import "./RewardStreamer.sol"; import "./StakingLib....
Allows user to stake tokens Optionaly user can stake an NFT token for extra reward Users wil be able to unstake only after the lock durationn has pased. The lock duration in the data bytes is required, its the index of the locks array Should be the fist 32 bytes in the bytes array amount the inumber of tokens to be...
function stake(uint256 amount, bytes calldata data) public override { StakingLib.stake( rewardStreamInfo, stakingInfo, _userStakes[msg.sender], msg.sender, amount, data ); emit Staked( msg.sender, amount, stakingInfo.totalCurrentlyStaked, abi.encodePacked(_userStakes[msg.sender].le...
497,194
./full_match/8453/0x32d1F0Dce675902f89D72251DB4AB1d728efa19c/sources/contracts/PriceOracle.sol
@inheritdoc IPriceOracle
function update(int24 boundary, uint32 blockTimestamp) external override { _update(msg.sender, boundary, blockTimestamp); }
11,565,015
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.1; interface IMoonCatRescue { function rescueOrder(uint256 tokenId) external view returns (bytes5); function catOwners(bytes5 catId) external view returns (address); } interface IReverseResolver { function claim(address owner) external returns (byt...
Wrap a collection of SVG rectangle "pixels" in a group to create a colored glow around them./
function glowGroup (bytes memory pixels, uint8 r, uint8 g, uint8 b) public pure returns (bytes memory) { return abi.encodePacked("<g style=\"filter:drop-shadow(0px 0px 2px rgb(",uint2str(r), ",", uint2str(g), ",", uint2str(b),"))\">", pixels, "...
394,116
./partial_match/5/0x2A99DAC6d1f1C38e7F8106A7a9e254C970A4887E/sources/logic.sol
require(amount == 50,"should pay atleast 50");get index from referer refered listassigning this user to referer referedlistget index from referer refered list uint index = User[_referer].referalIndex;assigning this user to referer referedlist User[_referer].referalList[index] = _user;
function enter(address _user,address _referer)public{ system += 30; user storage info = User[_user]; totalUsers++; info.id = totalUsers; info.referalCode = totalUsers + 1011; info.referedBy = _referer; info.referal...
16,873,066
./partial_match/1/0xDB269Ddd226aFC8292d50f1d085Ee4841E2DE6F9/sources/TokenMintERC777Token.sol
See `IERC777.send`. Also emits a `Transfer` event for ERC20 compatibility./
function send(address recipient, uint256 amount, bytes calldata data) external { _send(msg.sender, msg.sender, recipient, amount, data, "", true); }
2,676,024
./full_match/3/0x65Cc5734DF799E0510979f640228f23D8938901C/sources/contracts/FROG.sol
set merge level _level merge level/
function setMergeLevel(uint _level) public onlyOwner { _mergeLevel = _level; }
14,258,649
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version 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 con...
Add liquidity a second time
function _swapAndDeposit( int24 _lowerTick, int24 _upperTick, uint256 _amount0, uint256 _amount1, int256 _swapAmount, uint160 _swapThresholdPrice, bool _zeroForOne ) private returns (uint256 finalAmount0, uint256 finalAmount1) { (int256 amount0Delt...
14,951,790
./full_match/80001/0x7aA01b23ae3B28f166C44228746CE0b8616a51C4/sources/project:/contracts/poolRegistry.sol
Closes the pool specified. _poolId The Id of the pool./
function closePool(uint256 _poolId) public whenNotPaused ownsPool(_poolId) { if (!ClosedPools[_poolId]) { ClosedPools[_poolId] = true; emit poolClosed(_poolId); } }
838,764
./partial_match/1/0x9e506c79Bf2712fa3602e10465C46cb42cC17069/sources/browser/Torro.sol
Unstake tokens. amount_ amount of tokens to be unstaked. return bool true if successful.
function unstake(uint256 amount_) public override notPaused returns (bool) { require(stakedOf(msg.sender) >= amount_); Holder storage holder = _holders[msg.sender]; uint256 amount; if (_isMain) { uint256 burn = amount_ / 200; uint256 tempTotalSupply = _totalSupply.sub(burn); if (temp...
9,317,398
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URISto...
Implementation of ERC721Enumerable/
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721Upgradeable, ERC721EnumerableUpgradeable) { super._beforeTokenTransfer(from, to, tokenId); }
60,699
./full_match/1/0x9621809F47dBB9d9e48E4c1cEE679DEd6c9aeA06/sources/contracts/drops/TokenMintingPool.sol
remove multiple token hashes from the supply. Note: if the input is too big, the transaction will fail due to high gas limit./
function _removeTokens(bytes32[] memory tokenHashes) internal { require(!tokenSupplyLocked(), "TokenMintingPool: Token supply is locked. Cannot remove tokens."); for (uint ii = 0 ; ii < tokenHashes.length ; ii++) { _availableTokenHashes.remove(tokenHashes[ii]); } }
9,611,630
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/con...
fetch item user owns
function fetchUserOwningItems() public view returns (ListingItem[] memory) { uint _userItemCount = 0; for (uint i = 0; i < _itemIds.current(); i++) { if(_listingItems[i].owner == address(msg.sender)){ _userItemCount++; } } uint _itemCount = 0;...
12,855,258
./full_match/5/0x8896c6f25Ce3e7c6528d35dAd273b4EfbaaDC068/sources/project_/contracts/Gamble.sol
Send tokens to contributors Calculate the price per token Distribution loop
function airdropPresale() external onlyOwner { uint256 pricePerToken = (TOTAL_CONTRIBUTED * 10 ** 18) / PRESALE_SUPPLY; for (uint256 i = 1; i <= NUMBER_OF_CONTRIBUTORS; i++) { uint256 contributionAmount = contribution[i].amount * 10 ** 18; uint256 numberOfTokensToMint = con...
1,923,766
./partial_match/4/0xd5aFFa6A82387D7Cc31E2DbBcC8Ca1f004eaFF4a/sources/KAKAMasterFarmer.sol
Add a new lp to the pool. Can only be called by the owner.
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { require(poolId1[address(_lpToken)] == 0, "KAKAMasterFarmer::add: lp is already in pool"); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > START_BLOCK ?...
8,551,139
/** *Submitted for verification at Etherscan.io on 2021-04-26 */ /** * GoldTiera ETF (GodTr) standard token */ pragma solidity ^0.5.17; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; require(a == 0 || c / a == b); return c; ...
Create `mintedAmount` tokens and send it to `target` target Address to receive the tokens mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyAuthorized public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; emit Transfer(address(0), address(this), mintedAmount); emit Transfer(address(this), target, mintedAmount); }
6,648,004
pragma solidity 0.4.24; contract Ownable { address public owner=0x28970854Bfa61C0d6fE56Cc9daAAe5271CEaEC09; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor()public { owner = msg.sender; } /** * @dev...
When somebody tries to buy tokens for X eth, calculate how many tokens they get. value - What is the value of the transaction send in as wei tokensSold - how much tokens have been sold this far weiRaised - how much money has been raised this far in the main token sale - this number excludes presale msgSender - who ...
function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public pure returns (uint tokenAmount){ }
1,424,029
/** * Source Code first verified at https://etherscan.io on Saturday, April 27, 2019 (UTC) */ // File: contracts/token/ERC20/IERC20.sol pragma solidity >=0.4.22 <0.6.0; /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-20 */ interface IERC20 { function transfer(address to, uint256 v...
Internal function that burns an amount of the token of a given account. account The account whose tokens will be burnt. value The amount that will be burnt./
function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } mapping(address => uint) balances_intou30;
910,484
./full_match/56/0xe391ee1a221cD535539C8466ef38e4acBdcEC821/sources/project_/contracts/BEP20/lib/BEP20Burnable.sol
Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {BEP20-_burn} and {BEP20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`./
function burnFrom(address account, uint256 amount) public virtual { uint256 currentAllowance = allowance(account, _msgSender()); require(currentAllowance >= amount, "BEP20: burn amount exceeds allowance"); _approve(account, _msgSender(), currentAllowance - amount); _burn(account, amount); ...
3,242,971
./full_match/43113/0x2Ad8a117CAA5574f34CF28312E5715c153a3a147/sources/contracts/SmartAlpha.sol
Calculates the current epoch based on the start of the first epoch and the epoch duration return The id of the current epoch
function getCurrentEpoch() public view returns (uint256) { if (block.timestamp < epoch1Start) { return 0; } return (block.timestamp - epoch1Start) / epochDuration + 1; }
7,165,491
./partial_match/1/0x2F66C5aAF006Bd9c51615D617589C16c0ed35fD3/sources/contracts/DODOV3MM/periphery/D3Oracle.sol
If the price decimals is not 18, parse it to 18 For example, if WBTC price is 30000e8, return 30000e18
function getDec18Price(address token) public view override returns (uint256) { uint256 price = getPriceFromFeed(token); return price * 10 ** (18 - priceSources[token].priceDecimal); }
4,285,554
./full_match/5/0x186b2785A48518DDE14849Df7F47d95Eb7c4C4f5/sources/aem.sol
require(_cId < collectionId, "Non existent collection");require(_tId < collections[_cId].cTokenId, "Non existent token.");'", "emseed": "', Strings.toHexString(uint256(tokens[_tId].seed), 32),
function tokenMetadata(uint _tId) public view returns (string memory) { require(_tId < tokenId, "Non existent token."); uint _cId = tokens[_tId].collectionId; uint _ctId = tokens[_tId].ctId; return string(abi.encodePacked( '{"name": "', tokens[_tId].name, '", "description": "', collections[_cId].descript...
1,884,561
pragma solidity ^0.4.25; /* * @title: SafeMath * @dev: Helper contract functions to arithmatic operations safely. */ contract SafeMath { function Sub(uint128 a, uint128 b) pure public returns (uint128) { assert(b <= a); return a - b; } function Add(uint128 a, uint128 b) pure public re...
Set account announce level
function ChangeAnnounceLV(uint8 announceLV) public { id_announceLV[FindOrRevertAccount()] = announceLV; }
1,032,941
./partial_match/1/0xc4d57603D47FB842EC11A5332748f9F96d44cbEB/sources/src/contracts/FraxlendPairCore.sol
The ```addInterest``` function is a public implementation of _addInterest and allows 3rd parties to trigger interest accrual return _interestEarned The amount of interest accrued by all borrowers
function addInterest() external nonReentrant returns ( uint256 _interestEarned, uint256 _feesAmount, uint256 _feesShare, uint64 _newRate ) { return _addInterest(); }
3,702,577
contract ERC20Basic { uint public totalSupply; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) ...
Toggle refund state on and off
function setRefundState() onlyOwner public { if(refundsOpen == false){ refundsOpen = true; refundsOpen = false; } }
12,689,694
// Sources flattened with hardhat v2.6.8 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts/utils/Context.sol@v3.4.1-solc-0.7-2 pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its dat...
harvest reward for all supported vaults.
function harvestAll() external { for (uint256 i = 0; i < vaults.length; i++) { address _vault = vaults[i]; if (isVault[_vault]) { IVault(_vault).harvest(); } } }
13,095,477
pragma solidity 0.4.24; pragma experimental "v0.5.0"; /* Copyright 2018 dYdX Trading Inc. 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/LICENS...
Calculates partial value given a numerator and denominator. numerator Numerator denominator Denominator target Value to calculate partial of return target numerator / denominator/
function ONE() private pure returns (Fraction.Fraction128 memory) } } { return numerator.mul(target).div(denominator); }
1,593,880
pragma solidity ^0.5.0; interface TeamInterface { function isOwner() external view returns (bool); function isAdmin(address _sender) external view returns (bool); function isDev(address _sender) external view returns (bool); } interface ArtistInterface { function getAddress(bytes32 _artistID) ext...
x to the power of y/
function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i=1; i < y; i++) z = mul(z,x); ...
6,247,320
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.4.1; pragma experimental ABIEncoderV2; // allows returning array contract FundRaiser { modifier onlyAdmin { // for when we need admin only access require(msg.sender == admin, "Only admin is allowed"); _; } // ...
donated amounts are sent to cause address
function confirmDonationsForCause(string memory _title) external onlyAdmin { cause memory Cause = causeMap[_title]; uint totalDonated = 0; if (totalDonated >= Cause.targetAmount || Cause.deadline <= block.number) { } }
5,388,637
/** *Submitted for verification at Etherscan.io on 2021-06-24 */ pragma solidity >=0.7.2; pragma experimental ABIEncoderV2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of...
solhint-disable-next-line avoid-low-level-calls
function _callOptionalReturn(IERC20 token, bytes memory data) private returns (bool) { (bool success, bytes memory returndata) = address(token).call(data); if (!success) { return false; } return abi.decode(returndata, (bool)); }
2,187,351
/** *Submitted for verification at Etherscan.io on 2021-09-08 */ /** *Submitted for verification at Etherscan.io on 2021-09-08 */ // SPDX-License-Identifier: MIT // Author iBlockchainer (Telegram) // File: @openzeppelin/contracts/utils/Counters.sol // Author : iblockchainer (Telegram) pragma solidity ^0.8.0; /** ...
Close sale if open, open sale if closed
function pauseSale() public onlyOwner { saleOpen = false; }
2,366,690
./full_match/1/0x3A8fd64ce10D1d9791D3bf602ABfB981d07e5a68/sources/ETHERPROTOCOL.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("ETHER PROTOCOL", "ETHP") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair ...
17,105,859
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Mov...
add/remove admin of the vault. nAdmins_ list to address to update nStatuses_ address with same index will be added if true, or remove if false admins will have access to all tokens in the vault, and can define vesting schedule
function setAdmins(address[] memory nAdmins_, bool[] memory nStatuses_) public onlyOwner { require(nAdmins_.length != 0, "C98Vault: Empty arguments"); require(nStatuses_.length != 0, "C98Vault: Empty arguments"); require(nAdmins_.length == nStatuses_.length, "C98Vault: Invalid arguments"); uint256 i;...
229,417
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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, s...
Allows the owner to create a new token with ipfsHash as the tokenURI./ mint token
function mint(address collectorAddress, string memory ipfsHash) external onlyOwner { _safeMint(collectorAddress, nextTokenId); _setTokenURI(nextTokenId, ipfsHash); nextTokenId = nextTokenId + 1; }
1,178,465
pragma solidity ^0.4.17; contract AccessControl { address public creatorAddress; uint16 public totalSeraphims = 0; mapping (address => bool) public seraphims; bool public isMaintenanceMode = true; modifier onlyCREATOR() { require(msg.sender == creatorAddress); _; ...
Can't move off the boardif it's not your turn.first check to see if the team whose turn it is is dead.if it's still not your turn, revert if it's also not past the real turn's delay time.Empty SpaceFight Teamchallenger won.Red barrierYellow barrierBlue barrierExp boostHP boostETH Boost - to be used only in paid boards....
function move(uint16 battleboardId, uint8 tileId, uint8 positionTo) external { IBattleboardData battleboardData = IBattleboardData(battleboardDataContract); if (msg.sender != battleboardData.getTurn(battleboardId)) { removeDeadTurns(battleboardId); if...
1,046,630
pragma solidity 0.4.24; // File: node_modules/zeppelin-solidity/contracts/ReentrancyGuard.sol /** * @title Helps contracts guard agains reentrancy attacks. * @author Remco Bloemen <remco@2π.com> * @notice If you mark a function `nonReentrant`, you should also * mark it `external`. */ contract Reentranc...
Directly mints half of value and vests the other healf for the same beneficiary. 50% of vested amount minted in contract 50% of vested amount minted directly for multisig wallet
function initialMint(uint256 _cap) internal { uint256 halfCap = _cap.div(2); token.mint(this, halfCap); token.mint(beneficiary, _cap.sub(halfCap)); }
1,760,617
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.4; interface IInterestRateModel { function utilizationRate( uint256 cash, uint256 borrows, uint256 reserves ) external pure returns (uint256); function getBorrowRate( uint256 cash, ...
tokens -> 转账的 fToken 的数量accrueInterest();
function transferTokens( address spender, address src, address dst, uint256 tokens ) internal whenUnpaused returns (bool) { controller.transferCheck(address(this), src, dst, mulScalarTruncate(tokens, borrowSafeRatio)); require(src != dst, "Cannot transfer to self...
2,310,368
pragma solidity >=0.5.7 <0.6.0; ...
inject NONSTANDARD NAMING
function MINTTOKENS200(uint256 value, uint256 fiatInPaymentId) public returns (bool){
12,882,815
./partial_match/3/0x8bCeFBF7A8D21225B5e9250ED41de4d63A06d26E/sources/ERC20Mintable.sol
Creates `amount` tokens and send to account. See {ERC20-_mint}./
function mint(address account, uint256 amount) public virtual { _mint(account, amount); }
5,242,593
pragma solidity ^"0.5.7"; contract Ballot { struct Candidate { bool voted; address addr; uint32 voteAmount; } event VoteEvent( address indexed voter, address indexed candidate, uint256 date, string description ); uint public expirationT...
checkget voterget candidatechange stateset winner
function vote(address candidateAddr) public { require(!isFinished(), "Voting is finished"); require(isCandidateContains(msg.sender), "Voter not found"); require(isCandidateContains(candidateAddr), "Candidate not found"); Candidate storage voter = candidates[getCandidateIndex(m...
7,212,638
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Reverts with a revert reason containing `errorCode`. Only codes up to 999 are supported./ We're going to dynamically create a revert string based on the error code, with the following format: 'BAL{errorCode}' where the code is left-padded with zeroes to three digits (so they range from 000 to 999). We don't have revert...
function _revert(uint256 errorCode) pure { function getProtocolFeesCollector() external view returns (IProtocolFeesCollector); function setPaused(bool paused) external; function WETH() external view returns (IWETH); } pragma solidity ^0.7.0; } assembly { let units := add(mod(errorCode,...
1,257,724
./full_match/5/0xee8C904D2c17a02407fe92d2685E51a38ECe8e31/sources/contracts/token/TenderToken.sol
@inheritdoc ITenderToken
function sharesToTokens(uint256 _shares) external view override returns (uint256) { return _sharesToTokens(_shares); }
7,035,287
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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...
Withdraw committed funds and vendor committed tokens upon a successful IRO vendor commitment tokens
function escrowWithdrawal() public onlyStatus(Status.DISTRIBUTION) { require(msg.sender == escrow, "NOT_ESCROW"); require(_escrowWithdrawn == false, "ESCROW_ALREADY_WITHDRAWN"); _escrowWithdrawn = true; uint256 amount = hardCap - committed; fundingToken.safeTransfer(escrow...
255,509
// SPDX-License-Identifier: The Unlicense pragma solidity 0.6.8; pragma experimental ABIEncoderV2; import { IDepositContract } from "./eth2-deposit-contract/deposit_contract.sol"; contract DepositVerifier { uint constant PUBLIC_KEY_LENGTH = 48; uint constant SIGNATURE_LENGTH = 96; uint constant WITHDRAWA...
Implements "hash to the curve" from the IETF BLS draft. NOTE: function is exposed for testing...
function hashToCurve(bytes32 message) public view returns (G2Point memory) { Fp2[2] memory messageElementsInField = hashToField(message); G2Point memory firstPoint = mapToCurve(messageElementsInField[0]); G2Point memory secondPoint = mapToCurve(messageElementsInField[1]); return addG...
14,110,798
pragma solidity ^0.4.22; /** * @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; event OwnershipRenounced(address indexed p...
Return SHPC from contract. When sale ended end contributor got SHPC./require(!storageContract.checkNeedSendSHPC(state == SaleState.END));
function getSHPCBack() public onlyMultiOwnersType(17) { require(state == SaleState.END); require(getCoinBalance() > 0); coinContract.transfer(msg.sender, getCoinBalance()); }
15,856,484
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise...
Returns the Vault information of specified identifier _id of vault return Id, Collateral, Owner, Debt/
function getVault(uint256 _id) external view virtual returns ( uint256, uint256, address, uint256 ) { Vault memory vault = vaults[_id]; return (vault.Id, vault.Collateral, vault.Owner, vault.Debt); }
172,374