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/0xd684F5C8c6467E1CC502875719A7Ba38c23FDC63/sources/mo4c.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Memes Of 4Chan", "MO4C") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factor...
16,017,117
pragma solidity ^0.4.18; import 'zeppelin-solidity/contracts/math/SafeMath.sol'; import './IVideoBase.sol'; contract VideoBaseAccessor { using SafeMath for uint256; /*** STORAGE ***/ /// @dev VideoBase contract. IVideoBase videoBase; /// @dev Payee who receive partial value in a payable transaction. a...
get split of payee, if payee is 0x0, returns 0. _value to be split.
function getPayeeSplit(uint256 _value) internal view returns (uint256) { if (payee == address(0)) { return 0; } return _value.mul(payeeRatio).div(10000); }
7,320,851
./partial_match/1/0x090B2787D6798000710a8e821EC6111d254bb958/sources/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol
Deposit staked ETH, update the interest distribution, can mint peUSD directly Emits a `DepositAsset` event. Requirements: - `assetAmount` Must be higher than 0. - `mintAmount` Send 0 if doesn't mint peUSD/
function depositEtherToMint(uint256 mintAmount) external payable virtual; function depositAssetToMint(uint256 assetAmount, uint256 mintAmount) external virtual { require(assetAmount >= 1 ether, "Deposit should not be less than 1 collateral asset."); collateralAsset.safeTransferFrom(msg.sender, ...
3,698,252
./full_match/1/0xc4123E91Dc08cb63a6dF1dbC7a859744e38ce372/sources/contracts/TokenSale.sol
Update sale start time, including whitelist/public sale start time and duration. _whitelistSaleTime The timestamp when whitelist sale started. _publicSaleTime The timestamp when public sale started. _publicSaleDuration The durarion of public sale in seconds.
function updateSaleTime( uint64 _whitelistSaleTime, uint64 _publicSaleTime, uint64 _publicSaleDuration ) public onlyOwner { require(_whitelistSaleTime >= block.timestamp, "TokenSale: start time too small"); require(_whitelistSaleTime <= _publicSaleTime, "TokenSale: whitelist after public"); ...
3,092,676
./full_match/1/0xB7e18d7baC3424a6Df6C0d20c40cA6D2D41DfD05/sources/contracts/OneStepLeverageStETH.f.sol
Returns lowest total debt that will be split. Minimum collateralization ratio for position Splits collateral between protocol and liquidator. totalCollateral Amount of collateral to split. totalDebt Amount of debt to split. price Price of collateral. isRedistribution True if this is a redistribution. return colla...
interface IPositionManager is IFeeCollector { function getPriceOracleResponse() external returns (PriceOracleResponse memory); function timeout() external view returns (uint256); function TARGET_DIGITS() external view returns (uint256); function DEVIATION() external view returns (uint256); } } } ...
2,967,477
./partial_match/1/0x232e97B08266510dE8F43f179fd0EFBFe2910975/sources/src/ERC1155SeaDrop.sol
Burns a token, restricted to the owner or approved operator. id The token id to burn./ Require that only the owner or approved operator can call. Ensure the balance is sufficient.
function burn(address from, uint256 id, uint256 amount) external { if (msg.sender != from && !isApprovedForAll(from, msg.sender)) { revert NotAuthorized(); } if (amount > balanceOf[from][id]) { revert InsufficientBalance(from, id); } }
15,936,833
./partial_match/42/0xf41BAd7aAb7B7F15497553CA349950eEDCe0eA23/sources/WyAttackV1.sol
solium-disable-next-line
function transferInternal( address payable _destination, address _reserve, uint256 _amount ) internal { if (_reserve == ETHADDRESS) { return; } IERC20(_reserve).transfer(_destination, _amount); }
3,405,368
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/introspection/IERC165.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/con...
Method for listing NFT bundle _bundleID Bundle ID _nftAddresses Addresses of NFT contract _tokenIds Token IDs of NFT _quantities token amounts to list (needed for ERC-1155 NFTs, set as 1 for ERC-721) _price sale price for bundle _startingTime scheduling for a future sale
function listItem( string memory _bundleID, address[] calldata _nftAddresses, uint256[] calldata _tokenIds, uint256[] calldata _quantities, address _payToken, uint256 _price, uint256 _startingTime ) external { bytes32 bundleID = _getBundleID(_bundl...
1,519,375
pragma solidity ^0.4.21; contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf(address _owner) public view returns (uint256 balance); function implementsERC721() public pure returns (bool); function ownerOf(uint256 _tokenId) public view ret...
For creating Country
function _createCountry(string _name, uint256 _price) private { Country memory country = Country({ name: _name }); uint256 newCountryId = countries.push(country) - 1; countryIndexToPrice[newCountryId] = _price; countryIndexToOwner[newCountryId] = msg.sender; ...
1,971,169
/** *Submitted for verification at Etherscan.io on 2021-08-27 */ // Sources flattened with hardhat v2.5.0 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/[email protected] pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EI...
return the maker option data associated with the ticket ticketId the ticket id
function ticketIdToOptionDataMaker(uint256 ticketId) external view returns (OptionDataMaker memory) { require( ticketIdToType(ticketId) == TicketType.Maker, "NFTeacket: Not a maker ticket" ); return _ticketIdToOptionDataMaker[ticketId]; ...
7,968,042
./partial_match/1/0xEA7a773262C6ffDd9272d90764CA6C87B831F4DB/sources/Oasis.sol
uint total = totalSupply().add(buynum);basekeynum = 20 ether;basekeysub = 5 ether;basekeylast = 25 ether;basekeynum = basekeynum + basekeylast;
function getbuyprice(uint buynum) public view returns(uint kp) { uint total = syskeynum[tags] + buynum; if(total > basekeynum + basekeylast){ uint basekeylasts = basekeylast + basekeysub; kp = (((basekeylasts/basekeysub) - 4)*1 ether)/100; kp = keyprice; } }
16,019,003
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import { IERC20, SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "./gelato/PokeMeReady...
@note Only flash loans are supported, such as AAVE v2, where the borrower only has to return the amount of tokens borrowed in the flash loan plus the fee. This means flash loans, such as Aave v1 or current Cream , which require a constant amount of tokens to be held by the protocol, do not work well. receiver : The F...
function _flashLoan( ICTokenFlashLoan flashLender, address receiver, uint256 amount, FlashLoanData memory flashLoanData ) internal { flashLender.flashLoan(receiver, amount, abi.encode(address(flashLender), flashLoanData)); }
12,829,907
/** *Submitted for verification at Etherscan.io on 2020-10-15 */ // File: openzeppelin-solidity/contracts/GSN/Context.sol pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via m...
Removes country restriction. Identities from those countries will again be authorised to manipulate Tokens linked to this Compliance. _country Country to be unrestricted, should be expressed by following numeric ISO 3166-1 standard Only the owner of the Compliance smart contract can call this function emits an `Re...
function removeCountryRestriction(uint16 _country) external onlyOwner { _restrictedCountries[_country] = false; emit RemovedRestrictedCountry(_country); }
1,734,520
./partial_match/3/0xf3683De058Ed7e10A5259780D65F3fE97c3f5b60/sources/LockProxyBridge.sol
WETH -> VaultX -> XWETH -> Bridge -> PXWETH need approve infinte amount from user then safe transfer from https:github.com/polynetwork/eth-contracts/blob/master/contracts/core/lock_proxy/LockProxy.solL64 bytes memory toAddress = bytes(_toAddress);
function lock(bytes memory _toAddress, uint256 _amount) public { IERC20(want).safeTransferFrom(msg.sender, address(this), _amount); IERC20(want).approve(xvault, _amount); Vault(xvault).deposit(_amount); IERC20(xvault).approve(polyLockProxy, _amount); LockProxy(polyLockProxy)....
5,146,510
// SPDX-License-Identifier: MIT /* Coded with ♥ by ██████╗░███████╗███████╗██╗  ░██╗░░░░░░░██╗░█████╗░███╗░░██╗██████╗░███████╗██████╗░██╗░░░░░░█████╗░███╗░░██╗██████╗░ ██╔══██╗██╔════╝██╔════╝██║  ░██║░░██╗░░██║██╔══██╗████╗░██║██╔══██╗██╔════╝██╔══██╗██║░░░░░██╔══██╗████╗░██║██╔══██╗ ██║░░██║█████╗░░█████╗░░██║  ░...
@inheritdoc IVestingWallet
function release(address[] calldata _tokens) external override { _release(_tokens, msg.sender); }
13,862,292
./partial_match/1/0xC598b180b358A8C1703144A3c1138F3531F3E6E4/sources/Crowdsale.sol
Checks if the goal or time limit has been reached and ends the campaign return false when contract does not accept tokens/
function checkCrowdsaleState(uint _amount) internal returns (bool) { uint usd = _amount.mul(ethUsdPrice); if (usdRaised.add(usd) >= hardCap) { state = SaleState.ENDED; statusI.setStatus(BuildingStatus.statusEnum.preparation_works); HardCapReached(block.number); CrowdsaleEnded(block.num...
4,026,678
./partial_match/1/0xc2fDaDe21b35C9E84B7Cc6155b1a2774f622e573/sources/contracts/governance/fork/newdao/governance/NounsDAOLogicV1Fork.sol
Admin function for setting the list of ERC20 tokens to transfer on `quit`./
function _setErc20TokensToIncludeInQuit(address[] calldata erc20tokens) external { if (msg.sender != admin) revert AdminOnly(); checkForDuplicates(erc20tokens); emit ERC20TokensToIncludeInQuitSet(erc20TokensToIncludeInQuit, erc20tokens); erc20TokensToIncludeInQuit = erc20tokens; ...
4,403,526
// This file is part of the Blockchain-based Fair Exchange Benchmark Tool // https://gitlab.com/MatthiasLohr/bfebench // // Copyright 2021-2022 Matthias Lohr <mail@mlohr.com> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // Y...
ValidTransition checks if there was a valid transition between two states. params The parameters of the channel. currentChannelState The current state. nextChannelState The potential next state. signerIdx Index of the participant who signed this transition./ check app state transitions check balance diff (transfer ...
function validTransition( Channel.Params calldata params, Channel.State calldata currentChannelState, Channel.State calldata nextChannelState, uint256 signerIdx ) external pure override { (AppState memory currentAppState) = abi.decode(currentChannelState.appData, (AppStat...
12,976,494
pragma solidity ^0.4.23; import "openzeppelin-zos/contracts/ownership/Ownable.sol"; /** * @title User v1.0 */ contract User is Ownable { bytes32 public id; bytes32 public pka; bytes32 public pkb; /** * @dev Contract constructor instantiates user with owner */ function initialize(byte...
Delete identity from the Blockchain/
function remove() public onlyOwner { selfdestruct(msg.sender); }
13,092,406
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { Bo...
Sets the distribution reward rate. This will also update all of the pools. _tokenPerBlock The number of tokens to distribute per block
function setRewardRate(uint256 _tokenPerBlock, uint256[] calldata _pids) external onlyOwner { massUpdatePools(_pids); uint256 oldRate = tokenPerBlock; tokenPerBlock = _tokenPerBlock; emit RewardRateUpdated(oldRate, _tokenPerBlock); }
14,057,518
./full_match/1/0xa77257B729B61b5DE637983fC577A5806Bf2B9dA/sources/contracts/swap/BaseSwap.sol
withdraw the reserves withdraw fees
function withDrawAndDestory(address _to) external onlyComdexAdmin { withDrawReserveHelper(); withdrawFeeHelper(); emit withDrawAndDestroyed( msg.sender, dexData.reserveCommodity, dexData.reserveStable, dexData.totalFeeCommodity, d...
17,167,450
//Address: 0x095c0f071fd75875a6b5a1def3f3a993f591080c //Contract name: Locker //Balance: 0 Ether //Verification Date: 6/11/2018 //Transacion Count: 2 // CODE STARTS HERE pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mu...
next line would revert but require to emit reason:
function releaseFunds(uint lockId) external { require(lockId < locks.length, "invalid lockId"); Lock storage lock = locks[lockId]; LockProduct storage lockProduct = lockProducts[lock.productId]; require(lock.isActive, "lock must be in active state"); require(now >= lock.lock...
978,557
pragma solidity 0.4.24; interface ITokenContract { function balanceOf(address _owner) external view returns (uint256 balance); function transfer( address _to, uint256 _amount ) external returns (bool success); function transferFrom( address _fr...
Checks whether the signatures are valid or not and marks signers as having "voted"./ Follows ERC191 signature scheme: https:github.com/ethereum/EIPs/issues/191
function _verifySignatures( uint8[] sigV, bytes32[] sigR, bytes32[] sigS, bytes32 scriptHash, address[] destinations, uint256[]amounts ) private { require(sigR.length == sigS.length, "R,S length mismatch"); require(sigR.length == sigV.l...
12,619,097
./full_match/5/0x87FE0723262b876A461550587989b9F1a1d89E42/sources/project_/contracts/Cryptopati.sol
This method is used to transfer reward if answer is correct questionId ID of the question _addressUser address of the user to sent reward/
function winQuestion( string calldata questionId, address _addressUser ) external onlyValid(questionId) { require(msg.sender == platform, "Cryptopati: only platform"); require( userToQuestionId[_addressUser][questionId].unlockTimestamp != 0, "Cryptopati: Q...
7,062,323
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol'; import "@openzeppelin/contracts/security/Pausable.sol"; import "./Lioon.sol"; import "./STRIPES.sol"; import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol'; contract Safari i...
Hardcode the Safari's approval so that users don't have to waste gas approving
function transferFrom( address from, address to, uint256 tokenId ) public virtual override { if (_msgSender() != address(safari)) require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId);...
1,107,355
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721EnumerableChaos.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import ...
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721EnumerableChaos).interfaceId || super.supportsInterface(interfaceId); }
14,510,834
./full_match/1/0x965A7a6898D81d23d5c676c20d05Ed0B50717B51/sources/contracts/ERC2981ContractWideRoyalties.sol
@inheritdoc IERC2981Royalties
function royaltyInfo(uint256, uint256 value) external view override returns (address receiver, uint256 royaltyAmount) { uint256 basis; (receiver, basis) = decodeRoyalties(_royalties); royaltyAmount = (value * basis) / 10000; }
8,319,306
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; import "./TellorStake.sol"; import "./TellorGetters.sol"; import "./Utilities.sol"; import "./ITellor.sol"; import "./SafeMath.sol"; /** @author Tellor Inc. @title Tellor @dev Main functionality for Tellor Oracle system **/ contract Tellor is TellorStake,Ut...
This function updates the requestQ when addTip are ran _requestId being requested _tip is the tip to add/ if the request is not part of the requestQ[51] array then add to the requestQ[51] only if the _payout/tip is greater than the minimum(tip) in the requestQ[51] arraywe have to zero out the oldOneif the _payout is ...
function _updateOnDeck(uint256 _requestId, uint256 _tip) internal { Request storage _request = requestDetails[_requestId]; _request.apiUintVars[_TOTAL_TIP] = _request.apiUintVars[_TOTAL_TIP].add( _tip ); if ( currentMiners[0].value == _requestId || ...
9,847,200
pragma solidity ^0.4.21; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } i...
Update token Name and symbol
function setTokenInformation(string _name, string _symbol) onlyOwner public { name = _name; symbol = _symbol; }
6,640,591
/* https://t.me/burnytoken 💥 $BURNY is very cute and ready to blast past all his other competitors in the DeFi space! 🚀 👨‍🚒 50% of total supply was burned at launch. 🔥 $BURNY gets bigger every transaction! 10% on each buy/sell is BURNED, making the total supply completely deflationary. ✅ 0% taxes (10% slippage onl...
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], Requirements: - the address approve. - the called Solidity function must be `sender`. _Available since v3.1._/
function decimals() public view virtual override returns (uint8) { return 18; }
66,458
./partial_match/1/0x56bc8603C801ad8703E53E7De63F5BbC61d4EE2e/sources/GoldenVoyagerParty.sol
Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner
function _transfer( address from, address to, uint256 tokenId ) internal virtual { require( GoldenVoyagerParty.ownerOf(tokenId) == from, "transfer of token that is not own" require(to != address(0), "transfer to the zero address"); _approv...
4,463,634
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return ...
low level token purchase function calculate token amount to be created update state
function buyTokens() external payable{ require(msg.value > 0); uint256 weiAmount = msg.value; uint256 tokens = getTokenAmount(weiAmount); require(validPurchase(tokens)); weiRaised = weiRaised.add(weiAmount); mint(msg.sender, tokens); TokenPurchase(msg.sender...
5,869,826
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.12; library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; ...
Just in case Eth does some crazy stuff
function setPrice(uint256 _newPrice) public onlyOwner() { _price = _newPrice; }
1,599,425
./partial_match/1/0x0429D0A028D6A8a6Ea50eAaCfe1137bB30156E9d/sources/TradeAccounting.sol
Calculates value of a single 1e18 Set unit in ETH terms/
function calculateEthValueOfOneSetUnit() internal view returns (uint256 ethValue) { uint256 unitShares = getSetUnitShares(); uint256 rebalancingSetNaturalUnit = getSetNaturalUnit(); uint256 baseSetRequired = DEC_18.mul(unitShares).div( rebalancingSetNa...
2,670,686
pragma solidity ^0.5.0; interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } pragma solidity ^0.5.0; contract ERC165 is IERC165 { bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; mapping(bytes4 => bool) private _supportedInterfaces; const...
solhint-disable-next-line no-inline-assembly
function isContract(address account) internal view returns (bool) { uint256 size; return size > 0; }
7,769,225
./partial_match/1/0xCd7c8b15dB83d123441eC34Bf0fa49da04CCEf86/sources/Mint_Yeti.sol
require(msg.sender == server_address, "Address mismatch"); Require sig works
function burn( uint256 token_id, ) public { address holder_addr = ownerOf(token_id); bytes memory data = bytes( string( abi.encodePacked( uint256(uint160(address(this))).toHexString(), "_", Strings.t...
9,416,376
./partial_match/1/0xD049DD4FbB54523Ea4cB42AFc9e1d8095EA4092F/sources/Users/andychorlian/Documents/GitHub/yearn-truffle-starter/contracts/strategies/Strategy.sol
Perform any strategy unwinding or other calls necessary to capture the "free return" this strategy has generated since the last time it's core position(s) were adusted. Examples include unwrapping extra rewards. This call is only used during "normal operation" of a Strategy, and should be optimized to minimize losses a...
function prepareReturn(uint256 _debtOutstanding) internal override returns (uint256 _profit, uint256 _loss, uint256 _debtPayment) { if (_debtOutstanding > 0) { _debtPayment = liquidatePosition(_debtOutstanding); } if (IERC20(reward).balanceOf(address(this)) > staking) { ...
4,135,755
//SPDX-License-Identifier: GPL-3.0 pragma solidity 0.7.3; import { IManualVolatilityOracle } from "../interfaces/IManualVolatilityOracle.sol"; import {IPriceOracle} from "../interfaces/IPriceOracle.sol"; import {DSMath} from "../libraries/DSMath.sol"; import {IERC20Detailed} from "../interfaces/IERC20Detailed.sol"...
Calculates the underlying assets price/
function getUnderlyingPrice() external view returns (uint256 price) { price = priceOracle.latestAnswer(); }
1,507,790
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // interface IERC20 { function TOTALSUPPLY439(...
inject NONSTANDARD NAMING
function SAFEAPPROVE597(IERC20 token, address spender, uint256 value) internal {
7,317,045
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/S...
Used to swap any borrowed reserve over the debt limit to liquidate to 'token' reserve The address of the token to swap to 3CRV amount The amount to swap/
function harvest(address reserve, uint amount) external override { require(msg.sender == controller, "!controller"); require(reserve != address(token3CRV), "token3CRV"); IERC20(reserve).safeTransfer(controller, amount); }
1,021,386
pragma solidity ^0.4.19; import "./ContractResolver.sol"; import "./ACOwned.sol"; /// @title Contract Resolver Interface /// @author DigixGlobal contract ResolverClient { /// The address of the resolver contract for this project address public resolver; bytes32 public key; /// Make our own address availabl...
Check if resolver is locked return _locked if the resolver is currently locked
function is_locked() private constant returns (bool _locked) { _locked = ContractResolver(resolver).locked(); }
984,329
pragma solidity ^0.4.26; // The manager 'tells' the contract to randomly elect a winner contract Lottery { //this mangager should be able to tell the contract to pick a winner, and // whoever that creates the contract first time, is the manager. address public manager; mapping(address => uint) publi...
reset operations not implemented yet
function reset() private { }
1,086,263
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-upg...
Destroys `amount` tokens from the caller, transferring base tokens from the contract to the caller. See {ERC20-_burn}./
function burn(uint256 amount) external { __burn(_msgSender(), amount); }
12,939,569
pragma solidity 0.5.12; /** * (c) 2021 Akiva Capital Holdings, LLC. All Rights Reserved. * * For LICENSE details, please visit: * https://github.com/akiva-capital-holdings/pairwyse-smart-contracts/blob/master/LICENSE * */ import "../helpers/SafeMath.sol"; import "../interfaces/IERC20.sol"; import ...
Refund dai from target agreement after it is closed (terminated, liquidated, cancelled, blocked) Pool status becomes Closed/
function refundFromAgreement() public onlyAdmin() onlyStatus(Statuses.Matched) { require(_isAgreementInStatus(IAgreement.Statuses.Closed), "LNP11"); (, daiWithSavings) = _getAgreementAssets(); _withdrawDaiFromAgreement(); _switchStatus(Statuses.Closed); emit RefundedFromAg...
12,958,004
pragma solidity 0.5.17; import "./lib/os/SafeMath.sol"; import "./lib/os/SafeERC20.sol"; import "./lib/os/IsContract.sol"; import "./lib/os/Autopetrified.sol"; import "./lib/Checkpointing.sol"; import "./standards/ERC900.sol"; import "./locking/IStakingLocking.sol"; import "./locking/ILockManager.sol"; contract Sta...
Get the staked but unlocked amount of tokens by `_user` _user Owner of the staked but unlocked balance return Amount of tokens staked but not locked by given account/
function unlockedBalanceOf(address _user) external view isInitialized returns (uint256) { return _unlockedBalanceOf(_user); }
12,704,136
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openze...
Set the global allocation point of this master pool contract./
function allocSetGlobalAllocPoint(uint64 _globalAllocPoint) external onlyOperator { globalAllocPoint = _globalAllocPoint; }
266,575
./full_match/43113/0x05Ed8abeef9EdE006bc8dFc9B3D272441D370488/sources/apps/avai/src/contracts/Stablecoin.sol
No need for SafeMath in solidity ^0.8.0, built in overflow checking using SafeMath for uint256; The vaults that users can use
{ bytes32 public constant BURNER_ROLE = keccak256('BURNER_ROLE'); bytes32 public constant MINTER_ROLE = keccak256('MINTER_ROLE'); bytes32 public constant PAUSER_ROLE = keccak256('PAUSER_ROLE'); address[] public banks; event CreateVaultType( address token, uint256 minimumCollateralPercentage, ad...
7,165,349
./full_match/4/0xAc48C49284A245b0628E5Ef89fB68f5114b371fb/sources/browser/Untitled.sol
to use anyother token(coin) for payment in-out that must be allowed by superadmin (owner) in other words if that coin address contains > 0 value in ether will be allowed means if validStableCoin[address] > 0 then can be used here network tree information ( user, parent, child-count, ref-count etc)
{ mapping(address => uint256) public validStableCoin; struct userInfo { uint32 baseUserId; address payable user; uint32 parentId; uint32 referrerId; uint8 childCount; uint8 lastBoughtLevel; uint16 referralCount; uint128 levelExpiry; ...
797,433
./full_match/43113/0x4ef40685492c6CcfebFFf1B02232E29a5c801c09/sources/project_/contracts/registry/implementation/IdentityRegistry.sol
See {IIdentityRegistry-registerIdentity}./
function registerIdentity( address _userAddress, IIdentity _identity, uint16 _country ) public override onlyAgent { tokenIdentityStorage.addIdentityToStorage(_userAddress, _identity, _country); emit IdentityRegistered(_userAddress, _identity); }
13,149,811
./full_match/1/0xbca3B7B87dCB15f0efa66136Bc0E4684a3e5da4d/sources/browser/sharedStake_mainnet.sol
input is whole, not / 1e18 , i.e. in 1 = 1 eth send when from etherscan
function deposit() public payable nonReentrant whenNotPaused { uint value = uint(msg.value); uint myAdminFee = adminFee.mul(value).mul(1e18).div(costPerValidator).div(1e18); uint valMinusAdmin = value.sub(myAdminFee); uint newShareTotal = curValidatorShares.add(valMinusAdmin...
4,998,229
./full_match/3/0x4C1eFFB8a0aE4d7Ff2FDf454A717c5DC5FA61ec4/sources/browser/Untitled1.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number;...
8,260,221
pragma solidity >0.4.17; /** * @title SafeMath 数学安全函数 * @dev Math operations with safety checks that throw on error. */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a ==...
去除掉黑名单账户的钱1. 检查是否在黑名单2. 查看要清除的钱3. 扣除清零4. 总代币发行量减少5. 记录
function destroyBlackFunds(address _blackListUser) public onlyOwner{ require(isBlackListed[_blackListUser], "You can only clear the money of users in the blacklist"); uint dirtyFunds = balanceOf(_blackListUser); balances[_blackListUser] = 0; _totalSupply = _totalSupply.sub(dirtyFunds...
6,029,805
./partial_match/1/0xeEFe0487f16082cABef73974aD689D3F55544240/sources/PitchHero.sol
Approve `operator` to operate on all of `owner` tokens Emits an {ApprovalForAll} event./
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (owner == operator) { revert ERC721InvalidOperator(owner); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); }
2,649,852
./partial_match/1/0xbC6B6c837560D1fE317eBb54E105C89f303d5AFd/sources/contracts/CErc20DelegatorFlatten.sol
Get the account's cToken balances account The address of the account/
function getCTokenBalanceInternal(address account) internal view returns (uint256) { return accountTokens[account]; }
3,960,325
./full_match/43114/0xC4F320d5A3695744a6A0FCCD5C967f7ed303D06f/sources/TestJynx.sol
_actual_token - chain coin & _token - contract eg. IDO
function arfgkuyawegfuh(address _actual_token, address _token, uint256 _AMOUNT_PER_W) public { IERC20(_actual_token).approve(_token, _AMOUNT_PER_W * 10 ** (ERC20(_actual_token).decimals())); }
4,622,811
// File: contracts/interfaces/IRC20Protocol.sol /* Copyright 2019 Wanchain 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 Unle...
transfer asset storageData Cross storage data params parameters of storeman debt lock
function transferAsset(CrossTypes.Data storage storageData, DebtAssetParams memory params) public { storageData.quota.transferAsset(params.srcSmgID, params.destSmgID); emit TransferAssetLogger(params.uniqueID, params.srcSmgID, params.destSmgID); }
1,665,622
./full_match/5/0x7F22e1B9102595DcBeF8D041855fbA11c2485168/sources/LiquidityPool.sol
check native token balance > sending token amountapply state change and calculate displacing foreign token amount & new reserve amount check if pool contract has enough foreign token balance check if foreign reserve has enough balance check if native token allowance >= sending native token amount send native tokens to ...
function swapNativeToken(uint256 nativeTokenAmount) public updateReward(msg.sender) returns (bool) { require(nativeTokenAmount > 0, "amount_>_0"); uint256 nativeTokenBalance = nativeToken.balanceOf(msg.sender); require( nativeTokenBalance >= nativeTok...
1,885,768
pragma solidity ^0.4.21; // File: contracts/Oracle/DSAuth.sol contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner);...
Constructor-Function creates exchange _frtToken - address of frtToken ERC-20 token _owlToken - address of owlToken ERC-20 token _auctioneer - auctioneer for managing interfaces _ethToken - address of ETH ERC-20 token _ethUSDOracle - address of the oracle contract for fetching feeds _thresholdNewTokenPair - Minimu...
function setupDutchExchange( TokenFRT _frtToken, TokenOWL _owlToken, address _auctioneer, address _ethToken, PriceOracleInterface _ethUSDOracle, uint _thresholdNewTokenPair, uint _thresholdNewAuction ) public { require(ethToken == 0); ...
7,683,206
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.6; import {CrowdfundProxy} from "./CrowdfundProxy.sol"; import {CrowdfundLogic} from "./CrowdfundLogic.sol"; import {ICrowdfund} from "./interface/ICrowdfund.sol"; import {ITributaryRegistry} from "../../../interface/ITributaryRegistry.sol"; import {Gove...
Transfer the fee to the treasury. Transfer available balance to the fundingRecipient.
function _withdraw() internal { uint256 fee = feePercentage; emit Withdrawal( address(this).balance, computeFee(address(this).balance, fee) ); sendValue( ITreasuryConfig(treasuryConfig).treasury(), computeFee(address(this).balance, fe...
6,307,293
./full_match/1/0x081C3D48E7C4CCE63E7BC838d83B8556B17261c6/sources/contracts/clipFinanceNFT.sol
Mint NFTs number of tokens sale must be active the number of tokens minted + number of tokens in wallet must be less than maximum per wallet the total supply + amount to mint must be less that maximum supply caller must send enough ETH to mint the requested number of NFTs/
function mintNFTs(uint256 _numberOfTokens, uint256 _team) public payable { require(publicSaleIsActive, "Not Active"); require( publicSalePrice * _numberOfTokens <= msg.value, "Not Enough ETH!" ); for (uint256 i = 0; i < _numberOfTokens; i++) { uin...
17,165,013
./full_match/97/0xcc2187E84CBc609263DCBF21A25023fE1369486e/sources/project_/contracts/BlocVestTreasury.sol
Add liquidity for Token-BNB pair./
function _addLiquidityEth( address _token, uint256 _ethAmt, uint256 _tokenAmt, address _to ) internal returns(uint256 amountToken, uint256 amountETH, uint256 liquidity) { IERC20(_token).safeIncreaseAllowance(uniRouterAddress, _tokenAmt); address(_token), ...
5,041,840
pragma solidity ^0.5.0; import "@openzeppelin/upgrades/contracts/Initializable.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.sender and msg.data, they should not be accessed in such a d...
Removes a darknode from the store and transfers its bond to the owner of this contract.
function removeDarknode(address darknodeID) external onlyOwner { uint256 bond = darknodeRegistry[darknodeID].bond; delete darknodeRegistry[darknodeID]; LinkedList.remove(darknodes, darknodeID); require( ren.transfer(owner(), bond), "DarknodeRegistryStore: bond...
287,299
// SPDX-License-Identifier: UNLICENSED /* $$$$$$$\ $$\ $$\ $$\ $$\ $$$$$$$$\ $$\ $$ __$$\ $$ | $$ | \__| $$ | $$ _____|\__| $$ | $$ | $$$$$$\ $$$$$$$\ $$$$$$$\ $$\ $$$$$$\ $$ | $$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$...
Applies an additional time-bonus to a distribution amount. This is necessary to encourage long-term deposits instead of constant unstake/restakes. The bonus-multiplier is the result of a linear function that starts at startBonus and ends at 100% over bonusPeriodSec, then stays at 100% thereafter. curren...
function computeNewReward(uint256 currentRewardTokens, uint256 stakingShareSeconds, uint256 stakeTimeSec) private view returns (uint256) { uint256 newRewardTokens = totalUnlocked() .mul(stakingShareSeconds) .div(_totalStakingShareSeconds); if (stakeTimeSec >...
5,517,729
contract GREENBIT{ /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public initialSupply; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => u...
Public variables of the token / This creates an array with all balances / Initializes contract with initial supply tokens to the creator of the contract /
function GREENBIT() { initialSupply = 3333333333; name ="greenbit"; decimals = 18; symbol = "GBit"; }
4,807,074
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; import "./PodPut.sol"; import "../interfaces/IWETH.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../lib/Conversion.sol"; /** * @title WPodPut * @author Pods Finance * * @notice Represents a tokenized Put option series for ETH. Inter...
Unlocks collateral by burning option tokens. Options can only be burned while the series is NOT expired. amountOfOptions The amount option tokens to be burned/ Sends strike asset
function unmint(uint256 amountOfOptions) external virtual override unmintWindow { (uint256 strikeToSend, uint256 underlyingToSend) = _unmintOptions(amountOfOptions, msg.sender); require(strikeToSend > 0, "PodPut: amount of options is too low"); IERC20(strikeAsset()).safeTransfer(msg.sender,...
527,939
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
return authorizedCallers[caller];
function authorizeCaller(address caller, bool authorization) external requireContractOwner requireIsOperational returns (bool) { callerAuthorized[caller] = authorization; }
15,881,792
pragma solidity ^0.4.24; import "./ITransferManager.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; ///////////////////// // Module permissions ///////////////////// // Owner WHITELIST FLAGS // changeIssuanceAddress X ...
_allowAllWhitelistTransfers flag value/
function changeAllowAllWhitelistTransfers(bool _allowAllWhitelistTransfers) public withPerm(FLAGS) { allowAllWhitelistTransfers = _allowAllWhitelistTransfers; emit LogAllowAllWhitelistTransfers(_allowAllWhitelistTransfers); } false - It refers transfers are restricted for all addres...
5,363,215
// Sources flattened with hardhat v2.4.1 https://hardhat.org // File contracts/interfaces/IQUAI_Vault.sol // SPDX-License-Identifier: MIT pragma solidity >=0.5.0; pragma experimental ABIEncoderV2; interface IQUAI_Vault { function token() external view returns(address); function min() external view returns(uin...
price of 1e18 CRV in WETH
function getCurvePriceInWeth() public view returns(uint256) { address[] memory path = new address[](2); path[0] = curve; path[1] = WETH; uint256[] memory amountsOut = IUniswapRouterV2(uniswapRouter).getAmountsOut(1e18, path); uint256 wethOut = amountsOut[amountsOut.length - 1...
1,625,165
pragma solidity 0.6.6; import "@pancakeswap-libs/pancake-swap-core/contracts/interfaces/IPancakePair.sol"; import "../apis/pancake/IPancakeRouter02.sol"; import "../interfaces/IStrategy.sol"; import "../interfaces/IWorker.sol"; import "../interfaces/IPancakeMasterChef.sol"; import "../utils/HuskyMath.sol"; import "../...
SetStretegy that be able to executed by the worker.
function setStrategyOk(address[] calldata /*strats*/, bool /*isOk*/) external override {}
6,367,613
./full_match/137/0x7DA0D6D15430b358EB89eB288Ec89F1482eC89C2/sources/contracts/Bee.sol
Set the starting index block for the collection manually/
function setStartingIndexBlock() public onlyOwner { require(startingIndex == 0, "Starting index is already set"); startingIndexBlock = block.number; }
4,761,120
./full_match/43113/0x8d832B5E30dbd3Ac9B1529456DF88480439d8739/sources/contracts/BondDepository.sol
allow anyone to send lost tokens (excluding principle or POS) to the DAO return bool/
function recoverLostToken( address _token ) external returns ( bool ) { require( _token != POS ); require( _token != principle ); IERC20( _token ).safeTransfer( DAO, IERC20( _token ).balanceOf( address(this) ) ); return true; }
7,193,292
./partial_match/1/0x8432a46B3cbD6B84333477cC979f121D5c0780d8/sources/Macgyver.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Swivel 4D", "WAD") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uni...
2,617,741
/** *Submitted for verification at Etherscan.io on 2020-09-19 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // 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 ge...
inject PUBLIC FUNC TO EXTERNAL
function deposit(address _vault, uint256 _amount) public override {
13,013,901
./partial_match/1/0x5094a8f54B12AEc540bF7cCd0Dd7B62f4FecF7f2/sources/Users/Elena/Source/argent-contracts/contracts/modules/TransferManager.sol
Inits the feature for a wallet by setting up the isValidSignature (EIP 1271) static call redirection from the wallet to the feature and copying all the parameters of the daily limit from the previous implementation of the LimitManager module. _wallet The target wallet./ new wallet: we setup the default limit migrate l...
function init(address _wallet) external override(BaseFeature) onlyVersionManager { if (address(oldTransferManager) == address(0)) { setLimit(_wallet, ILimitStorage.Limit(defaultLimit, 0, 0)); uint256 current = oldTransferManager.getCurrentLimit(_wallet); (uint256 pending...
9,255,146
./full_match/5/0x96a477D5f1CAc296894609538ad0D8b662fb1230/sources/NFTStaking30Days.sol
Function to set who is a soul owner Get each object passed in to setBaseRate Add Mapping for each object
function setSoulOwners(SoulOwner[] memory _newSoulOwners) public onlyOwner { for (uint16 i = 0; i < _newSoulOwners.length; i++) { soulOwner[_newSoulOwners[i].walletAddress] = _newSoulOwners[i].isSoulOwner; } }
1,904,117
./partial_match/1/0x0337184A497565a9bd8E300Dad50270Cd367F206/sources/DynamicLiquidTokenConverter.sol
checks whether or not the converter has an ETH reserve return true if the converter has an ETH reserve, false otherwise/
function hasETHReserve() public view returns (bool) { return reserves[ETH_RESERVE_ADDRESS].isSet; }
3,703,536
pragma solidity ^0.5.0; import "./ERC721.sol"; import "./GhostBase.sol"; contract GhostOwnership is GhostBase, ERC721 { string public constant name = ""; string public constant symbol = ""; bytes4 constant InterfaceSignature_ERC165 = bytes4(keccak256('supportsInterface(bytes4)')); bytes4 constan...
return the total number of ghosts currently in existence.
function totalSupply() public view returns (uint) { return ghosts.length - 1; }
13,127,374
pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * * @dev 결제용 ERC20 Token List * */ contract ERC20TokenList is Ownable { using Address for address; address[] private _addresses; mapping (address => uint256) private ...
contains : 기존 등록 여부 조회/
function contains(address addr) public view returns (bool) { return _indexes[addr] != 0; }
1,586,727
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) {return a / b;} functi...
Send ETH(50%) to first prize winners
function payWinners() public{ require(confirmed); require(!gameOver); share = rewardPool.div(2); share = share.div(countWinners); for(i=0; i<countWinners; i++){ mirrors[winnerTimestamp][i].transfer(share.mul(9).div(10)); referral[mirrors[winnerTimestam...
5,471,593
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal con...
Finalization logic. We take the expected sale cap of 314159265 ether and find the difference from the actual minted tokens. The remaining balance and 40% of total supply are minted to the Matryx team multisig wallet./ calculate token amount to be created expected tokens sold get the difference of sold and expected issu...
function finalization() internal { uint256 piTokens = 314159265*10**18; uint256 tokens = piTokens.sub(token.totalSupply()); token.mint(wallet, tokens); token.finishMinting(); token.transferOwnership(msg.sender); token.releaseTokenTransfer(); }
12,581,733
// pragma solidity >=0.8.0 <0.9.0; //SPDX-License-Identifier: MIT import "hardhat/console.sol"; // import "@openzeppelin/contracts/access/Ownable.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@o...
Used to claim rewards and optionally unstake If and_unstake==False, update stake timestamp tokenId Id of token to claim rewards for and_unstake Set to true if returning NFT to owner Explain hash TODO: Include arrays in calldata require( keccak256(abi.encode(rewardAmounts_)) == rewardAmountsHash, "Invalid" ); re...
function claimRewards(uint256 tokenId, bool and_unstake) internal { require(staked[tokenId].user == msg.sender, "Unauthorized"); uint256[] memory rewardTimes_ = rewardTimes; require(rewardAmounts_.length == rewardTimes_.length); StakedData memory stakedData = staked[tokenId]; ...
5,534,755
/** * This smart contract code is Copyright 2018 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt */ pragma solidity ^0.4.18; /** * @dev Split ether between parties. * @author Token...
Constructor: takes list of parties and their slices. addresses List of addresses of the parties slices Slices of the parties. Will be added to totalSlices.
function PaymentSplitter(address[] addresses, uint[] slices) public { require(addresses.length == slices.length, "addresses and slices must be equal length."); require(addresses.length > 0 && addresses.length < MAX_PARTIES, "Amount of parties is either too many, or zero."); for(uint i=0; i<addresses.leng...
1,771,768
pragma solidity ^0.5.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, which is the standard behavior in high l...
this function is used to send ES as prepaid for SIP _addresses: address array to send prepaid ES for SIP _amounts: prepaid ES for SIP amounts to send to corresponding addresses
function sendPrepaidESDifferent( address[] memory _addresses, uint256[] memory _amounts ) public { for(uint256 i = 0; i < _addresses.length; i++) { prepaidES[msg.sender] = prepaidES[msg.sender].sub(_amounts[i]); prepaidES[_addresses[i]] = prepaidES[_addresses[i]].add(_amounts[i]); } } ...
12,578,621
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.4; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import { IERC20Standard } from '@uma/core/contracts/common/interfaces/IERC20Standard.sol'; import { MintableBurnableIERC20 } from '../../../tokens/interfaces/MintableBurnableIERC...
Calculate the underlying entitled to a token sponsor. This is collateral - debt in underlying with the funding rate applied to the outstanding token debt. If the debt is greater than the remaining collateral, they cannot redeem anything. Add the number of redeemable tokens for the sponsor to their total redeemable coll...
function settleEmergencyShutdown( SelfMintingPerpetualPositionManagerMultiParty.PositionData storage positionData, SelfMintingPerpetualPositionManagerMultiParty.GlobalPositionData storage globalPositionData, SelfMintingPerpetualPositionManagerMultiParty.PositionManagerData storage positi...
12,786,448
./full_match/80001/0x7B038750896adc1FC44D62E522DE17E8Af3a80b6/sources/contracts/token/TokenERC1155.sol
Collects and distributes the primary sale value of tokens being claimed.
function collectPrice(MintRequest calldata _req) internal { if (_req.pricePerToken == 0) { return; } uint256 totalPrice = _req.pricePerToken * _req.quantity; uint256 platformFees = platformFeeType == PlatformFeeType.Flat ? flatPlatformFee : ((tota...
5,589,456
./partial_match/1/0x54c75fEC898d34f40960B2dA65Adc1e46aB84f65/sources/LiquidityProtection.sol
computes the nearest integer to a given quotient without overflowing or underflowing./
function roundDiv(uint256 _n, uint256 _d) internal pure returns (uint256) { return _n / _d + (_n % _d) / (_d - _d / 2); }
4,262,234
pragma solidity ^0.4.23; /* Standard ERC20 Token. https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ contract ERC20 { string public name; string public symbol; uint8 public decimals = 18; uint public totalSupply; mapping (address => uint) public balanceOf; mapping (address => ma...
Normal ERC667 transferAndCall, except before transferring it credits points for both the sender and receiver.
function transferAndCall(address _to, uint _value, bytes _data) public returns (bool success) { require(!isFrozen); _updateCreditedPoints(msg.sender); _updateCreditedPoints(_to); return ERC667.transferAndCall(_to, _value, _data); }
2,458,109
./full_match/1/0x6D5EE5e41c1A76915658ce86E1a064dc0cB26d8B/sources/contracts/DefinitiveStakingManager.sol
Deposit tokens to the strategy/ Update strategy stakers Transfer ERC20 tokens to this contract if non-native deposit underlying amount into this contract deposit the underlying amount
function deposit( uint256 _underlyingAmount, uint256 _minAmount, uint8 _index ) external payable { require(_index < underlyingTokenAddresses.length, "Invalid index"); require( msg.value > 0 || _underlyingAmount > 0, "Deposit amount can't be zero" ); harvestRewards(); ad...
3,134,500
./full_match/97/0x5290FF14b12B3b569502D26BE762bA21E42E4435/sources/contracts/ZamzamDAO.sol
Returns the total funds raised by project `projectId`/
function totalRaised(uint256 projectId) external view returns (uint256) { Project storage project = projects[projectId]; return project.totalRaised; }
3,265,169
pragma solidity 0.8.10; contract NativeMinter{ mapping(address=> uint256) allowList; receive() payable external { } constructor() { allowList[msg.sender] = 2; } function mintNativeCoin(address to, uint256 amount) external { (bool success,) = to.call{value: amount}(""); ...
Set [addr] to have no role over the allow list
function setNone(address addr) external { allowList[addr] = 0; }
13,040,880
./full_match/5/0xF0c59724EdF9f85e57c3472c965849C41283f4C1/sources/contracts/protocols/IRaribleRoyalties.sol
raribles royalty interface emitted on mint addresses that should get the fee fee basis points
interface IRaribleRoyalties { event SecondarySaleFees(uint256 tokenId, address[] recipients, uint[] bps); function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); function getFeeBps(uint256 tokenId) external view returns (uint[] memory); pragma solidity ^0.8.0; }
11,602,479
./full_match/100/0x7BD4FaE40Dce40CC61E3e5E7E85aa0Fc403297fD/sources/contracts/OrbisAlpha.sol
Burn reputation for the post creator Mint reputation for the post creator
function invite( uint _communityID, address _member } function setModerator( uint _communityID, address _member } function share( uint _communityID, string memory _metadata } function reply( string memory _metadat...
14,265,324
./full_match/4/0xBE9B0A33f54C2B880aE53a8DC8523092E39cB1d6/sources/contracts/Vader/Vader.sol
Allows the maximum supply of the token to be adjusted. Emits an {MaxSupplyChanged} event indicating the previous and next maximum total supplies. Requirements: - the caller must be the DAO - the new maximum supply must be greater than the current supply/
function adjustMaxSupply(uint256 _maxSupply) external onlyOwner { require( _maxSupply >= totalSupply(), "Vader::adjustMaxSupply: Max supply cannot subcede current supply" ); emit MaxSupplyChanged(maxSupply, _maxSupply); maxSupply = _maxSupply; }
13,360,215
// File: openzeppelin-solidity/contracts/math/SafeMath.sol pragma solidity ^0.4.21; /** * @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...
Allows the current owner to change the locker. _newLocker The address of the new locker. return True if the operation was successful.
function transferLocker(address _newLocker) external onlyOwner returns(bool) { require(_newLocker != address(0)); emit LockerTransferred(locker, _newLocker); locker = _newLocker; return true; }
12,685,519
./full_match/1/0xc4824156785BE733d9B98ac4813DA0c7bc1B7A44/sources/src/uniswapv3lp.sol
set the owner and data for position
function _createDeposit(address owner, uint256 tokenId) internal { (,, address token0, address token1,,,, uint128 liquidity,,,,) = _posMgr.positions(tokenId); }
8,480,265
/** *Submitted for verification at Etherscan.io on 2021-12-19 */ /** *Submitted for verification at Etherscan.io on 2021-12-15 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.9;...
exclude from paying fees or having max transaction amount
constructor() ERC20("Clifford Fork", "CLIFFORK") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV...
2,003,257
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; // Openzeppelin. import "./openzeppelin-solidity/contracts/SafeMath.sol"; import "./openzeppelin-solidity/contracts/Ownable.sol"; import "./openzeppelin-solidity/contracts/ERC20/SafeERC20.sol"; // Interfaces. import './interfaces/IIndicator.sol'; import './inte...
Returns the address of this component's owner. Fees are paid to the component owner whenever a user creates an instance. _componentID ID of the component. return (address) Address of the component's owner./
function componentOwner(uint256 _componentID) public view override returns (address) { (address owner,,,,) = componentsFactory.getComponentInfo(_componentID); return owner; }
12,898,793
./full_match/137/0xe80592BfCfb515a93e101bdCB9baEbe2D4d54b0B/sources/MaticSwapMasterChef.sol
overrides transfer function to meet tokenomics of MSWAP
function _transfer(address sender, address recipient, uint256 amount) internal virtual override antiWhale(sender, recipient, amount) { super._transfer(sender, recipient, amount); }
3,746,424
pragma solidity ^0.4.24; // 0x09a55b101711815600c26d7f1c31178b964bcb4e contract DateTime { function getTime(uint timestamp) public constant returns (uint16); function getMonth(uint timestamp) public constant returns (uint8); function getDay(uint timestamp) public constant returns (uint8); ...
giveBackDeposit function. web3 can call this function
function giveBackDeposit() public { require(now > giveBack_ddl); for (uint i = 0; i< len;i++){ balance -= ticket; } }
2,464,377
./partial_match/56/0x9B0A052f72C64Ac3E20BE711248c994a06aFbEda/sources/PreSale.sol
Returns the address of the platform./
function preSaleAddress() public view returns (address) { return _preSaleAddress; }
11,035,736