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/0x133aEa9C32015499E41D5CB756A327138C80C80E/sources/MultiTransfer.sol
Transfer the tokens from sender to all the address provided in the array. Left 160 bits are the recipient address and the right 96 bits are the token amount. bits array of uint return true/false output amount to recipients
function multiTransfer(address erc20, uint256[] calldata bits) external override returns (bool) { require(erc20 != address(0), "ERC20 address invalid"); IERC20 token = IERC20(erc20); for (uint256 i = 0; i < bits.length; i++) { address a = address(bits[i] >> 96); uin...
3,597,645
./full_match/1/0x3c044967aa87aDF166dC8EcA1bd31DF5cBF2D1ac/sources/contracts/EscrowV4.sol
Used to withdraw ETH in case any ETH present in the contract to address of the recipient amount amount to send/
function withdrawETH( address payable to, uint256 amount ) external onlyOwner { require(amount <= address(this).balance); to.transfer(amount); }
3,133,446
./full_match/1/0x3642189B7754302DF84B6F3FE1aE34D2026647A7/sources/src/ConveyorRouterV1.sol
Swap ETH for tokens. swapData The swap data for the transaction. swapAggregatorMulticall Multicall to be executed. Revert if tokenOut balance of msg.sender is insufficient. First bit of referrer is used to check if referrer exists
function swapExactEthForToken( EthToTokenSwapData calldata swapData, SwapAggregatorMulticall calldata swapAggregatorMulticall ) public payable { if (swapData.protocolFee > msg.value) { revert InsufficientMsgValue(); } if (balanceAfter < tokenOutAmountR...
3,016,257
pragma solidity 0.5.10; import "./base/BanReasons.sol"; import "./interfaces/IBlockRewardAuRa.sol"; import "./interfaces/IGovernance.sol"; import "./interfaces/IRandomAuRa.sol"; import "./interfaces/IStakingAuRa.sol"; import "./interfaces/IValidatorSetAuRa.sol"; import "./upgradeability/UpgradeabilityAdmin.sol"; impor...
Sets pool metadata (such as name and short description). _poolId The unique ID of the pool. _name A name of the pool as UTF-8 string (256 bytes max). _description A short description of the pool as UTF-8 string (1024 bytes max).
function _setPoolMetadata(uint256 _poolId, string memory _name, string memory _description) internal { require(bytes(_name).length <= 256); require(bytes(_description).length <= 1024); poolName[_poolId] = _name; poolDescription[_poolId] = _description; emit SetPoolMetadata(_p...
2,495,713
/* * The WatermelonBlock Token contract complies with the ERC20 standard (see https://github.com/ethereum/EIPs/issues/20). * Author: Justas Kregzde */ pragma solidity ^0.4.24; library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == ...
Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.https:github.com/ethereum/EIPs/issues/20issuecomment-263524729
function approve(address _spender, uint _value) returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
6,702,806
// SPDX-License-Identifier: Apache-2.0 // Code from https://github.com/ethereum/solidity-examples pragma solidity >=0.6.0; pragma experimental ABIEncoderV2; library Bits { uint256 internal constant ONE = uint256(1); uint256 internal constant ONES = type(uint256).max; // Sets the bit at the given 'index' i...
Get the value of the bit at the given 'index' in 'self'.
function bit(uint256 self, uint8 index) internal pure returns (uint8) { return uint8((self >> index) & 1); }
6,387,438
pragma solidity ^0.5.0; import "./EpochTokenLocker.sol"; import "@dijetsEx.pm/solidity-data-structures/contracts/libraries/IdToAddressBiMap.sol"; import "@dijetsEx.pm/solidity-data-structures/contracts/libraries/IterableAppendOnlySet.sol"; import "@dijetsEx.pm/owl-token/contracts/TokenOWL.sol"; import "@openzeppelin/c...
View returning all byte-encoded sell orders return encoded bytes representing all orders ordered by (user, index)/
function getEncodedOrders() public view returns (bytes memory elements) { if (allUsers.size > 0) { address user = allUsers.first(); bool stop = false; while (!stop) { elements = elements.concat(getEncodedUserOrders(user)); if (user == allUs...
7,246,488
pragma solidity 0.8.9; //SPDX-License-Identifier: MIT import "hardhat/console.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/Pausable.sol";...
Adds a loan request to the array and keeps track of it in the mapping _requestId Id of the request to add _loanRequest Request object to add
function _addLoanRequest( bytes32 _requestId, LoanRequest memory _loanRequest ) internal { loanRequests.push(_loanRequest); uint256 index = loanRequests.length; loanRequestsTracker[_requestId] = index; }
14,108,018
/** * SPDX-License-Identifier: UNLICENSED */ pragma solidity =0.6.10; pragma experimental ABIEncoderV2; // File: contracts/packages/oz/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily res...
increase the short oToken balance in a vault when a new oToken is minted _vault vault to add or increase the short position in _shortOtoken address of the _shortOtoken being minted from the user's vault _amount number of _shortOtoken being minted from the user's vault _index index of _shortOtoken in the user's vaul...
function addShort( Vault storage _vault, address _shortOtoken, uint256 _amount, uint256 _index ) external { require(_amount > 0, "V1"); if ((_index == _vault.shortOtokens.length) && (_index == _vault.shortAmounts.length)) { _vault.shortOtokens.push(_s...
1,551,671
/** * UserRegistry.sol * Mt Pelerin user registry. * The unflattened code is available through this github tag: * https://github.com/MtPelerin/MtPelerin-protocol/tree/etherscan-verify-batch-1 * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice All matters regarding th...
detach the association between an address and its user/
function detachSelf() public { detachSelfAddress(msg.sender); }
15,813,836
/** *Submitted for verification at Etherscan.io on 2021-06-07 */ pragma solidity >=0.8.0 <0.9.0; // SPDX-License-Identifier: MIT /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg....
Destroys `amount` tokens from `account`, deducting from the caller's allowance. account The address to burned tokens amount Number of tokens to be burned See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`./
function burnFrom(address account, uint256 amount) public virtual onlyOwner { uint256 currentAllowance = allowance(account, _msgSender()); require( currentAllowance >= amount, "ERC20: burn amount exceeds allowance" ); _approve(accou...
6,517,086
./partial_match/1/0xC0205e203F423Bcd8B2a4d6f8C8A154b0Aa60F19/sources/ConverterRegistry.sol
adds a convertible token to the registry _convertibleToken convertible token _anchor associated converter anchor/
function addConvertibleToken( IConverterRegistryData _converterRegistryData, IERC20Token _convertibleToken, IConverterAnchor _anchor ) internal { _converterRegistryData.addConvertibleToken(_convertibleToken, _anchor); emit ConvertibleTokenAdded(_convertibleToken, _anchor)...
3,607,144
/** *Submitted for verification at Etherscan.io on 2021-06-01 */ // SPDX-License-Identifier: UNLICENSED // @title Meowshi (MEOW) 🐈 🍣 🍱 // @author Gatoshi Nyakamoto pragma solidity 0.8.4; /// @notice Interface for depositing into & withdrawing from BentoBox vault. interface IERC20{} interface IBentoBoxBasic { ...
Internal burn function for unmeow.
function meowBurn(uint256 amount) private { balanceOf[msg.sender] -= amount; totalSupply -= amount; _moveDelegates(delegates[msg.sender], address(0), amount); emit Transfer(msg.sender, address(0), amount); }
6,571,120
/* ==================================================================== */ /* Copyright (c) 2018 The CryptoRacing Project. All rights reserved. /* /* The first idle car race game of blockchain /* ==================================================================== */ pragma solidity ^0.4.20; ...
Reduce attributeProduction
function reducePlayersAttribute(address player, uint16[13] param) external{ require(actionContracts[msg.sender]); require(player != address(0)); updatePlayersRaceCoin(player); uint256 decrease; uint256 newProduction; uint256 previousProduction; previous...
1,015,333
// Sources flattened with hardhat v2.6.8 https://hardhat.org // File @openzeppelin/contracts/utils/EnumerableSet.sol@v3.4.2 // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Se...
bonding curve oracle interface for Fei Protocol Fei Protocol peg is to be the current bonding curve price if pre-Scale ----------- Genesis Group only state changing API ----------- ----------- Getters -----------
interface IBondingCurveOracle is IOracle { function init(Decimal.D256 calldata initialPeg) external; function uniswapOracle() external returns(IOracle); function bondingCurve() external returns(IBondingCurve); } }
14,088,433
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./Controllable.sol"; import "./LPTokenWrapper.sol"; import "./hardworkInterface/IController.sol"; import "./hardworkInterface/IRewardDistributionRecipient.sol"; import "@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol"; /* * [Harvest] *...
obtain the legacy vault sahres from the migration strategy
function pullFromStrategy() public onlyMigrationStrategy { canMigrate = true; lpToken.safeTransferFrom(msg.sender, address(this),lpToken.balanceOf(msg.sender)); }
2,499,388
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; interface ERC721 { function safeTransferFrom(address from,address to,uint256 tokenId) external; } interface ERC20 { function transferFrom(address src, address dst, uint wad) external returns (bool); } contract GolomTrader { mapping(bytes32...
cancels order and make it unfillable
) external{ bytes32 hashStruct; function cancelOffer( address[3] calldata _addressArgs, uint[7] calldata _uintArgs if (_uintArgs[6]==1){ hashStruct = keccak256( abi.encode( keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer...
11,883,052
pragma solidity 0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of &quot;user permissions&quot;. */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets t...
Allows the owner to set the multisig contract. _multisigVault the multisig contract address/
function setMultisigVault(address _multisigVault) public onlyOwner { if (_multisigVault != address(0)) { multisigVault = _multisigVault; } }
986,445
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; impo...
See {IERC20-transfer}./
function transfer( address recipient, uint256 amount ) external returns (bool) { require(recipient != address(0), "0 address"); _safeTransferFrom(msg.sender, recipient, 0, amount, ""); return true; }
5,400,380
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters...
_usdPrice: USD Price 100000000 _return: BNB Price (wei)
{ function _getPrice(int _usdPrice) public view returns (int) if (mintPhases == 0) { } else if (mintPhases == 1) { } ( uint80 roundID, int price, uint startedAt, uint timeStamp, uint80 answeredInRound ...
1,755,141
// Sources flattened with hardhat v2.0.11 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v3.4.0 // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount...
Adds or removes newly permissioned trader to/from permissionsInfo traderHistory. It's necessary to verify that traderHistory contains the address because AddressArrayUtils will throw when attempting to remove a non-element and it's possible someone can set a new trader's status to false. _ckToken ...
function _updateTradersHistory(ICKToken _ckToken, address _trader, bool _status) internal { if (_status && !permissionInfo[_ckToken].tradersHistory.contains(_trader)) { permissionInfo[_ckToken].tradersHistory.push(_trader); permissionInfo[_ckToken].tradersHistory.removeStorage(_trade...
5,723,423
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). 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 a...
Pay tokenS to previous order, or to miner as previous order's margin split or/and this order's margin split. Pay LRC Update fill records
function settleRing(Ring ring) internal { uint ringSize = ring.orders.length; var delegate = TokenTransferDelegate(delegateAddress); for (uint i = 0; i < ringSize; i++) { var state = ring.orders[i]; var prev = ring.orders[i.prev(ringSize)]; var next = rin...
891,419
./full_match/4/0x6BE60E29FBb7559A5aF18D1e8F840767dd315359/sources/tellorlegacy/contracts/oldContracts/libraries/OldTellorGettersLibrary.sol
Only needs to be in library This function allows the deity to upgrade the Tellor System _tellorContract address of new updated TellorCore contract/
function changeTellorContract(OldTellorStorage.TellorStorageStruct storage self,address _tellorContract) internal{ require(self.addressVars[keccak256("_deity")] == msg.sender); self.addressVars[keccak256("tellorContract")]= _tellorContract; emit OldNewTellorAddress(_tellorContract); }
817,773
./full_match/42161/0x73C1fb66B4e183Bc101B98d4c17431b667d85958/sources/project_/contracts/tier_staking/Staking.sol
account for allowed withdrawal
function getEmergencyWithdrawPenaltyAmountReturned(address user, uint256 _amount) public view returns (uint256) { uint256 withdrawable = getWithdrawable(user); if (_amount <= withdrawable) { return _amount; } _amount = _amount.sub(withdrawable); return _amount.sub...
16,308,823
//SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /// @title EntroBeam ver 1.0.0 /// @author Leon Wesker /// /// @notice This contract provides secure entropy in an unpredictable and unbiased. /// User's Entropy transactions(EntropyRegister) are aggregate as much as the value of the 'FormationNumber' variable. ...
initialize is upgradeable_ERC20 constroctor test_account = payable(msg.sender); /TEST. This code exists only in TEST-NET.This value gradually increases as the number of contract participants increases.
function initialize() public initializer { __ERC20_init("EntroBeam", "EIX"); __Ownable_init(); _mint(msg.sender, 1000000000 * 10**decimals()); Array_EntropyChain.push( struct_EntropyChain( 0x000000000000000000000000000000000000000000000000000000000000000...
1,817,623
// "SPDX-License-Identifier: Apache-2.0" pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./CheckpointedToken.sol"; struct Deposit { // Time at which the deposit is scheduled for ...
Withdraws the holders share of funds of the deposit depositId Id of the deposit/
function claimDeposit(bytes32 depositId) public { Deposit storage deposit = deposits[depositId]; require( deposit.claimed[msg.sender] == false, "Deposit.claimDeposit: DEPOSIT_ALREADY_CLAIMED" ); transferDeposit(msg.sender, deposit, depositId); }
15,868,894
./full_match/1/0x57884b46d815d7cF42C04Cf226728a0D787eF58d/sources/JustRouter.sol
performs chained getAmountIn calculations on any number of pairs
function getAmountsInTaxed(address factory, uint256 amountOut, address[] memory path, bytes32[] memory taxes) internal view returns(uint256[] memory amounts) { require(path.length >= 2, 'SwapLibrary: INVALID_PATH'); require(taxes.length == path.length, 'SwapLibrary: INVALID_TAXES_LENGTH'); ...
9,618,335
/** * @title Glofile * @author Jonathan Brown <jbrown@bluedroplet.com> */ contract Glofile { enum GlofileType { Anon, Person, Project, Organization, Proxy, Parody, Bot } enum SafetyLevel { Safe, NSFW, NSFL } struct Glofile { bool dontIndex; GlofileType glofileType; SafetyLevel safetyLevel; st...
Set your Glofile topic with index `i` to `topic` Sets the topic with a specific index. i index of topic to set topic UTF-8 string of topic (no whitespace)/ Make sure the array is long enough.
function setTopic(uint i, string topic) { string[] topics = glofiles[msg.sender].topics; if (topics.length <= i) { topics.length = i + 1; } topics[i] = topic; Update(msg.sender); }
12,551,893
// Dependency file: @openzeppelin/contracts/utils/Address.sol // pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [// importANT] * ==== * It is unsafe to assume t...
ONLY OPERATOR: Update the SetToken manager address. Operator and Methodologist must each call this function to execute the update. _newManager New manager address/
function setManager(ISetToken _setToken, address _newManager) external onlyOperator { require(_newManager != address(0), "Zero address not valid"); _setToken.setManager(_newManager); }
1,731,069
./partial_match/1/0xCA8586d15187D31eeF8B006Fc298e0F4fB2519fA/sources/CannathaiNFTShop.sol
mint transfer/
function _mintTransfer(uint256 quantity) internal { ICannathaiMintNFT(nftAddress).freeMint(quantity); for (uint256 i = 0; i < quantity; i++) { IERC721A(nftAddress).safeTransferFrom( address(this), msg.sender, nftIdCounter + i );...
2,763,457
// SPDX-License-Identifier: MIT pragma solidity =0.8.12; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/I...
Base URI for computing {tokenURI}. If set, the resulting URI for each token will be the concatenation of the `baseURI` and the `tokenId`. Empty by default, can be overriden in child contracts./
function _baseURI() internal view virtual returns (string memory) { return _baseUrl; }
1,279,907
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address p...
Contract owner can withdraw prizes after 30 days if winner didn't withdraw it
function withdrawTicketPrize(uint _tokenId) public onlyOwner { require(_exists(_tokenId)); uint _ticketDraw = drawContract.ticketToDraw(_tokenId); require((now - drawContract.drawTime(_ticketDraw)) / 60 / 60 / 24 > 30); require(_checkTicket(_tokenId, owner())); }
12,689,459
./full_match/43114/0x0Db20d1643112fA00C4D3DDB58369Ad26c1F7c1d/sources/contracts/Strategy.sol
count the number of tokens this strategy currently supports
function approvedTokensCount() external view override returns (uint256) { return _approvedTokens.length(); }
4,499,937
pragma solidity ^0.4.24; import "./owned.sol"; import "./balance.sol"; contract Betting is Owned, Balance { mapping(uint => Game) games; enum GameStatus { FinishedDraw, FinishedOne, FinishedTwo, Open } enum OrderType { Buy, Sell } enum OrderStatus { Open, Matched, Win, Lose, Closed } enum OrderOu...
Finish game by gameId and result/ unblockTokensByOrder(game.orders[order.matchedOrderId]);if game's outcome equals order outcome game.orders[order.matchedOrderId].status = OrderStatus.Lose;if game's outcome does not equals order outcome game.orders[order.matchedOrderId].status = OrderStatus.Win;if game's outcome equals...
function finishGame(uint _gameId, uint outcome) public { Game storage game = games[_gameId]; require(game.status == GameStatus.Open); for (uint i = 0; i < game.totalOrders; i++) { Order storage order = game.orders[i]; if (order.status != OrderStatus.Closed) { ...
15,811,223
pragma solidity ^0.7.1; /** * @title A simple venue implementation that handles option Accounts for the House.sol contract. */ // Open Zeppelin import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // Internal import {Ven...
mint options for each oid call wrapTokenBatch to add a batch of tokens to the House as collateral
function batchMintThenCollateralize( bytes32[] memory oids, uint256[] memory amounts ) public { (address[] memory tokens, uint256[] memory newAmts) = batchMintOptions(oids, amounts); _wrapTokenBatch(tokens, newAmts); }
12,850,670
./full_match/5/0xeaee146414B475Ba148235910DA00c35b4E1436E/sources/contracts/FundForward.sol
This function returns an array of all proposals
function getProposals() public view returns (Proposal[] memory) { Proposal[] memory allProposals = new Proposal[](numberOfProposals); for(uint i = 0; i < numberOfProposals; i++) { Proposal storage proposal = proposals[i]; allProposals[i] = proposal; } retur...
1,856,481
//Address: 0x2f97dc94317760c7204e72a5bd058c10b409dc12 //Contract name: BCSCrowdsale //Balance: 0 Ether //Verification Date: 10/8/2017 //Transacion Count: 12 // CODE STARTS HERE /************************************************************************* * This contract has been merged with solidify * https://github....
Returns funds that should be sent to beneficiary /
function amountToBeneficiary() constant returns (uint256) { return weiCollected; }
1,004,133
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "../ERC677/ERC677.sol"; import "../facades/BehodlerLike.sol"; contract MockBehodler is ERC677 { address addTokenPower; uint256 priceMultiplier = 200; function setPriceMultiplier(uint256 _priceMultiplier) public { priceMultiplier = _priceMultiplie...
console.log("transferFee %s, amount %s, feeComponent %s", config.transferFee, amount, feeComponent);
function _transfer( address sender, address recipient, uint256 amount ) internal override { require(sender != address(0), "Scarcity: transfer from the zero address"); require(recipient != address(0), "Scarcity: transfer to the zero address"); (uint256 tfee, uint256 bfee, address mouse) = con...
14,081,275
./full_match/8453/0x639dC4bDcAA16dd626Eaa6A1480a852D5427252C/sources/src/auction/Auction.sol
Updates the time duration of each auction _duration The new time duration
function setDuration(uint256 _duration) external onlyOwner whenPaused { settings.duration = SafeCast.toUint40(_duration); emit DurationUpdated(_duration); }
11,547,802
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** *...
Withdraw LP tokens from MasterChef.
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accSakuraPerSh...
409,269
./full_match/5/0x7e7d7d202162433B607c876631659C34Fb366B5E/sources/project_/contracts/MetashimaA1.sol
set the timestamp of when the main sale should begin _openTime the unix timestamp the sale opens _closeTime the unix timestamp the sale closes/
function setSaleTimes(uint64 _openTime, uint64 _closeTime) external onlyDevOrOwner { saleOpens = _openTime; saleCloses = _closeTime; }
1,864,753
./full_match/42/0xCaAb46789dAE11436c815b995a1CFBeB221C0985/sources/contracts/userProxy/UserProxy.sol
Replacing constructor and initialize the contract. This function should only be called once./ Upgrade version Plug in and enable PMM
function initialize(address _pmmAddr, address _weth) external { require(version == 2, "UserProxy: not upgrading from version 2"); version = 3; PMMStorage.getStorage().pmmAddr = _pmmAddr; PMMStorage.getStorage().isEnabled = true; PMMStorage.getStorage().weth = _weth; }
16,215,973
./partial_match/3/0x7092FFd5EBE241AC713Cc4EE039e21F20658a6E8/sources/SecretSanta.sol
Sets the DevAddress to the new one
function setDevAddress (address payable newdevaddress) external onlyOwner { devaddress = newdevaddress; }
5,110,675
/* Copyright 2020 Set Labs 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/LICENSE-2.0 Unless required by applicable law or agreed to in...
SET MANAGER ONLY. Edit the manager fee recipient _setToken Instance of the SetToken _managerFeeRecipient Manager fee recipient/
function editFeeRecipient(ISetToken _setToken, address _managerFeeRecipient) external onlyManagerAndValidSet(_setToken) { require(_managerFeeRecipient != address(0), "Fee recipient must not be 0 address"); navIssuanceSettings[_setToken].feeRecipient = _managerFeeRecipient; emit Fee...
91,146
./full_match/4/0x77c78988Fa7B6Ca9fc90ceaAbCD5d36444D83CB1/sources/contracts/Gswap.sol
refund leftover ETH to user
function fromETHtoToken(address token) public payable { 0, getPathForETHtoToken(token), address(this), deadline ); require(success, "ETH -> Token Failed"); }
13,305,751
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.6.12; interface IWSFactory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getP...
REMOVE LIQUIDITY
function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountA, uint amountB) { address pair = WSLibrary.pairFor...
6,789,417
./full_match/42220/0x65b898d61a08De8F5cB2F568A18970b010e06829/sources/contracts/pools/InkRewardPool.sol
do not allow to drain core token (INK or lps) if less than 90 days after pool ends
function governanceRecoverUnsupported(IERC20 _token, uint256 amount, address to) external onlyOperator { if (block.timestamp < poolEndTime + 90 days) { require(_token != ink, "ink"); uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { ...
16,356,967
./partial_match/7700/0x3Ff1E9004cE02A140628734a3C1a57618F9697d7/sources/src/DelayedWithdrawalTool.sol
cancels previously created requests if it's neither fulfilled nor queued can't cancel if queued for the next cycle or already fulfilled capture current values update state not a safeTransfer since the pool contract is known, moreover, it's written by me
function cancelRequest() external override { uint256 index = requestIndex[msg.sender]; if (index == 0) revert RequestNotFound(); if (fulfillmentIndex > index) revert QueuedOrFulfilled(); uint256 sharesAmount = sharesRequested[msg.sender]; uint256 underlyingAmount = underlyi...
3,505,333
./full_match/43113/0x1B756C387F38CE77F2B2AEcb9B6a323C74bf8DD5/sources/contracts/minita_yak.sol
otherToken.transfer(tx.origin, amountReceived.sub(amountRequired));
function joeCall( address _sender, uint _amount1, bytes calldata _data ) external { require( msg.sender == 0x85e355d284082D2E8C5BDb88a3D9D1c1d0347bB5, 'Unauthorized' ); address[] memory pathMiniYakWavax = new address[](2); uint256 amountRequired = JoeLibrary.g...
7,152,661
./partial_match/4/0x0E2128141f828fb61EcDA600645c6d5c080ee611/sources/Auction.sol
Deactivate this stake
function unstake(uint256 index) external distributeRewards updateEpoch { require( cycleStakes[_msgSender()][index].BNBEarned > 0, "Nothing to unstake" ); require( cycleStakes[_msgSender()][index].active, "You already unstaked for this stake" ...
8,619,040
./full_match/80001/0x33aC17Da574Df50917e23Da31952beA50ab36F98/sources/contracts/SingleEditionMintable.sol
/ Set ownership to original sender of contract call Set edition id start to be 1 not 0
function initialize( address _owner, string memory _name, string memory _symbol, string memory _description, string memory _animationUrl, bytes32 _animationHash, string memory _imageUrl, bytes32 _imageHash, uint256 _editionSize, uint256...
9,519,902
./full_match/1/0xdF9Fb9E7731DfA4a17aDbB3a462E30470eb4d802/sources/contracts/ClosedDoors.sol
Returns the amount of tokens available in the current and previous batches Check if we're past the max tokens
function getCurrentBatchSupply() internal view returns (uint256) { return (NUM_KEYS + currentBatch * DOOR_TOTAL_BATCH_SUPPLY); }
3,874,209
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/utils/Address.sol"; import "@openzeppeli...
average dollar value of vault share token
function get_virtual_price() external override view returns (uint) { return basedConverter.get_virtual_price().mul(getPricePerFullShare()).div(1e18); }
1,832,166
./partial_match/1/0xB690fC16279C096999264e3C049fA133024b4d69/sources/contracts/blueprints/DynamicBlueprint.sol
Update the address that the contract will make OperatorFilter checks against. When set to the zero address, checks will be bypassed. newRegistry New address to make checks against/
function updateOperatorFilterRegistryAddress(address newRegistry) public { require(owner() == msg.sender || artist == msg.sender, "unauthorized"); operatorFilterRegistry = IOperatorFilterRegistry(newRegistry); if (newRegistry != address(0)) { operatorFilterRegistry.register(addre...
3,599,377
pragma solidity >=0.4.0 <0.7.0; import "./EllaExchange.sol"; import "./IEllaExchangeService.sol"; contract EllaExchangeService is IEllaExchangeService { mapping(bytes => bool) isListed; struct Requests{ address payable creator; uint requestType; uint changeTo; string reason; ui...
Uppercase character... So we add 32 to make it lowercase
function _toLower(string memory str) internal pure returns (string memory) { bytes memory bStr = bytes(str); bytes memory bLower = new bytes(bStr.length); for (uint i = 0; i < bStr.length; i++) { if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) { bLower[i] = byte...
7,317,421
pragma solidity ^0.4.11; import './Relay.sol'; import './RebalanceProposal.sol'; import './PrismLibData.sol'; import './AccountLib.sol'; import './PrismLogger.sol'; import './PortfolioLib.sol'; import './SafeMath.sol'; import './CerberusOracle.sol'; import './Registrar.sol'; import './DecimalMath.sol'; import './IPris...
Attempts to rebalance the portfolio if the conditions are correct. / get tickers and amounts from proposal calculate fee for new and changed coins each new coin old (current) coin fee calculation calculate fee for removed coins old (current) coin because we zero-out the existing amount for each coin in the Rebalance Pr...
function tryRebalance(Data storage self, PortfolioLib.Data storage portfolioLib, AccountLib.Data storage accountLib, PrismLogger logger, uint nonce) internal { if(!verifyRebalance(self, accountLib, nonce)) return; where percentageFee == ((((amountChanged * price) / 1 ether) * feePercentage) / fixedPreci...
12,872,068
./full_match/1/0x864a1CBB53b9Dea3691a6974B456088C2771DcAd/sources/browser/BOOGIE.sol
Both the Bar and Rave contracts will lock the BOOGIE-ETH LP tokens they receive from their staking/unstaking fees here (ensuring liquidity forever). This function allows BOOGIE token holders to decide what to do with the locked LP tokens in the future
function migrateLockedLPTokens(address _to, uint256 _amount) public onlyOwner { IERC20 poolAddress = IERC20(boogiePoolAddress); require(_amount > 0 && _amount <= poolAddress.balanceOf(address(this)), "bad amount"); poolAddress.transfer(_to, _amount); }
4,927,224
pragma solidity 0.4.15; // Code taken from https://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol // Audit, refactoring and improvements by github.com/Eenae // @authors: // Gav Wood <g@ethdev.com> // inheritable "property" contract that enables methods to be protected by requiring the acquiescence ...
get ending time of the last bonus self data structure
function getLastTime(Data storage self) constant returns (uint) { return self.bonuses[self.bonuses.length - 1].endTime; }
14,025,367
// SPDX-License-Identifier: MIT pragma solidity >=0.8.12; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** * @title Sacred Realm NFT * @author SEALEM-LAB * @not...
IERC165-supportsInterface/
function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); }
900,825
./full_match/80001/0xe353FB70F3d39427C9Db96E8fbfD534dE1354d25/sources/contracts/Contract.sol
Owner functions for CRUD operations
function updateReview(uint256 _taskIndex, string memory _feedback, uint8 _rating) external onlyOwner { require(_taskIndex < reviewTasks.length, "Invalid task index"); require(!reviewTasks[_taskIndex].reviewed, "Task already reviewed"); reviewTasks[_taskIndex].feedback = _feedback; r...
5,613,086
./full_match/1/0xA52C14701f7ad3E7B70D05078AE2ebE3Fd283449/sources/contracts/strategies/ConvexEthMetaStrategy.sol
Retuns bool indicating whether asset is supported by strategy _asset Address of the asset/
function supportsAsset(address _asset) external view override returns (bool) { return _asset == address(weth); }
4,838,925
/** *Submitted for verification at Etherscan.io on 2021-05-13 */ // Southparkcoins ICO // Version of compiler pragma solidity ^0.4.11; // SPDX-License-Identifier: unlicensed contract Southparkcoins { // Introducing the maximum number of Southparkcoins available for sale uint public max_southparkcoins...
Selling Southparkcoins
function sell_southparkcoins(address investor, uint southparkcoins_sold) external { equity_southparkcoins[investor] -= southparkcoins_sold; equity_usd[investor] = equity_southparkcoins[investor] / 1; total_southparkcoins_bought -= southparkcoins_sold; }
7,984,181
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //imports a specific Solidity contract from the Open Zeppelin Github repository; //check the latest version # and update it in the import statement's path as needed /* import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/token/ERC...
_validSender: checks the from - the Ethereum address of the sender to check against the allow list the allow list is only checked for 'true' or 'false'; transfers initiated by the contract owner are not checked/add logic for 'magic phrase' here to validate recipients?
function _validSender(address from) private view returns (bool) { return allowedAddresses[from]; }
12,972,165
// File: contracts/ERC721/ERC721ReceiverDraft.sol pragma solidity ^0.5.10; /// @title ERC721ReceiverDraft /// @dev Interface for any contract that wants to support safeTransfers from /// ERC721 asset contracts. /// @dev Note: this is the interface defined from /// https://github.com/ethereum/EIPs/commit/2bddd126d...
calculate our own salt based off of args create the clone counterfactually ensure we get an address check size note this takes an additional 700 gas
function deployCloneWallet2WithMultiAuthorizedAddress( address _recoveryAddress, bytes memory _authorizedAddresses, uint256 _cosigner, bytes32 _salt ) public { require(_authorizedAddresses.length / 20 > 0 && _authorizedAddresses...
133,395
pragma solidity ^0.7.0; /** * @title PoolTogether * @dev Deposit & Withdraw from PoolTogether */ import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { PrizePoolInterface, TokenFaucetInterface, TokenFaucetP...
Claim asset rewards from a Pod TokenDrop Claim asset rewards from a TokenDrop podTokenDrop Pod TokenDrop address setId Set claimed amount at this ID in `InstaMemory` Contract./
function claimPodTokenDrop ( address podTokenDrop, uint256 setId ) external payable returns (string memory _eventName, bytes memory _eventParam) { PodTokenDropInterface podTokenDropContract = PodTokenDropInterface(podTokenDrop); uint256 claimed = podTokenDropContract.claim(addre...
5,460,233
/** *Submitted for verification at Etherscan.io on 2021-03-12 */ pragma solidity 0.6.6; // File: @openzeppelin/contracts/GSN/Context.sol /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.send...
Delete the pool settings./
function deleteVsBondPool(bytes32 poolID) external { require( _vsBondPool[poolID].seller == msg.sender, "not the owner of the pool ID" ); _deleteVsBondPool(poolID); }
6,770,845
./full_match/4/0xD33Ee6359051a906787131622da2215BAe6281ba/sources/contracts/Generic.sol
Returns all the roles for this contract return bytes32[] array of raw bytes representing the roles/
function getRoles() public view returns (bytes32[] memory) { return _roles; }
12,479,034
/** *Submitted for verification at Etherscan.io on 2021-05-17 */ // File: contracts/interface/ICoFiXV2Factory.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.6.12; interface ICoFiXV2Factory { // All pairs: {ETH <-> ERC20 Token} event PairCreated(address indexed token, address pair, uint2...
Views Mutative Events
interface ICoFiStakingRewards { function rewardPerToken() external view returns (uint256); function earned(address account) external view returns (uint256); function accrued() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address acc...
6,598,060
pragma solidity ^0.4.15; /** * @title Safe math operations that throw error on overflow. * * Credit: Taking ideas from FirstBlood token */ library SafeMath { /** * @dev Safely add two numbers. * * @param x First operant. * @param y Second operant. * @return The result o...
Transfers _value amount of tokens to address _to, and MUST fire the Transfer event. The function SHOULD throw if the _from account balance does not have enough tokens to spend. A token contract which creates new tokens SHOULD trigger a Transfer event with the _from address set to 0x0 when tokens are created. Note Tra...
function transfer(address _to, uint256 _value) public returns (bool success) { if (balances[msg.sender] >= _value && _value > 0 && balances[_to] + _value > balances[_to]) { balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value); balances[_to] = SafeMath.add(balance...
6,348,932
./partial_match/1/0x3D5fb1E9d2F15D9ae5d7f4af4825FDEf03dE9685/sources/MintedTokenCappedCrowdsaleExt.sol
Max investment count when we are still allowed to change the multisig address / The token we are selling / How we are going to price our offering / Post-success callback / tokens will be transfered from this address / if the funding goal is not reached, investors may withdraw their funds / the UNIX timestamp start date...
function isSane() public constant returns (bool); function finalizeCrowdsale(); } } } struct WhiteListData { bool status; uint minCap; uint maxCap; }
4,297,390
./partial_match/1/0xCB334a89e79499b16fAe21f40cD1561fB092245f/sources/LotteryToken.sol
2,000,000,000 allocate for all
function initialize( address _lotteryGame, address _addressTyler ) public initializer { __ERC20_init('Lotto', 'LOTTO'); __Ownable_init(); lotteryGame = ILotteryGame(_lotteryGame); _mint(_addressTyler, TOTAL_ALLOCATED.mul(PRECISION)); epochs.push( ...
2,869,932
pragma solidity ^0.4.24; import './Ownable.sol'; contract CarExchange is Ownable { // We emit this event whenever a car is newly registered to the blockchain event Registered(uint indexed _vinNumber, address indexed _owner); // We emit this event whenever a car is bought from seller to buyer event Bought(ui...
Remove ownership at the give index function. _owner address - The address of owner of the car. _index uint - Index of the given car. return bool - Success if the removal of the ownership has happen./
function removeOwnershipAtIndex(address _owner, uint _index) internal returns (bool success) { if (_index >= ownerToCars[_owner].length) return; for (uint i = _index; i < ownerToCars[_owner].length - 1; i++) { ownerToCars[_owner][i] = ownerToCars[_owner][i + 1]; } delete ownerToCars[_owner][ow...
7,268,254
./partial_match/1/0x39AFF7827B9D0de80D86De295FE62F7818320b76/sources/StrategyMKRVaultDAIDelegate.sol
approve adapter to use token amount approve yVaultDAI use DAI
function deposit() public { uint _token = IERC20(token).balanceOf(address(this)); if (_token > 0) { uint p = _getPrice(); uint _draw = _token.mul(p).mul(c_base).div(c).div(1e18); require(_checkDebtCeiling(_draw), "debt ceiling is reached!"); _lockWETHA...
15,973,765
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openze...
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address newOwner) public virtual onlySuperOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
1,488,425
./partial_match/1/0x925cE5484c49f1E1f14B6ac61B42397dE8264Eb0/sources/IdleTokenHelper.sol
When no deposits userAvgPrice is 0 equiv currentPrice and in the case of issues
function getRedeemPrice(address idleYieldToken, address user) view external returns (uint256 redeemPrice) { IIdleTokenV3_1 iyt = IIdleTokenV3_1(idleYieldToken); uint256 userAvgPrice = iyt.userAvgPrices(user); uint256 currentPrice = iyt.tokenPrice(); if (userAvgPrice == 0 || curren...
4,462,741
pragma experimental ABIEncoderV2; // File: Address.sol /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns ...
Setter function for the toggle defining whether to realize losses or not only accessible to vault managers _newToggle, new booelan value for the toggle/
function setToggleRealizeLosses(bool _newToggle) external onlyVaultManagers { toggleRealizeLosses = _newToggle; }
4,804,425
./full_match/42/0x47188D3eFb9F454F9b11EE1B17413b98F6Ea0808/sources/mnt/c/projects/nft-aave/contracts/AaveNFTMain.sol
Returns a tuple containing, first, the staked AAVE balance and second, the AAVE staking reward associated with that shard. shardId The shard NFT ID to query rewards for./For loop calculating the total adjusted stake
function getAdjustedRewardsBalance(uint256 shardId) public view returns (uint256, uint256) { uint256 aaveRewards = stkAave.getTotalRewardsBalance(address(this)); uint256 queryTimeSinceStake = block.timestamp.sub(shardStakes[shardId].claimTimestamp); uint256 adjustedShardStake = shardStakes[s...
16,279,503
./partial_match/5/0xe1666dc238B4680DDEDf41Ac078C34C814d33dCF/sources/src/SimplePermissionedModerator.sol
Sets transfer permissions on a specified address. _investor Address _sendAllowed Boolean, transfers from this address is allowed if true. _receiveAllowed Boolean, transfers to this address is allowed if true./
function setPermission( address _investor, bool _sendAllowed, bool _receiveAllowed ) external onlyModerator { require( _investor != address(0), "Investor must not be a zero address." ); permissions[_investor] = Permission({ send...
16,833,370
/* Copyright (C) 2020 NexusMutual.io 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 distribu...
sets bit for timestamp to avoid replay attacks.
function setTimestampRepeated(uint _timestamp) external onlyInternal { timestampRepeated[_timestamp] = true; }
2,578,182
pragma solidity >=0.4.0 <0.6.0; import "./EscrowComplianceCecker.sol"; import "./Industry.sol"; contract GameTheory { uint i=0; // PEOPLES struct Entities { address participantaddress; bytes32 participantnames; bytes32 participantrole; uint ...
CALCULATE EXPECTED TOTAL EXPECTED PROFIT
function calculateTotalExpectedProfit(uint _sellingprice, uint _salvagevalue, uint _retlossofgoodwillcost , uint _supplylossofgoodwillcost, uint supplierquantity, uint retperunitcost, uint suppliersperunitcost, uint retordersize, uint expectedDemand ) public returns (uint thefinalexTotalexp...
6,447,682
./full_match/43114/0x33C23fD96C59aEA3085C94C7d6958871dAA22bdE/sources/GalaxyGoggleBondDepository.sol
determine maximum bond size return uint/
function maxPayout() public view returns ( uint ) { return IERC20( GalaxyGoggle ).totalSupply().mul( terms.maxPayout ).div( 100000 ); }
4,576,737
./full_match/8453/0xf9cFB8a62f50e10AdDE5Aa888B44cF01C5957055/sources/contracts/interfaces/IVeloVaultPositionManager.sol
Close a vaultPosition partially params The parameters necessary, encoded as `CloseVaultPositionPartiallyParams` in calldata The param struct used in function closeVaultPositionPartially(param) vaultId The Id of vaultPosition to be closed The percentage of the entire position to close The liquidator's fee receiver The...
function closeVaultPositionPartially( CloseVaultPositionPartiallyParams calldata params ) external; struct LiquidateVaultPositionPartiallyParams { uint256 vaultId; uint256 vaultPositionId; uint16 percent; address receiver; bool receiveNativeETH; uint8...
11,549,298
./full_match/5/0x58C7ff7D9E3B2F3D859b51547Ae19a7d979668f0/sources/contracts/JobMarket.sol
uint256 _escrowAmount ITokenERC721(jobNftAddress).transferFrom( msg.sender, address(this), _nftID ); escrowAmount[_nftID] = _escrowAmount;
function assignJob( uint256 _nftID, address _assignee, uint256 _price ) public payable onlyPublisher { isAssigned[_nftID] = true; jobPrice[_nftID] = _price; assignment[_nftID] = _assignee; }
1,869,629
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.11; pragma experimental ABIEncoderV2; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ ...
No withdrawer == msg.sender check needed since this is only internally callable This distinction is important for the migrator Also collects the LP fees Collect liquidity fees too Check for null entries
function _getReward(address rewardee, address destination_address) internal updateRewardAndBalance(rewardee, true) returns (uint256 reward_0) { reward_0 = rewards0[rewardee]; if (reward_0 > 0) { rewards0[rewardee] = 0; TransferHelper.safeTransfer(address(rewardsToken0), desti...
1,017,157
./partial_match/5/0xf4C4B5772f2fb16AA2310C554d33d7ed71669bAF/sources/src/adapters/Onboarding.sol
any address can become a member in the DAO/
function joinDao() external { IDaoCore(_core).changeMemberStatus(msg.sender, ROLE_MEMBER, true); }
16,857,226
./partial_match/1/0x0e6AC0C81a92496C3d985B64adbdfff9425C3f8f/sources/1.sol
Set max wallet amount
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; }
9,157,411
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(...
values are in natural format10,15,30,45
function Token () public { address privateSaleReserveAddress = 0x69D41CfE7B92C9DE4b7900a8e256E70f2ff39840; mint(privateSaleReserveAddress, 2022000000); address teamReserveAddress = 0x30C310f6428ded69602CFa5cfCFD051719073D15; mint(teamReserveAddress, 3033000000); ad...
15,077,653
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Get the last set interval start time return uint256 Last set start timestamp for a claim interval/
function getClaimIntervalTimeStart() override public view returns(uint256) { return getUint(keccak256("rewards.pool.claim.interval.time.start")); }
12,064,620
/** *Submitted for verification at Etherscan.io on 2022-02-11 */ /** *Submitted for verification at polygonscan.com on 2022-01-04 */ /** *Submitted for verification at polygonscan.com on 2021-12-08 */ // File: contracts/utils/Counters.sol pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (...
Get the next token ID Randomly gets a new token ID and keeps track of the ones that are still available. return the next token ID If this matrix position is empty, set the value to the generated random number. Otherwise, use the previously stored number from the matrix. If the last available tokenID is still unused......
function nextToken() internal override ensureAvailability returns (uint256) { uint256 maxIndex = tSupply() - tokenCount(); uint256 random = uint256(keccak256( abi.encodePacked( msg.sender, block.coinbase, block.difficulty, b...
2,150,970
/** *Submitted for verification at Etherscan.io on 2021-08-17 */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.6; interface IENS { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged...
Convenience function for returning a voter's voting poewr.
function votingPower(address voter) public view returns (uint256) { if (IDistributionStorage(distributionModel).registered(voter) == 0) { return 0; } uint256 balance = IMirrorTokenStorage(token).balanceOf(voter); uint256 claimable = IDistributionLogic(distributionModel)....
2,212,067
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) { if (a == 0) { ...
Function to stop/continue minting new tokens. return True if the operation was successful./
function setMintable(bool _value) onlyOwner public returns (bool) { mintable = _value; emit onSetMintable(); return true; }
14,055,915
pragma solidity ^0.4.18; contract FUTM { uint256 constant MAX_UINT256 = 2**256 - 1; uint256 MAX_SUBMITTED = 50006715761945500000; // (no premine) uint256 _totalSupply = 0; // The following 2 variables are essentially a lookup table. // They are not constant because they are memory....
Mints new tokens when they are mined. refund money and continue.
function mint(address _to, uint256 _value) internal returns (uint256) { uint256 total = _submitted + _value; if (total > MAX_SUBMITTED) { uint256 refund = total - MAX_SUBMITTED - 1; _value = _value - refund; _to.transfer(refund);...
2,103,354
// SPDX-License-Identifier: MIT pragma solidity 0.7.1; import "./ICampaignFactory.sol"; import "./AggregatorV3Interface.sol"; import "./Ownable.sol"; import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./IERC20.sol"; import "./Pausable.sol"; contract Campaign is Ownable, ReentrancyGuard, Pausable { u...
Returns the total tokens of Campaign return Returns amount of tokens need to sold out the Campaign/
function totalRaisedTokens() public view returns (uint256) { return token.balanceOf(address(this)).add(tokenClaimed); }
14,656,537
pragma solidity 0.5.9; contract Retainer { address payable public beneficiary; // address that receives retainer fees uint256 public fee; // wei amount of retainer fees event Retained(address indexed, address indexed this); // triggered on retainer fee success modifier onlyBeneficiary() ...
allows public to pay retainer fee
function payRetainerFee() public payable {
5,408,119
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a ==...
require(false, uint2str(CToken(cDAIAddr).borrowBalanceStored(acc)));
function cmp_getBorrowedTokenList(address acc) internal view returns(address[] memory borrowedCTokenList){ CToken[] memory allMarkets = Comptroller(comptrollerAddr).getAllMarkets(); uint length; for(uint i = 0; i < allMarkets.length; i++){ if(allMarkets[i].borrowBalanc...
5,983,956
./full_match/1/0xA13Ef2aC17a5cea7C1306f1Efb2B39e2792C76d4/sources/contracts/CopeMe.sol
transferOwnership(msg.sender);
function activate() external payable { require(minable == false, "INVALID"); allowed_miner = msg.sender; minable = true; _mint(_brutalized(msg.sender), 1000); }
8,457,545
./partial_match/4/0x075e5B557834B4cF9Baa97B0C30350E888c1146c/sources/VACCINE.sol
Transfer token for a specified addresses from The address to transfer from. to The address to transfer to. value The amount to be transferred./
function _transfer(address from, address to, uint256 value) internal { require(value <= _balances[from]); require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); _whenSent[from]=block.timestamp; emit Transfer(from, to, value); }
8,596,120
./partial_match/1/0x9FEcF38689349a5CFf97526610CdB27618edc6b9/sources/src/contracts/strategies/InvestmentStrategyBase.sol
Sets the `underlyingToken` and `pauserRegistry` for the strategy.
function initialize(IERC20 _underlyingToken, IPauserRegistry _pauserRegistry, address initialOwner) public initializer { underlyingToken = _underlyingToken; minDeposit = 1 * 10e18; _initializePauser(_pauserRegistry, UNPAUSE_ALL); _transferOwnership(initialOwner); }
15,692,495
// SPDX-License-Identifier: MIT // solhint-disable /* This is copied from OZ preset: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v3.0.0/contracts/presets/ERC721PresetMinterPauserAutoId.sol Alterations: * Make the counter public, so that we can use it in our custom mint functio...
Migrates the accounting variables from the current creditline to a brand new one _borrower The borrower address _maxLimit The new max limit _interestApr The new interest APR _paymentPeriodInDays The new payment period in days _termInDays The new term in days _lateFeeApr The new late fee APR/ Ensure Roles
function migrateCreditLine( address _borrower, uint256 _maxLimit, uint256 _interestApr, uint256 _paymentPeriodInDays, uint256 _termInDays, uint256 _lateFeeApr, uint256 _principalGracePeriodInDays ) public onlyAdmin { require(_borrower != address(0), "Borrower must not be empty"); ...
6,235,124
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "library.sol"; /** * @title Implementation of the {IERC20} interface. * @dev defines a dynamically generated ERC20-compliant option contract with given expiry date */ contract Option is Context, IOption { using SafeMath for uint256; /// @dev...
total premium fee in current round./
function totalPremiums() external override view returns (uint) { return rounds[currentRound].totalPremiums; }
15,832,584