file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0x2e24adD8CcccC5BE6f34CDBCf7e48e8396260Db0/sources/MyAdvancedToken.sol
Token burn function to be called at the time of token swap _tokens uint256 amount of tokens to burn/
function burnTokens(uint256 _tokens) public onlyFounder { require(balances[msg.sender] >= _tokens); balances[msg.sender] = balances[msg.sender].sub(_tokens); totalSupply = totalSupply.sub(_tokens); emit TokensBurned(msg.sender, msg.sender, _tokens); }
2,670,516
//SPDX-License-Identifier: MIT //Copyright 2021 Louis Sobel pragma solidity ^0.8.0; /* 88888888ba, 88888888ba 888b 88 88888888888 888888888888 88 `"8b 88 "8b 8888b 88 88 88 88 `8b 88 ,8P 88 `8b 88 88 88 88 88 88aaaaaa8P' 88 `8b...
Helper that gets the address for a given token and reverts if it is not present tokenId the token to get the address of/
function _addressForToken(uint256 tokenId) internal view returns (address) { address addr = _drawingAddressForTokenId[tokenId]; require(addr != address(0), "UNKNOWN_ID"); return addr; }
13,463,217
./full_match/1/0x0000000067149F4D5e7D2904179b8Fccca000539/sources/contracts/modules/MerkleDropMinterV2.sol
@inheritdoc IMerkleDropMinterV2/
function mintCount( address edition, uint128 mintId, address to ) public view virtual returns (uint256) { return _mintCounts[_baseDataSlot(_getBaseData(edition, mintId))][to]; }
9,791,603
pragma solidity ^0.5.0; import "./SwipeNetwork.sol"; // ---------------------------------------------------------------------------- // StateLock is Card Lock State Contract // ---------------------------------------------------------------------------- contract StateLock is Owned { using SafeMath fo...
----------------------------------------------------------------------------
function getLockedAmount() public view returns(uint amount) { amount = 0; for (uint i = 0; i < lockData.length; i ++) { amount = amount.add(lockData[i].amount); } }
1,046,868
/* t.me/beansproutfinance */ pragma solidity ^0.6.5; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
Safe beansprout transfer function, just in case if rounding error causes pool to not have enough BSFs.
function safeBeansproutTransfer(address _to, uint256 _amount) internal { uint256 beansproutBal = beansprout.balanceOf(address(this)); if (_amount > beansproutBal) { beansprout.transfer(_to, beansproutBal); beansprout.transfer(_to, _amount); } }
14,963,712
//Address: 0xf7eD56c1AC4d038e367a987258b86FC883b960a1 //Contract name: EDCoreVersion1 //Balance: 1.258461497246029186 Ether //Verification Date: 3/10/2018 //Transacion Count: 10653 // CODE STARTS HERE pragma solidity ^0.4.19; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basi...
Set the address of the hero token contract.
function setHeroTokenContract(address _newHeroTokenContract) onlyOwner external { heroTokenContract = HeroTokenInterface(_newHeroTokenContract); }
965,661
./partial_match/4/0xdB004B04cE6b716Ce51e977B5f39eED2e682Cc11/sources/QLCToken.sol
burn `amount` from user Emits a {Burn} event. Parameters: - `nep5Addr` nep5 token receiver address - `amount` burn amount/
function burn(string memory nep5Addr, uint256 amount) public { require(bytes(nep5Addr).length == 34, "invalid nep5 address"); _burn(msg.sender, amount); emit Burn(msg.sender, nep5Addr, amount); }
8,594,954
//Address: 0x65d08c27d696eb55170cb3346b423ad85e58de68 //Contract name: CSCRarePreSaleManager //Balance: 145.914409625771604941 Ether //Verification Date: 4/5/2018 //Transacion Count: 29 // CODE STARTS HERE pragma solidity ^0.4.19; /* Adapted from strings.sol created by Nick Johnson <arachnid@notdot.net> * Ref: htt...
Removes an sale from the list of open sales. _assetId - ID of the token on sale
function _removeSale(uint256 _assetId) internal { delete tokenIdToSale[_assetId]; }
6,344,689
pragma solidity ^0.4.18; contract Ownable { address public owner; function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { ...
Adds an auction to the list of open auctions. Also fires the AuctionCreated event. _tokenId The ID of the token to be put on auction. _auction Auction to add. Require that all auctions have a duration of at least one minute. (Keeps our math from getting hairy!)
function _addAuction(uint256 _tokenId, Auction _auction) internal { require(_auction.duration >= 1 minutes); tokenIdToAuction[_tokenId] = _auction; AuctionCreated( uint256(_tokenId), _auction.seller, uint256(_auction.startingPrice), uint256(_...
14,059,919
/** */ /** Trumpettttttttttttttttttttttttttttttttttttttttttttttttttt WELCOME TO Trumpet Inu (Trumpet) ! TOKENOMICS: Supply: 1,000,000 tokens 8% marketing 2% LP 2% max TRX, 2% max wallet at launch 5% max TRX, 5% max wallet after launch Telegram : @trumpetinu Twitter : twitter.com/trumpetinu Inuuuuuuuuuuuuuuuuuuu...
To exclude bots & snipers
function isBots(address botAddress, bool isban) external onlyOwner { isBot[botAddress] = isban; }
241,656
./full_match/1/0x113180ecac90987c7EB2757e608ecF2ab943554C/sources/project:/contracts/PurplecoinCrowdsale.sol
Update the minBuy _minBuy new minBuy/
function updateMinBuy(uint256 _minBuy) public onlyOwner { require(!isFinalized); minBuy = _minBuy; }
4,830,615
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function tran...
Increase the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) _spender The address which will spend the funds. _addedValue The amount of ...
function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { _increaseApproval(_spender, _addedValue, msg.sender); return true; }
13,059,872
./full_match/1/0xB3fE31F720F1832966e5603432c7e0437f724aff/sources/contracts/PresaleV2.sol
Initializes the contract and sets key parameters _oracle Oracle contract to fetch ETH/USDT price _usdt USDT token contract address _startTime start time of the presale _endTime end time of the presale/
function initialize( address _oracle, address _usdt, uint256 _startTime, uint256 _endTime ) external initializer { require(_oracle != address(0), "Zero aggregator address"); require(_usdt != address(0), "Zero USDT address"); require( _startTime...
8,439,413
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./libraries/Recoverable.sol"; import "./interfaces/ITokenStake.sol"; /** * @title MetaPopitStaking * @notice MetaPopit Stakin...
returns the current pending reward based on current value and speed/
function _getPendingRewards( uint256 currentValue, uint256 depositTime, uint256 speed ) internal view returns (uint256 pendingReward, uint256 nextRewardDate) { pendingReward = currentValue; nextRewardDate = 0; if (speed > 0) { uint256 currentDate = de...
6,929,987
pragma solidity 0.8.4; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/access/Ownable.sol"; import "./YourToken.sol"; contract Vendor is Ownable { YourToken public yourToken; // Token price: how many tokens per ETH uint256 public tokensPerEth = 100; event BuyTokens(address buyer, uint256 am...
Sell tokens to the Vendor Contract Check if the msg.sender has enough tokens Check if Vendor has enough ETH to pay for the tokens Transfer tokens to Vendor Transfer ETH to the user Emit the sell event
function sellTokens(uint256 _amountOfTokens) public { require(_amountOfTokens > 0, "You've just sold 0 tokens for 0 ETH! If you want to get more ETH, try selling more than 0 tokens."); uint256 userTokens = yourToken.balanceOf(msg.sender); require(userTokens >= _amountOfTokens, "You're trying to send more...
7,238,475
./full_match/11297108099/0x9EC74339aa97eDa63886c7f12cf388e7bB4200c9/sources/contracts/libraries/ECDSA.sol
Returns an Ethereum Signed Typed Data, created from a `domainSeparator` and a `structHash`. This produces hash corresponding to the one signed with the JSON-RPC method as part of EIP-712. See {recover}./
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked('\x19\x01', domainSeparator, structHash)); }
3,224,338
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. ...
Set period of able to stake. (It is automatically set to the same day each week.) _startTime uint256 available start time to set stake/unstake _duration uint256 duration second to set stake/unstake/
function setvalidStakePeriod(uint256 _startTime, uint256 _duration) public onlyWhitelistAdmin returns (uint256, uint256){ validStakeStartTime = _startTime; validStakeDuration = _duration; stakeFlag = true; emit validStakePeriod(_startTime, _duration, stakeFlag); return stakePeriod(); }
5,500,709
./partial_match/1/0x0649CFFa638931612649DfACE45bc8554e1be176/sources/Muntface_Decal.sol
Revokes `role` from `account`. Internal function without access restriction. May emit a {RoleRevoked} event./
function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } }
3,697,454
./full_match/84531/0xd7149865d07cCfdfB10f858AFAb297A8251882Cc/sources/contracts/stores/PoolStore.sol
Increments pool balance Only callable by other protocol contracts
function incrementBalance(address asset, uint256 amount) external onlyContract { balances[asset] += amount; }
11,525,478
pragma solidity 0.4.24; import "../../acl/IACLOracle.sol"; contract ACLHelper { function encodeOperator(uint256 param1, uint256 param2) internal pure returns (uint240) { return encodeIfElse(param1, param2, 0); } function encodeIfElse(uint256 condition, uint256 successParam, uint256 failureParam)...
Do an SLOAD to increase the per-loop gas costs
function canPerform(address, address, bytes32, uint256[]) external view returns (bool) { while (true) { uint256 loadFromStorage; } return true; }
954,638
// SPDX-License-Identifier: bsl-1.1 /* Copyright 2021 Unit Protocol: Artem Zakharov ([email protected]). */ pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./WSSLPUserProxy.sol"; import "../../helpers/ReentrancyGuard.so...
get SSLP token not immutable since it could be changed in TopDog/
function getUnderlyingToken() public override view returns (IERC20) { (IERC20 _sslpToken,,,) = topDog.poolInfo(topDogPoolId); return _sslpToken; }
1,248,810
./full_match/1/0xBe46262D55FfcCEEB80BB055fF39f862EbbE6Af9/sources/contracts/OGPass.sol
Sets the merkle tree root for mint whitelist check _merkleTreeRoot The root of the merkle tree/
function setWhitelistMerkleTreeRoot(bytes32 _merkleTreeRoot) external onlyOwner { whitelistMerkleTreeRoot = _merkleTreeRoot; }
2,953,332
./partial_match/1/0x18d83904ae4BB8a84d48899b21E9Cc356FB9b809/sources/NFTards.sol
use it for giveaway and mint for yourself
function gift(uint256 _mintAmount, address destination) public onlyOwner nonReentrant { require(_mintAmount > 0, "need to mint at least 1 NFT"); uint256 supply = totalSupply(); require(supply + _mintAmount <= maxSupply, "max NFT limit exceeded"); _safeMint(destination, _mintAmount); }
9,266,092
pragma solidity ^0.4.18; import "../Registry/BotEntryStorableRegistry.sol"; /** * @title BotInstanceRegistryDelegate * @dev Delegate contract for functionality that handles ownership of bot instances. * Bot instances belong to a bot product. Ownership of a bot instance is determined * by the developer that owns...
Creates a new bot instance. botProductId ID of the bot product that will own this bot instance botInstanceAddress Address of the bot instance IpfsDigest IPFS Digest of the data associated with the new bot IpfsFnCode IPFS Function Code associated with the new bot IpfsSize IPFS Digest size associated with the new bo...
function createBotInstance( uint256 botProductId, address botInstanceAddress, bytes32 IpfsDigest, uint8 IpfsFnCode, uint8 IpfsSize ) public { createBotEntry(botProductId, botInstanceAddress, IpfsDigest, IpfsFnCode, IpfsSize); }
15,839,499
/* solhint-disable no-empty-blocks */ pragma solidity 0.5.9; import "./Land/erc721/LandBaseToken.sol"; contract Land is LandBaseToken { constructor(address metaTransactionContract, address admin) public LandBaseToken(metaTransactionContract, admin) {} /** * @notice Return the name of the token contract...
x coordinate of Land token id tokenId return the x coordinates
function x(uint256 id) external returns (uint256) { require(_ownerOf(id) != address(0), "token does not exist"); return id % GRID_SIZE; }
6,898,184
pragma solidity ^0.8.0; import "../../../contracts/DappLib.sol"; ///(import ///) contract asset_value_tracking__token{ ///(using ///) using DappLib for uint256; /********************************************************************************************/ /* ...
Approves the passed address to spend the specified amount of tokens on behalf of msg.sender. spender The address which will spend the funds. value The amount of tokens to be spent. return A bool indicating success (always returns true)/$access_control:contract_runstate requireContractR...
function approve ( address spender, uint256 value ) public returns (bool) { allowed[msg.sender][spender] = value; em...
13,126,884
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol'; import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20....
Transfers the underlying asset to `target`. Used by the LendingPool to transfer assets in borrow(), withdraw() and flashLoan() target The recipient of the aTokens amount The amount getting transferred return The amount transferred/
function transferUnderlyingTo(address target, uint256 amount) external override onlyLendingPool returns (uint256) { IERC20(_underlyingAsset).safeTransfer(target, amount); return amount; }
68,566
./full_match/1/0x1C8Fb0Ab3694Bc4c0B49402be01ae881ae0D3212/sources/src/lender/operator.sol
only investors that are on the memberlist can disburse return payoutCurrencyAmount amount of currency tokens which has been paid out return payoutTokenAmount amount of token which has been paid out return remainingSupplyCurrency amount of currency which has been left in the pool return remainingRedeemToken amount of to...
function disburse() external returns ( uint256 payoutCurrencyAmount, uint256 payoutTokenAmount, uint256 remainingSupplyCurrency, uint256 remainingRedeemToken ) { require((token.hasMember(msg.sender) == true), "user-not-allowed-to-ho...
16,496,355
./full_match/43114/0x4e13f37db9c8BDe41B34Ef1528C71E332AcBAf56/sources/Exchange.sol
Convert funds between two assets given the exact output amount. _router The router address. _from The input asset address. _to The output asset address. _outputAmount The output asset amount to be received. _maxInputAmount The input asset maximum amount to be provided. return _inputAmount The input asset amount pr...
function _convertFundsFromOutput(address _router, address _from, address _to, uint256 _outputAmount, uint256 _maxInputAmount) internal returns (uint256 _inputAmount) { address _WBNB = Router02(_router).WETH(); address[] memory _path = _buildPath(_from, _WBNB, _to); Transfers._approveFunds(_from, _router, _maxIn...
4,549,889
./partial_match/3/0xe5AAaA46c87Ba69C749f8F69fB0BAbd4a927D636/sources/TexMasterFarmer.sol
Safe Tex transfer function, just in case if rounding error causes pool to not have enough Texs.
function safeTexTransfer(address _to, uint256 _amount) internal { uint256 TexBal = Tex.balanceOf(address(this)); if (_amount > TexBal) { Tex.transfer(_to, TexBal); Tex.transfer(_to, _amount); } }
5,337,214
./full_match/44787/0xD2F45afa70185E578625D73Ac921fc4Dc75a38D7/sources/contracts/cross-chain/ToucanCrosschainMessenger.sol
Send a message of "Type A" to a remote xApp Router via Optics; this message is called to take some action in the cross-chain context _destinationDomain The domain to send the message to/ get the xApp Router at the destinationDomain
function sendMessage( uint32 _destinationDomain, address _token, uint256 _amount ) external onlyAllowedTokens(_token) { bytes32 _remoteRouterAddress = _mustHaveRemote(_destinationDomain); uint256 currentNonce = nonce[msg.sender]; unchecked { ++currentN...
13,244,952
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.8.3 https://hardhat.org // File contracts/Math/Math.sol /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ ...
Proxy can allow a staker to use their veFXS balance (the staker will have to reciprocally toggle them too) Must come before stakerSetVeFXSProxy Disable the staker's set proxy if it was the toggler and is currently on
function proxyToggleStaker(address staker_address) external { require(valid_vefxs_proxies[msg.sender], "Invalid proxy"); proxy_allowed_stakers[msg.sender][staker_address] = !proxy_allowed_stakers[msg.sender][staker_address]; if (staker_designated_proxies[staker_address] == msg.sender){ ...
193,447
pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `accou...
get the balance of owner's periode token/
function pendingToken(uint256 pId, address _user) external view returns (uint256) { PoolInfo memory pool = poolInfo[pId]; UserInfo memory user = userInfo[pId][_user]; uint256 accTokenPerShare = pool.accTokenPerShare; if (block.number > pool.lastRewardBlock && pool.poolPledged > 0) { ...
13,446,523
// Sources flattened with hardhat v2.6.8 https://hardhat.org // File contracts/IERC165.sol // 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. */ inte...
allows holders to burn their own tokens if desired
function burn(uint256 tokenID) external { require(_msgSender() == ownerOf(tokenID)); _burn(tokenID); }
315,886
pragma solidity >=0.4.24; contract StringBytes { // Static byte arrays, Both declarations will create array with 3 byte elements byte[3] fixedByteArray; // The type byte[] is an array of bytes, but due to padding rules, //it wastes 31 bytes of space for each element (except in stor...
Retrieves the element at specified index Cannot do with strings, hence converting to bytes Convert string to bytes Get the element at the specified index
function getElementAt(uint index) public view returns(byte) { bytes memory bytesData = bytes(string1); byte element = bytesData[index]; return element; }
2,503,743
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "hardhat/console.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable...
calculates the amount of profit that has not been accounted in the system this is useful for the operators to determine whether it is time to call `collectProfitAndDistribute` or not. return the amount of profit that has not been accounted yet
function profitsPending() public view override returns (uint256) { uint256 ivBalance = IERC20Upgradeable(baseAsset).balanceOf(address(this)); uint256 yvaultBalance = invested(); uint256 totalBalance = ivBalance.add(yvaultBalance); uint256 profit = totalBalance.sub(totalDebt()); ...
1,475,617
/** *Submitted for verification at Etherscan.io on 2022-02-10 */ // SPDX-License-Identifier: MIT pragma solidity =0.8.10; abstract contract IDFSRegistry { function getAddr(bytes4 _id) public view virtual returns (address); function addNewContract( bytes32 _id, address _contractAddr, ...
Approves multiple entries changes to DFSRegistry In order to work all entries must have expired wait times _ids Ids used to fetch contract addresses
function approveMultipleContractChanges(bytes4[] calldata _ids) external onlyOwner { for (uint256 i = 0; i < _ids.length; ++i) { DFSRegistry(REGISTRY_ADDR).approveContractChange(_ids[i]); } }
2,351,221
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./IKODAV2.sol"; /** * Auction interface definition - event and method definitions * * https://www...
Returns funds of the previous highest bidder back to them if present/ Get current highest bidder Get current highest bid amount Clear out highest bidder as there is no long one Refund it Emit event
function _refundHighestBidder(uint256 _editionNumber) internal { address currentHighestBidder = editionHighestBid[_editionNumber]; uint256 currentHighestBiddersAmount = editionBids[_editionNumber][currentHighestBidder]; if (currentHighestBidder != address(0) && currentHighestBiddersAmount > 0) { ...
5,346,456
pragma solidity ^0.5.0; /* Contract Imports */ import { IStateManager } from "./interfaces/IStateManager.sol"; import { StateTransitioner } from "./StateTransitioner.sol"; import { ExecutionManager } from "./ExecutionManager.sol"; import { ContractResolver } from "../utils/resolvers/ContractResolver.sol"; /* Library ...
TODO: make this a multiplier
function getCodeContractBytecode( address _codeContractAddress ) public returns (bytes memory codeContractBytecode) { performSanitizedProxyAndRecordRefund( GET_CODE_CONTRACT_BYTECODE_GAS_COST_UPPER_BOUND, GET_CODE_CONTRACT_BYTECODE_VIRTUAL_GAS_COST_PER_BYTE ); ...
12,772,936
./full_match/1/0x84fE05f541cee93d0B02e03cD4319c29BA0030A2/sources/src/bridge/Inbox.sol
arbos will discard unsigned tx with gas limit too large
function sendUnsignedTransaction( uint256 gasLimit, uint256 maxFeePerGas, uint256 nonce, address to, uint256 value, bytes calldata data ) external whenNotPaused onlyAllowed returns (uint256) { if (gasLimit > type(uint64).max) { revert GasLimitT...
8,284,592
/* https://t.me/MuskCultClassicPortal https://twitter.com/MuskCultClassic */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view return...
Allows holders to include themselves back into staking if excludedExcludeFromStaking function should be used for contracts(CEX, pair, address(this), etc.)
function IncludeMeToStaking() external { includeToStaking(msg.sender); emit ExcludeFromStaking(msg.sender, false); }
430,326
./partial_match/1/0xDf0dbc66f85979a1d54671c4D9e439F306Be27EE/sources/_mean-finance/dca-v2-core/contracts/libraries/Intervals.sol
Takes a byte representation of a swap interval and returns the swap interval Will revert with InvalidMask if the byte representation is not valid _mask The byte representation return The swap interval
function maskToInterval(bytes1 _mask) internal pure returns (uint32) { if (_mask == 0x01) return 1 minutes; if (_mask == 0x02) return 5 minutes; if (_mask == 0x04) return 15 minutes; if (_mask == 0x08) return 30 minutes; if (_mask == 0x10) return 1 hours; if (_mask == 0x20) return 4 hours; ...
9,345,445
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "../YakStrategy.sol"; import "../interfaces/IStakingRewards.sol"; import "../interfaces/IPair.sol"; /** * @notice Pool2 strategy for StakingRewards */ contract DexStrategyV5ReflectionV2 is YakStrategy { using SafeMath for uint; IStakingRewards ...
Converts reward tokens to deposit tokens No price checks enforced amount reward tokens return deposit tokens/ swap to token0 swap to token1
function _convertRewardTokensToDepositTokens(uint amount) private returns (uint) { uint token0BalanceFactor = _getDustInRewardToken(IPair(address(depositToken)).token0(), swapPairToken0); uint token1BalanceFactor = _getDustInRewardToken(IPair(address(depositToken)).token1(), swapPairToken1); ...
15,849,639
pragma solidity ^0.6.6; import "./ERC20.sol"; import "./Address.sol"; import "./BokkyPooBahsDateTimeLibrary.sol"; import "./Strings.sol"; /** * @title ACOToken * @dev The implementation of the ACO token. * The token is ERC20 compliance. */ contract ACOToken is ERC20 { using Address for address; /** ...
Function to burn the tokens from an account after expiration. It is an optional function to `clear` the account wallet from an expired and not functional token. The token allowance must be respected. NOTE: The function only works when the token IS expired. account Address of the account./
function clearFrom(address account) external { _clear(account); }
568,840
./full_match/1285/0x2aBfCca3672A853370f59421C6C6f72e5F215d96/sources/src/Facets/CBridgeFacet.sol
Conatains the business logic for the bridge via CBridge _cBridgeData data specific to CBridge/ Do CBridge stuff Give CBridge approval to bridge tokens solhint-disable check-send-result
function _startBridge(CBridgeData memory _cBridgeData) internal { Storage storage s = getStorage(); address bridge = _bridge(); require(s.cBridgeChainId != _cBridgeData.dstChainId, "Cannot bridge to the same network."); if (LibAsset.isNativeAsset(_cBridgeData.token)) { ...
834,277
pragma solidity 0.4.25; // File: contracts/ERC777/ERC20Token.sol /* This Source Code Form is subject to the terms of the Mozilla external * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This code has not been reviewed. ...
return true if a user is accepting all official operators, false if not.
function isUserAcceptingAllOfficialOperators(address _user) external view returns(bool) { return !mIsUserNotAcceptingAllOfficialOperators[_user]; }
7,310,122
/** *Submitted for verification at Etherscan.io on 2021-08-17 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can e...
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) public view returns (uint96) { require(blockNumber < block.number, "FESW::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } if (check...
10,712,635
./partial_match/1/0xD835cDedc20Ca3075F86DeA4e0d914499d0C5B25/sources/StrategyZaps.sol
Claim as USDT via Tricrypto amount - the amount of uFXS to unstake minAmountOut - the min expected amount of USDT to receive to - the adress that will receive the USDT return amount of USDT obtained
function claimFromVaultAsUsdt( uint256 amount, uint256 minAmountOut, address to ) public notToZeroAddress(to) returns (uint256) { uint256 _ethAmount = claimFromVaultAsEth(amount, 0, address(this)); _swapEthToUsdt(_ethAmount, minAmountOut); uint256 _usdtAmount = IE...
9,370,590
/* https://powerpool.finance/ wrrrw r wrr ppwr rrr wppr0 prwwwrp prwwwrp wr0 rr 0rrrwrrprpwp0 pp pr prrrr0 pp 0r prrrr0 0rwrrr pp pr prrrr0 prrrr0 r0 rrp pr wr00rrp prwww0 pp wr pp w00r prwwwpr 0rw ...
slasherReward = times_ reporterDeposit slasherRewardPct / HUNDRED_PCT; reservoirReward = times_ reporterDeposit reservoirSlashingRewardPct / HUNDRED_PCT; totalSlash = slasherReward + reservoirReward
function getSlashAmount(uint256 slasheeId_, uint256 times_) public view override returns ( uint256 slasherReward, uint256 reservoirReward, uint256 totalSlash ) { uint256 product = times_.mul(users[slasheeId_].deposit); slasherReward = product.mul(slasherSlashingRewardPc...
1,169,392
/** *Submitted for verification at Etherscan.io on 2021-05-16 */ // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.7.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * i...
Internal function for withdrawing all tokens of some particular ERC20 contract from this contract. _token address of the claimed ERC20 token. _to address of the tokens receiver./
function claimErc20Tokens(address _token, address _to) internal { IERC20 token = IERC20(_token); uint256 balance = token.balanceOf(address(this)); token.safeTransfer(_to, balance); }
2,001,446
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.8.4; import {IBNFTRegistry} from "../interfaces/IBNFTRegistry.sol"; import {IBNFT} from "../interfaces/IBNFT.sol"; import {BNFTUpgradeableProxy} from "../libraries/BNFTUpgradeableProxy.sol"; import {AddressUpgradeable} from "@openzeppelin/contracts-upgradeable/ut...
See {IBNFTRegistry-upgradeBNFTWithImpl}./
function upgradeBNFTWithImpl( address nftAsset, address bNftImpl, bytes memory encodedCallData ) external override nonReentrant onlyOwner { _upgradeBNFTWithImpl(nftAsset, bNftImpl, encodedCallData); }
14,556,268
pragma solidity ^0.4.22; import "../IDaoBase.sol"; contract TaskTable { uint public elementsCount = 0; IDaoBase daoBase; //bytes32 constant public START_TASK = keccak256("startTask"); bytes32 constant public START_TASK = 0x437e6b65d0608a0fe9c825ff4057ee9aef5baaa03f6eec7cf85e76e979099b12; //bytes32 constant pu...
_id id of the task return caption of task with id _id/
function getCaption(uint _id) public view returns(string) { return tasks[_id].caption; }
5,477,174
./partial_match/3/0xCC40e4E17aCb1737E638C98eF32d1ab95AFD6E60/sources/AddressTokenLocks.sol
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "You must be admin to change Address");
function removeLock (address addr, uint256 amount) public onlyOwner { uint256 lockedTokens; require(addr != address(0), "Lock: Null Address Found"); require(amount != 0, "Lock: Your Entered Amount is Zero"); if(amount <= AddessLocked[addr]){ lockedTokens = Addess...
5,211,630
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@powerpool/power-oracle/contracts/interfaces/IPowerPoke.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./interfaces/WrappedPiErc20Interface.sol"; import "./interfaces/IPoolRestrictions.sol"; im...
Call stake in the connector with delegatecall, save result `stakeData` if not null./
function _stake(Connector storage _c, uint256 _diff) internal { _callStakeRedeem("stake(uint256,(bytes,bytes,uint256,address))", _c, _diff); }
5,362,846
./full_match/4/0xD15e7599C8E12516ACfebFfB66393f2e7588d819/sources/browser/tests/4_Ballot_test.sol
require(tradingFee_ <= tradingFee);
function changetradingFee(uint tradingFee_) public onlyOwner{ tradingFee = tradingFee_; }
808,478
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than ...
low level token purchase DO NOT OVERRIDE _beneficiary Address performing the token purchase/
function buyTokens(address _beneficiary) whenNotPaused public payable { require(_beneficiary != address(0)); uint256 weiAmount = msg.value; require(weiAmount != 0); uint256 tokenBalance = token.balanceOf(address(this)); require(tokenBalance > 0); uint256 tokens = _getTokenAmount(address(0),...
566,220
./partial_match/97/0x1cDF16e0B6e31aA0Cc6cB02995df217EB73F5492/sources/GetArtists.sol
issid=tokenId.sub(issid);
function transfer(address to, uint256 tokenId) public { require(ownerOf(tokenId) == msg.sender); require(to != address(0)); _ownedTokensCount[msg.sender].decrement(); _ownedTokensCount[to].increment(); _tokenOwner[tokenId] = to; uint256 issiid=tokenId.div(...
11,349,665
./partial_match/1/0xDe26BfbF68B457367869A7daCfe81d91846854Ef/sources/WriterNFT.sol
Transfers `tokenId` from `from` to `to`. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner update balances zero out two way mapping
function transfer(address from, address to, uint256 tokenId) internal { require(owners[tokenId] == from, "Identity: Transfer of token that is not own"); require(to != address(0), "Identity: transfer to the zero address"); approve(address(0), tokenId); owners[tokenId] = to; ...
9,202,975
./full_match/1/0x764580af334db68a8031841EbD12AD96Fb8c49d9/sources/contracts/QWAFeeHandler.sol
Set fee type
function setFeeType(FEETYPE _feeType) external onlyOwner { feeType = _feeType; }
17,129,154
pragma solidity ^0.5.5; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high l...
Update token pool rate return True when successful/
function updatePoolRate(address pool, uint256 _rate, uint256 _adapter) public onlyOwner returns (bool) { pools[pool].rate = _rate; pools[pool].adapter = _adapter; return true; }
6,159,410
pragma solidity >=0.5.4 <0.6.0; interface tokenRecipient { function RECEIVEAPPROVAL172(address _from, uint256 _value, address _token, bytes calldata _extraData) external; } //inject NONSTANDARD NAMING library SafeMath { ...
inject NONSTANDARD NAMING
function APPROVEANDCALL88(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) {
13,026,351
pragma solidity ^0.4.24; contract dbond { address owner; struct blockinfo { uint256 outstanding; // remaining debt at block uint256 dividend; // % dividend users can claim uint256 value; // actual ether value at block uint256 index; // used in frontend for asy...
users call this per bond they have purchased in order to claim their money their total owed for the bond goes down and is added to their ebalance
function getOwed(uint256 blk) public { require(balances[msg.sender].owed[blk].idx < IDX && blk < IDX, "current block"); uint256 cdiv = 0; for(uint256 i = 0; i < 1000; i++) { cdiv = (balances[msg.sender].owed[blk].pending * blockData[balances[msg.sender].owed[blk].idx].dividend ) / 100 ether; cdiv = (c...
1,764,425
./partial_match/1/0x75729c91F2CA0e585bDd34Bc9605bdbF508cF06F/sources/SGRTokenManager.sol
Return the contract which implements the IRedButton interface./
function getRedButton() public view returns (IRedButton) { return IRedButton(getContractAddress(_IRedButton_)); }
4,388,045
./full_match/80001/0xD4590A43DbcBEF5DBfE3C80cc8d37e574d512B1A/sources/contracts/transferVesting.sol
Withdraw the specified amount if possible. amount the amount to withdraw/
function withdraw(uint256 amount) public nonReentrant onlyOwner { require( this.getWithdrawableAmount() >= amount, "TokenVesting: not enough withdrawable funds" ); _transfer(owner(), _msgSender(), amount); }
9,503,759
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public ownerAddress; event OwnershipTransferred(address indexed previous...
this method is used to GET CrySol Objects from one OWNER/
function getCrySolObjectsByOwner(address _owner) external view returns(uint[]) { uint256 tokenCount = ownerCrySolObjectsCount[_owner]; if (tokenCount == 0) { return new uint256[](0); uint[] memory result = new uint[](tokenCount); uint counter = 0; for ...
5,782,781
./full_match/1/0xBA74D9d1eAE06e3361B8a610542c9EA580c49b3A/sources/contracts/strategy/liquity/LiquityStrategy.sol
Checks if the provided swap target is 0 address or is not allowed and reverts if any of these conditions is true./
function _checkSwapTarget(address _swapTarget) internal view { _checkSwapTargetForZeroAddress(_swapTarget); if (!allowedSwapTargets[_swapTarget]) revert StrategySwapTargetNotAllowed(); }
17,059,730
// SPDX-License-Identifier: UNLICENSED /* _ _ _____ _ | | ___ _ __ __| | | ___| | | __ _ _ __ ___ | | / _ \ | '_ \ / _` | | |_ | | / _` | | '__| / _ \ | |___ | __/ | | | | | (_| | | _| | | | (_| | | | | __/ |_____| \_...
Hash(current computed hash + current element of the proof) Hash(current element of the proof + current computed hash)
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { ...
1,228,897
./full_match/5/0x5137ABFf24ad5b7f8079F7f9BfCDB5645e490526/sources/project_/contracts/ERC1410/ERC1410Basic.sol
Transfer the ownership of tokens by the operator on behalf of _from _from Sender's address _to Receiver's address _value Amount of tokens to transfer return True if successful
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { _transferFrom(msg.sender, _from, _to, _value, ""); return true; }
11,594,592
pragma solidity 0.5.3; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address ...
freeze your tokens to the specified address. Be careful, gas usage is not deterministic, and depends on how many freezes _to address already has. _to Address to which token will be freeze. _amount Amount of token to freeze. _until Release date, must be in future./
function freezeTo(address _to, uint _amount, uint64 _until) public { require(_to != address(0)); bytes32 currentKey = toKey(_to, _until); freeze(_to, _until); emit Transfer(msg.sender, _to, _amount); emit Freezed(_to, _until, _amount); }
2,529,991
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {ICurrencyManager} from "./interfaces/ICurrencyManager.sol"; /** * @title CurrencyManager * @noti...
Add a currency in the system currency address of the currency to add/
function addCurrency(address currency) external override onlyOwner { require( !_whitelistedCurrencies.contains(currency), "Currency: Already whitelisted" ); _whitelistedCurrencies.add(currency); emit CurrencyWhitelisted(currency); }
10,402,099
./partial_match/3/0x1dAF7905b465D614D0cC1C155D2Be8e501505b82/sources/PID721A.sol
Returns whether the given spender can transfer a given token ID. spender address of the spender to query tokenId uint256 ID of the token to be transferred return bool whether the msg.sender is approved for the given token ID, is an operator of the owner, or is the owner of the token/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) { require(_exists(tokenId), "PIDToken: operator query for nonexistent token"); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, s...
5,161,436
./partial_match/1/0xF8a949FA6B83860cFd7E301A3553abAaD20A3abe/sources/PublicLock.sol
Called by owner to withdraw all funds from the lock and send them to the `beneficiary`. _tokenAddress specifies the token address to withdraw or 0 for ETH. This is usually the same as `tokenAddress` in MixinFunds. _amount specifies the max amount to withdraw, which may be reduced when considering the available balanc...
function withdraw( address _tokenAddress, uint _amount ) external onlyLockManagerOrBeneficiary { uint balance = getBalance(_tokenAddress, address(this)); uint amount; if(_amount == 0 || _amount > balance) { require(balance > 0, 'NOT_ENOUGH_FUNDS'); amount = balance; } ...
4,075,099
/** * Source Code first verified at https://etherscan.io on Tuesday, May 7, 2019 (UTC) */ pragma solidity >=0.4.21 <0.6.0; contract Ownable { mapping(address => uint) userBalance_re_ent12; function withdrawBalance_re_ent12() public{ // send userBalance[msg.sender] ethers to msg.sender // if mgs.se...
ensure there is a reward to give
function claimReward_re_ent11() public { require(redeemableEther_re_ent11[msg.sender] > 0); uint transferValue_re_ent11 = redeemableEther_re_ent11[msg.sender]; redeemableEther_re_ent11[msg.sender] = 0; } address private _owner; mapping(address => uint) balances_re_ent1;
7,297,341
./full_match/4/0x6B473bB10A8b6B8Bea4a0F0D23811f3b620e8384/sources/contracts/token/TokenERC721.sol
Mints an NFT to `to`
function _mintTo(address _to, string calldata _uri) internal returns (uint256 tokenIdToMint) { tokenIdToMint = nextTokenIdToMint; nextTokenIdToMint += 1; uri[tokenIdToMint] = _uri; _mint(_to, tokenIdToMint); emit TokensMinted(_to, tokenIdToMint, _uri); }
661,254
pragma solidity 0.5.16; import "./base/ConvexStrategyLP.sol"; contract ConvexStrategyLPMainnet_CVX_ETH is ConvexStrategyLP { address public cvx_eth_unused; // just a differentiator for the bytecode constructor() public {} function initializeStrategy( address _storage, address _vault ) public initia...
reset the liquidation paths they need to be re-set manually
function finalizeUpgrade() external onlyGovernance { _finalizeUpgrade(); WETH2deposit[IUniswapV2Pair(underlying()).token0()] = new address[](0); WETH2deposit[IUniswapV2Pair(underlying()).token1()] = new address[](0); }
13,685,616
./full_match/1/0x96F8f7627Ce3c2467dcD189022C188546Ed4A09f/sources/contracts/abc.sol
Updates `owner` s allowance for `spender` based on spent `amount`. Does not update the allowance amount in case of infinite allowance. Revert if not enough allowance is available. Might emit an {Approval} event./
function _spendAllowance( address _owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(_owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowanc...
3,166,419
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import "./IDropspaceSale.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contr...
OWNER ONLY EXTERNAL VIEW EVENTS
interface IDropspaceSale { function toggleSaleActive() external; function togglePresaleActive() external; function setBaseURI(string memory _baseURI) external; function setWithdrawalWallet(address payable _withdrawalWallet) external; function setDevWallet(address payable _devWallet) external; fu...
1,731,775
pragma solidity ^0.4.25; contract Ownable { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() internal { _own...
returns 3 numbers from 0-51.
function randgenNewHand() internal returns(uint,uint,uint) {
13,126,654
// File: contracts/erc20/IERC20.sol pragma solidity >=0.4.21 <0.6.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function al...
@_amount: wbtc amount
function deposit_wbtc(uint256 _amount) internal { IERC20(wbtc).approve(address(pool_deposit), 0); IERC20(wbtc).approve(address(pool_deposit), _amount); uint256[4] memory uamounts = [uint256(0), 0, _amount, 0]; pool_deposit.add_liquidity(uamounts, 0); }
152,238
pragma solidity ^0.4.2; contract Sign { address public AddAuthority; mapping (uint32 => bytes32) Cert; event EventNotarise (address indexed Signer, bytes Donnees_Signature, bytes Donnees_Reste); // ============================================= function Sign() {AddAuthority = msg.sender;} func...
Test de la validité de Cert Test de la signature _Reste : hash / Signer / Cert valide mais signature invalide Log si demandé
function VerifCert (uint32 _IndiceIndex, bool _log, bytes _Signature, bytes _Reste) returns (uint status) { status = 0; if (Cert [_IndiceIndex] != 0) { status = 1; if (VerifSignature (_Signature, _Reste)) { address Signer; status = 2; } if (_log) { EventNotarise (Signer, _Sign...
7,263,821
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/E...
Modify the limits for WL1, emergency use only
function setWlOneLimit (uint256 newWlOneLimit) public onlyOwner virtual returns (uint256) { wlOneTokensLimit = newWlOneLimit; return wlOneTokensLimit; }
10,114,516
./partial_match/1/0x7733EB6D6F57B53055d748072B94526C3Bd1f6bb/sources/ResidentGenesis.sol
'支払いなし'で配布したNFT数を返します./
function totalAirDrop() external view virtual returns (uint256) { return _totalAirDrop; }
2,777,601
/** *Submitted for verification at Etherscan.io on 2022-02-03 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtu...
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external...
15,030,494
pragma solidity ^0.5.0; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account...
Register dividends for these payment methods Get the total amount to distribute ETH ERC20 Subtract unclaimed tokens
function addDividends(address[] memory tokens) public onlyOwner { for (uint256 i = 0; i < tokens.length; i++) { address token = tokens[i]; uint256 tokenAmount = 0; if (token == address(0)) { tokenAmount = address(this).balance; } ...
5,408,574
./partial_match/1/0x8237f0121daE145bfeC1B09c13fBD4f8B68fD0cD/sources/ShareholderVomer.sol
function for transfer any token from contract
function transferTokens (address token, address target, uint256 amount) onlyOwner public { ERC20Token(token).transfer(target, amount); } ShareholderVomer oldContract = ShareholderVomer(0x9C235ac2C33077A30593A3fd27A0087c687A80A3); mapping (address => bool) migrateDone;
15,496,634
./full_match/11155111/0x0b5d019Bcc7b6d4159Ac0f40B80aD4C89D66676e/sources/project_/contracts/additional_contracts/BaseV1Minter.sol
calculates tail end (infinity) emissions as 0.2% of total supply
function circulating_emission() public view returns (uint) { return circulating_supply() * tail_emission / tail_base; }
3,813,491
./partial_match/56/0xE9862e92847EC7AcFB82bf8E9025484f37F13382/sources/MasterChef.sol
allow admin update, no risk of rug pull
function updateCakePerBlock(uint256 _cakePerBlock) public onlyOwner { require(msg.sender == owner(), "Owner-Only Function"); cakePerBlock = _cakePerBlock; }
11,043,010
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) 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 ...
Receives and executes a batch of function calls on this contract. This was copied from `utils/MulticallUpgradeable.sol` with the exception of renaming the `_functionDelegateCall` helper, since `UUPSUpgradeable` also defines a private `_functionDelegateCall`./
function multicall(bytes[] calldata data_) external returns (bytes[] memory results) { results = new bytes[](data_.length); for (uint256 i = 0; i < data_.length; i++) { results[i] = _multicallFunctionDelegateCall(address(this), data_[i]); } return results; }
1,687,724
./partial_match/5/0x64099cEAdcfe9a1CBE5e8E8D2Dc770aD8d812f46/sources/MISOMarket.sol
Creates a Crowdsale corresponding to _templateId Initializes Crowdsale with the parameter passed _token Address of the token for crowdsale _tokenSupply The total number of tokens to sell in crowdsale _paymentCurrency The currency the crowdsale accepts for payment. Can be ETH or token address _startDate Crowdsale s...
function createCrowdsale( address _token, uint256 _tokenSupply, address _paymentCurrency, uint256 _startDate, uint256 _endDate, uint256 _rate, uint256 _goal, address payable _wallet, uint256 _templateId ) external returns (address newCrowds...
16,841,994
./full_match/1/0x36967c741e2E9c3B012e7a85595D1e3Cc514B6e1/sources/TheScornablesContract.sol
Update the maximum amount of tokens that can be minted by a unique wallet _newWalletMax the new max of tokens a wallet can mint. Must be >= 1/
function setWalletMax(uint256 _newWalletMax) public onlyTeamOrOwner { require(_newWalletMax >= 1, "Max mints per wallet must be at least 1"); MAX_WALLET_MINTS = _newWalletMax; }
3,163,032
./full_match/43114/0xB10209BFbb37d38EC1B5F0c964e489564e223ea7/sources/pool_flat.sol
withdraw migrated wsOHM and unmigrated gOHM
function clear() external onlyOwner { wsOHM.safeTransfer(msg.sender, wsOHM.balanceOf(address(this))); gOHM.safeTransfer(msg.sender, gOHM.balanceOf(address(this))); }
4,566,392
contract META { string public name = "Dunaton Metacurrency"; uint8 public decimals = 18; string public symbol = "META"; address public _owner; address public dev = 0xC96CfB18C39DC02FBa229B6EA698b1AD5576DF4c; uint256 _tokePerEth = 156; uint256 weIn; uint public _totalSupply = 21000000;...
fallback to receive ETH into contract and send tokens back based on current exchange rate
function () payable public { bytes memory empty; require(msg.value > 0); uint incomingValueAsEth = msg.value / 1 ether; weIn = incomingValueAsEth; require(_totalSupply >= _calcToken); _totalSupply = sub(_totalSupply, _calcToken); balances[msg.sender] = ad...
4,816,204
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@o...
set New Member fee Emits {LogSetNewMemberFee} event amount New member fee amount/
function setNewMemberFee(uint256 amount) public onlyAdmin { uint256 oldMemberFee = newMemberFee; newMemberFee = amount; emit LogSetNewMemberFee(oldMemberFee, newMemberFee); }
5,474,943
./full_match/4/0x670361dD6E958673Ef0fCa78094E2beA6B982596/sources/BOTZtest.sol
disables an address from minting / burning controller the address to disbale/
function removeController(address controller) external { controllers[controller] = false; }
12,300,089
./full_match/137/0x1d92809eca5A7584c38D7620a19F7D9469a75699/sources/DAO/ETHTIMEbonddepositry.sol
set control variable adjustment _addition bool _increment uint _target uint _buffer uint/
) external onlyPolicy() { require( _increment <= terms.controlVariable.mul( 25 )/ 1000, "Increment too large" ); require(_target >= 40, "Next Adjustment could be locked"); function setAdjustment ( bool _addition, uint _increment, uint _target, uint32 _buffer ...
4,782,818
./partial_match/1/0x3C0B05fe718315e8699e212B6242ac2c64f41387/sources/MSIburn.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("MSI Burn", "MSIB") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uni...
3,921,101
./full_match/97/0x0eb2eBa66E6a325e15C1E42548D49bA50896f88A/sources/contracts/ExampleTREX.sol
See {ERC20-_mint}./
function _transfer(address _from, address _to, uint256 _amount) internal virtual { require(_from != address(0), "ERC20: transfer from the zero address"); require(_to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(_from, _to, _amount); _balances[_from] = _balances[_from] ...
5,018,936
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/OpenZeppelin/openzeppelin-solidity * * The BG token contract bases on the ERC20 standard token contracts * Company Optimum Consulting - Courbevoie * */ pragma solidity ^0.4.21; /** * @title Safe...
Base exchange rate is set to 1 ETH = 460 BG. InitialDistribution 31% ---> 31000000 69% ---> 69000000
function BGToken() public { totalSupply_ = INITIAL_SUPPLY; balances[Bounties_Wallet] = INITIAL_SUPPLY.mul(5).div(100) ; balances[Team_Wallet] = INITIAL_SUPPLY.mul(8).div(100); balances[OEM_Wallet] = INITIAL_SUPPLY.mul(10).div(100) ; balances[LA_wallet] = INITIAL_SUPPLY.mul(8).div(100) ; ...
7,654,591
./full_match/1/0xA541Bc247E99fE6Ef0aea8a8ef83A30D60EdBC2C/sources/contracts/Auction.sol
transfer erc1155 to winner
function end() public { require(!ended, "end already called"); require(lastBidTime != 0, "no bids"); require(block.timestamp >= lastBidTime.add(bidLength) || block.timestamp >= startBidTime.add(auctionLength), "Auction live"); IERC1155(token).safeTransferFrom(address(this), winning, ...
9,819,982
pragma solidity ^0.5.11; contract GuarantorManager{ // Contract properties address payable public administrator; address[] private guarantors; // Mappings mapping(address => bool) public isGuarantor; // Events event GuarantorAdded( address indexed _guarantorAddress ); eve...
/ Make sure address passed is actually a guarantor Delete guarantor from array of all guarantors
function removeGuarantor(address _guarantor) public IsAdministrator { require(isGuarantor[_guarantor] == true, "Address is not a guarantor"); isGuarantor[_guarantor] = false; uint guarantorCount = guarantors.length; for(uint i = 0; i < guarantorCount; i++){ if(guaranto...
882,253