file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.11; import "./SafeMath.sol"; import "./Halt.sol"; contract StoremanGroupAdmin is Halt { using SafeMath for uint; ///smg storeman group ///coin:smg address:balance uint public constant USE_CONTRACT = 0; uint public constant USE_SCRIPT = 1; uint public constant DEFAULT...
default tranfer to contract
function () public payable { revert(); }
2,550,296
//Address: 0x23b9ed246ebe37dbc3ee6b0c84743de9d7217abc //Contract name: Fund //Balance: 0 Ether //Verification Date: 12/12/2017 //Transacion Count: 0 // CODE STARTS HERE pragma solidity 0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul...
companies integration
function setCompanyManager(address _addr) public restricted { companiesManager = CompaniesManagerInterface(_addr); }
5,466,873
// SPDX-License-Identifier: MIT // 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 re...
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
10,713,302
./partial_match/1/0x1bC5D99b94763D3658d7d26a762BA5Da8ccF0DCc/sources/StrategyCurveBoostedFactoryClonable.sol
Provide a signal to the keeper that harvest() should be called. Don't harvest if a strategy is inactive. If we exceed our max delay, then harvest no matter what. For our min delay, credit threshold, and manual force trigger, only harvest if our gas price is acceptable. callCostinEth The keeper's estimated gas cost...
function harvestTrigger( uint256 callCostinEth ) public view override returns (bool) { if (!isActive()) { return false; } StrategyParams memory params = vault.strategies(address(this)); if (block.timestamp - params.lastReport > maxReportDelay) { r...
15,475,299
// SPDX-License-Identifier: MIT /** Husky Fin Corporation */ pragma solidity 0.6.6; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.s...
Set sources for multiple token pairs token0s Token0 address to set source token1s Token1 address to set source allSources source for the token pair
function setPriceFeeds( address[] calldata token0s, address[] calldata token1s, AggregatorV3Interface[] calldata allSources ) external onlyOwner { require( token0s.length == token1s.length && token0s.length == allSources.length, "ChainLinkPriceOracle::setPriceFeeds: inconsistent length" ...
12,698,473
./full_match/80001/0x93606Db8e1340eBa115633Cc8a031D379D7638C6/sources/contracts/dev/functions/FunctionsBillingRegistry.sol
@inheritdoc FunctionsBillingRegistryInterface/ Input validation using the subscription storage. No lower bound on the requested gas limit. A user could request 0 and they would simply be billed for the gas and computation.
function startBilling(bytes calldata data, RequestBilling calldata billing) external override validateAuthorizedSender nonReentrant whenNotPaused returns (bytes32) { if (s_subscriptionConfigs[billing.subscriptionId].owner == address(0)) { revert InvalidSubscription(); } if ...
5,640,141
./full_match/1/0x2fC246149B4B8d7bcEF6188A10AF1791380227f1/sources/src/BaseWithStorage/wip/ERC1155BaseToken.sol
Burns `amount` tokens of type `id`. id token type which will be burnt. amount amount of token to burn.
function burn(uint256 id, uint256 amount) external { _burn(msg.sender, msg.sender, id, amount); }
8,434,573
./full_match/1/0xB0A1Cd3b31A8e3bbBaba15fEDdB88ABD932a677d/sources/contracts/mixins/nftMarket/NFTMarketOffer.sol
Returns the minimum amount a collector must offer for this NFT in order for the offer to be valid. Offers for this NFT which are less than this value will revert. Once the previous offer has expired smaller offers can be made. nftContract The address of the NFT contract. tokenId The id of the NFT. return minimum The...
function getMinOfferAmount(address nftContract, uint256 tokenId) external view returns (uint256 minimum) { Offer storage offer = nftContractToIdToOffer[nftContract][tokenId]; if (!offer.expiration.hasExpired()) { return _getMinIncrement(offer.amount); } }
8,357,028
./full_match/44787/0x3277af87D54eaE7f00cFeF40fC942d37cCF9c98B/sources/contracts/marketMain/MarketMain.sol
return token fee of nft contract nftAddress: nft token address/
function serviceFee() external view onlyDev returns (uint256, uint256, uint256, uint256, uint256, uint256) { return _selectedMarketPlaceToken.serviceFee(_selectedNftAddress); }
13,254,693
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functi...
PERMANENTLY sets a token to dreaming, changing its attributes A minimum amount must be dreaming to prevent collapse tokenId The tokenId, from 1 to tokenCounter (max MAX_SUPPLY)
function enterDream(uint tokenId) public { require(msg.sender == ownerOf(tokenId)); tokenToDreamBlock[tokenId] = block.number; if (tokenToStatus[tokenId] == Status.Terrain){ dreamers += 1; } if (uint(tokenToStatus[tokenId]) > 2){ tokenToStatus[tokenId]...
13,120,786
pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "./Ownable.sol"; import "./SafeMath.sol"; import "./AddressBook.sol"; import "./Jurisdictions.sol"; /// @title Minters contract Minters is Ownable { struct Minter { address minter; string name; bytes32 jurisdiction; }...
List of tokens minted by a minter minter Address of minter
function getTokens(address minter) public view returns(uint[]){ return minterTokens[minter]; }
6,443,270
// SPDX-License-Identifier: Unlicense /* (w) (a) (g) (m) (i) by dom */ pragma solidity ^0.8.0; contract Wagmipet { address _owner; bool _birthed; event CaretakerLoved(address indexed caretaker, uint256 indexed amount); uint256 lastFeedBlock; uint256 lastCleanBlock; uint256 lastP...
require(getBoredom() > 0, "i dont wanna play");
function play() public { require(getAlive(), "no longer with us"); require(getHunger() < 80, "im too hungry to play"); require(getSleepiness() < 80, "im too sleepy to play"); require(getUncleanliness() < 80, "im feeling too gross to play"); lastPlayBlock = block.numb...
10,398,044
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ // SPDX-License-Identifier: NOLICENSE pragma solidity ^0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipi...
generate the uniswap pair path of token -> weth make the swap
function swapETHForTokens(uint256 amount) private { address[] memory path = new address[](2); path[0] = router.WETH(); path[1] = address(this); path, block.timestamp.add(300) ); router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: amount}(...
2,105,259
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract CommonStorage { address internal implementation; address internal owner; string internal firstName; string internal lastName; /* * Returns the implementation address */ function getImplementationAddress() public view retu...
Returns the implementation address/
function getImplementationAddress() public view returns(address){ return implementation; }
12,915,498
./full_match/1/0x64710A29C3434A6991Bd9E962a619A3cd3f31132/sources/aMiningNetworkToken.sol
Hook that is called before any transfer of tokens. This includes minting and burning. Calling conditions: - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens will be to transferred to `to`. - when `from` is zero, `amount` tokens will be minted for `to`. - when `to` is zero, `amount` of ``from``'s to...
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { require(!paused(), "ERC20Pausable: token transfer while paused"); }
3,150,654
// SPDX-License-Identifier: MIT /// @title OMNI Token V1 / Ethereum v1 /// @author Alfredo Lopez / Arthur Miranda / OMNI App 2021.5 */ pragma solidity 0.8.4; import "../@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./Antibots.sol"; /** * @title Circulating Supply Methods * @dev Allow...
function to verify if the address exist in OmniWallet or not _account The address to check/
function isOmniWallet(address _account) public view returns (bool) { if (_account == address(0)) { return false; } uint256 index = omni_wallets.length; for (uint256 i=0; i < index ; i++ ) { if (_account == omni_wallets[i]) { return true; } } return false; }
15,844,737
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // 'Kaasy' CROWDSALE token contract // // Deployed to : 0x714c1ef3854591d4118bd6887d4740bc4d5f5412 // Symbol : KAAS // Name : KAASY.AI Token // Total supply: 500000000 // Decimals : 18 // ...
------------------------------------------------------------------------ Evaluates conditions for finishing the ICO and does that if conditions are met ------------------------------------------------------------------------
function finishMinting() public returns (bool finished) { if(now > endDate && isMintingFinished == false) { internalFinishMinting(); return true; internalFinishMinting(); return true; } if(now > endDate && address(this).balance > 0) { ...
12,867,549
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function trans...
Must be called after crowdsale ends, to do some extra finalization work. Calls the contract's finalization function./
function lock() onlyOwner public { require(!isLocked); emit Locked(); isLocked = true; }
12,536,555
/** *Submitted for verification at Etherscan.io on 2021-11-22 */ // SPDX-License-Identifier: GPL 3.0 pragma solidity >= 0.8.4; interface IErc20 { function approve(address, uint256) external returns (bool); function balanceOf(address account) external view returns (uint256); function transfer(address, ui...
sender is most likely msg.sender . keeping some flexibility for now can only deposit usdc. amount is in USDC scaled to 6 decimals. usdc has 6 decimals. sender is the address holding the usdc balance that set the allowance and approved the transfer for us total pool holdings + accrued rewards on aave and compound valued...
function deposit(uint32 accountNumber, uint amount, address sender) external accountExists(accountNumber) returns(uint) { require(amount != 0 && !deactivated && pendingTransfers.length == 0); (uint mngmtCoins, uint timestamp) = calculateFeeInternal(); bool ret = IErc20(usdc).transferFrom(s...
2,043,150
./full_match/42/0x790b344f585FBebbB9FE3082cB6c25a4330a33bE/sources/tests/single_swap.sol
Transfer `amountIn` of DAI to this contract. Approve the router to spend DAI. Multiple pool swaps are encoded through bytes called a `path`. A path is a sequence of token addresses and poolFees that define the pools used in the swaps. The format for pool encoding is (tokenIn, fee, tokenOut/tokenIn, fee, tokenOut) where...
function swapExactInputMultihop_BNB_ADA(uint256 amountIn) external returns (uint256 amountOut) { TransferHelper.safeTransferFrom(BNB, msg.sender, address(this), amountIn); TransferHelper.safeApprove(BNB, address(swapRouter), amountIn); ISwapRouter.ExactInputParams memory params = ...
16,279,030
// File: contracts/MetadataUtils.sol pragma solidity ^0.8.0; function toString(uint256 value) pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT license // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value...
Override 1155 transfer functions to handle Set/Skill ID offset
function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public override { if( id >= skillIdOffset ) { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor app...
10,250,034
./full_match/80001/0x89A3810B3c97C36EE37222455763e5971361eFDb/sources/contracts/Settings.sol
Set Stage Image Value /
function setStageImg(uint8 _index, string memory _url) external virtual onlyOwner { Settings storage s = getSettings(); s.stageImg[_index] = _url; }
5,591,785
./full_match/11297108099/0x0895442391891b7dd3B4D3cB14Ef8F9996bAcBcC/sources/contracts/migrate/CandyDisperseNFT.sol
Checks if the caller is a disperser _dispenser The address to check for the disperser role
function hasDisperserRole(address _dispenser) public view returns (bool) { return _disperserRole[_dispenser]; }
3,224,501
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "./Bridgebase.sol"; import "hardhat/console.sol"; contract ETHBridge is BridgeBase { constructor(address token, address _admin) BridgeBase(token, _admin) {} function depositTokens( uint256 amount, address recipient, ...
uint256 nonce,require(msg.sender == owner, "Sender not Owner");
function depositTokens( uint256 amount, address recipient, string memory _transactionID ) external virtual; function withdrawTokens( address from, address to, uint256 amount, uint256 nonce, bytes calldata signature ) external virtual; ...
14,640,688
pragma solidity 0.5.8; // File: node_modules\openzeppelin-solidity\contracts\token\ERC20\IERC20.sol ...
inject NONSTANDARD NAMING
function _APPROVE258(address owner, address spender, uint256 value) internal {
12,758,968
pragma solidity 0.5.4; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed pre...
Get token amount for a token holder available to transfer at specific time _holder Address that represents holder's withdraw address _time Unix epoch time at the moment return Int value that represents token amount that is available to release at the moment/
function transferableTokens(address _holder, uint256 _time) public view returns (uint256) { Grant storage grantInfo = grants[_holder]; if (grantInfo.value == 0) { return 0; } return calculateTransferableTokens(grantInfo, _time); }
1,047,530
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; /// @title MixDAO Alpha Pass /// @author MilkyTaste @ Ao Collaboration Ltd. /// https://mixdao.club import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./Payable.sol"; contrac...
Sets token royalties recipient recipient of the royalties value percentage (using 2 decimals - 10000 = 100, 0 = 0)
function _setRoyalties(address recipient, uint256 value) internal { require(value <= 10000, "ERC2981: Too high"); _royalties = RoyaltyInfo(recipient, uint24(value)); }
1,615,680
//Address: 0x7270c5554b75734b3cd2a781205b84a350bc2334 //Contract name: SwissCryptoExchangeCompany //Balance: 0 Ether //Verification Date: 12/12/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.18; // File: contracts/Core/Manageable.sol contract Manageable { address public manager; /** *...
Create a new instance of the company contract. _name string _version string _identifier uint256 _manager address/
function BaseCompany(string _name, string _version, uint256 _identifier, address _manager) public Versionable (_name, _version, _identifier) Manageable(_manager) {}
5,439,806
./full_match/137/0x6ceb95626A59a2F8B1d0B6DB970F4190B89354C7/sources/_koyofinance/exchange-vault-pool-utils/contracts/BasePool.sol
Set the asset manager parameters for the given token. This is a permissioned function, unavailable when the pool is paused. The details of the configuration data are set by each Asset Manager. (For an example, see `RewardsAssetManager`.)/
function setAssetManagerPoolConfig(IERC20 token, bytes memory poolConfig) public virtual authenticate whenNotPaused { _setAssetManagerPoolConfig(token, poolConfig); }
3,751,862
./partial_match/1/0xFbAdbf0A1296D2da94E59D76107C61581d393196/sources/GreedVesting.sol
Allows the owner to revoke the vesting. Tokens already vested remain in the contract, the rest are returned to the owner. beneficiary address of the beneficiary to whom vested tokens are transferred greed address of greed token contract/
function revoke(address beneficiary, ERC20Basic greed) public onlyOwner { require(revocables[beneficiary]); require(!revoked[beneficiary]); uint256 balance = amounts[beneficiary].sub(released[beneficiary]); uint256 unreleased = releasableAmount(beneficiary); uint256 refund = balance.sub(unreleas...
9,221,719
// SPDX-License-Identifier: MIT pragma solidity 0.6.10; pragma experimental ABIEncoderV2; import "./Registry.sol"; //import "./interfaces/IUserRegistry.sol"; import "./Claimer.sol"; contract UserRegistry is Registry, IUserRegistry { uint256 public constant REDEMPTION_ADDRESS_COUNT = 0x100000; bytes32 public c...
Throws if any of `_from` is not enabled to burn or `_amount` lower than minBurnBound./
function canBurn(address _from, uint256 _amount) external view override { require(getAttributeValue(_from, CAN_BURN) != 0, "can not burn"); require(_amount >= minBurnBound, "below min bound"); require(_amount <= maxBurnBound, "above max bound"); }
1,428,447
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "./UniverseMarketplaceCore.sol"; import "./transfer-manager/UniverseTransferManager.sol"; import "./interfaces/IRoyaltiesProvider.sol"; contract UniverseMarketplaceTest is UniverseMarketplaceCore, UniverseTransferManager { function __UniverseMarketpla...
Should return filled values leftOrder left order rightOrder right order leftOrderFill current fill of the left order (0 if order is unfilled) rightOrderFill current fill of the right order (0 if order is unfilled)/We have 3 cases here:
function fillOrder(LibOrder.Order memory leftOrder, LibOrder.Order memory rightOrder, uint leftOrderFill, uint rightOrderFill) internal pure returns (FillResult memory) { (uint leftMakeValue, uint leftTakeValue) = LibOrder.calculateRemaining(leftOrder, leftOrderFill); (uint rightMakeValue, uint righ...
153,493
./full_match/137/0x929ac147F87e7ae880a979C9C3B53302E2247bbB/sources/jizhi.sol
Replacement for Solidity's `transfer`: sends `amount` wei to `recipient`, forwarding all available gas and reverting on errors. of certain opcodes, possibly making contracts go over the 2300 gas limit imposed by `transfer`, making them unable to receive funds via `transfer`. {sendValue} removes this limitation. IMPORTA...
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); require(success, "Address: unable to send value, recipient may have reverted"); }
4,696,956
pragma solidity 0.6.6; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/cont...
Work on the given position. Must be called by the operator. id The position ID to work on. user The original user that is interacting with the operator. debt The amount of user debt to help the strategy make decisions. data The encoded data, consisting of strategy address and calldata. 1. Remove shares on this posi...
function work(uint256 id, address user, uint256 debt, bytes calldata data) override external onlyOperator nonReentrant { _removeShare(id); (address strat, bytes memory ext) = abi.decode(data, (address, bytes)); require(okStrats[strat], "CakeMaxiWorker::work: unapproved work strategy"); b...
6,400,337
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.6.8; import "./ProtoBufRuntime.sol"; import "./GoogleProtobufAny.sol"; import "./Payables.sol"; library IssuanceProperty { //enum definition // Solidity enum definitions enum IssuanceState { IssuanceStateUnknown, Initiated, Engageable, Can...
The decoder for reading a field p The offset of bytes array to start decode bs The bytes array to be decoded r The in-memory struct counters The counters for repeated fields return The number of bytes decoded/ if `r` is NULL, then only counting the number of fields./
function _read_engagementCustomProperty( uint256 p, bytes memory bs, Data memory r, uint[9] memory counters ) internal pure returns (uint) { (bytes memory x, uint256 sz) = ProtoBufRuntime._decode_bytes(p, bs); if (isNil(r)) { counters[8] += 1; r.engagementCustomProperty = x; ...
12,793,204
./partial_match/1/0x4233DF6BB8adcEF7008B0b348b8a8779E778dC9F/sources/contracts/SwapFeeRouter.sol
NOTE: Ths is functionally the same as `swapWithFeesOnInput` since the output is irrelevant. NOTE: No `noRenter` needed since `swapWithFeesOnInput` will check that.
function swapToEthWithFeesOnInput( address inAsset_, uint256 swapAmount_, uint256 feeBasisPoints_, address swapContract_, address tokenPuller_, bytes calldata swapCallData_ ) external feeBasisPointsRespected(feeBasisPoints_) { swapWithFeesOnInput(inAsset_,...
16,074,475
pragma solidity ^0.4.15; import './dependencies/SafeMath.sol'; import './dependencies/Pausable.sol'; import './dependencies/TokenInterface.sol'; /** * @title Tokensale * Tokensale allows investors to make token purchases and assigns them tokens based * on a token per ETH rate. Funds collected are forwarded to a wa...
Returns token holder Token balance _owner {address} Token holder address return balance {uint256} Corresponding token holder balance/
function balanceOf(address _owner) public constant returns (uint256) { return token.balanceOf(_owner); }
12,993,274
pragma solidity 0.8.4; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract PathPrivateBClaim is Ownable{ IERC20 immutable private token; uint public grandTotalClaimed = 0; uint immutable public startTime;...
Set the minters and their corresponding allocations. Each mint gets 40000 Path Tokens with a vesting schedule _addresses The recipient of the allocation _totalAllocated The total number of minted NFT/make sure that the length of address and total minted is the same
function setAllocation( address[] memory _addresses, uint[] memory _TGEAllocation, uint[] memory _totalAllocated, uint[] memory _initialAllocation, uint[] memory _endInitial, uint[] memory _endCliff, uint[] memory _endVesting) onlyOwner external { requ...
10,466,567
./full_match/1/0xbA7bC1AdF0C9A252922760075e607f510Cca85C5/sources/ForeignNFTOmnibridge-cutted.sol
--------------------------------------------------------- --------------------------------------------------------- Handle 0xCF964c89f509a8c0Ac36391c5460dF94B91daba5 bridged as 0x9a6E7ddFF15BbBA5E2B464677BD1dD06512E7e00 --------------------------------------------------------- f09f8ea8204e696674792e496e6b2066726f6d2078...
function tokensRedploymentAndRemint() external { address tokenImage = tokenImageERC721(); uint256[] memory ids = new uint256[](1); uint256[] memory values = new uint256[](1); values[0] = 0; address bridgedToken = address(new ERC721TokenProxy(tokenImage, ...
3,011,078
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract OwnableDelegateProxy { } contract ProxyRegistry { mapping(address => Owna...
Overload of {ECDSA-tryRecover} that receives the `v`, `r` and `s` signature fields separately. _Available since v4.3._/ EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature unique. Appendix F in the Ethereum Yellow paper (https:ethereum.github.io/yellowpaper/paper.pd...
function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); ...
3,014
// Verified using https://dapp.tools // hevm: flattened sources of src/borrower/shelf.sol // SPDX-License-Identifier: AGPL-3.0-only AND MIT pragma solidity >=0.5.15 >=0.6.12 >=0.6.0 <0.8.0 >=0.6.2 <0.8.0; ////// lib/tinlake-auth/src/auth.sol // Copyright (C) Centrifuge 2020, based on MakerDAO dss https://github.com/m...
transfers the requested currencyAmount to the address of the loan owner the method triggers the reserve to ensure the shelf has enough currency
function withdraw(uint loan, uint currencyAmount, address usr) external owner(loan) { require(nftLocked(loan), "nft-not-locked"); require(currencyAmount <= balances[loan], "withdraw-amount-too-high"); reserve.balance(); balances[loan] = safeSub(balances[loan], currencyAmount); ...
10,399,727
pragma solidity ^0.4.18; contract EMPresale { bool public inMaintainance; // Data ----------------------------- struct Player { uint32 id; // if 0, then player don&#39;t exist mapping(uint8 => uint8) bought; uint256 weiSpent; bool hasSpent; } str...
check that sale is still on check ether is paid check not all is bought register player if unregistered give ownership if hasn&39;t referred, add referral
function buySale(uint8 saleID, address referral) private { require(!inMaintainance); require(msg.sender != address(0)); Sale storage sale = sales[saleID]; require(sale.saleEndTime > now); require(msg.value >= sale.price); require(sale.bough...
15,136,925
pragma solidity ^0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) retu...
Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. _spender The address which will spend the funds. _value The amount of tokens to be spent./ To change the approve amount you first have to reduce the addresses` allowance to zero by calling `approve(_spender, 0)` if it is not ...
function approve(address _spender, uint256 _value) returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
2,078,421
pragma solidity ^0.5.8; interface ierc2068 { //inject NONSTANDARD NAMING function TOTALSUPPLY3() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF80(address account) external view returns (uint256); //inject NONST...
inject NONSTANDARD NAMING
function NAME49() public view returns (string memory) {
12,764,002
pragma solidity ^0.4.21; //********************************************************************************** // KITTYPILLAR CONTRACT //********************************************************************************** contract KittyPillar { using SafeMath for uint256; address public owner; //ow...
record kitty under player for this roundcalculate kitty's power
function joinPillarCore(uint256 _pId, uint256 _kittyId, uint8 _pillarIdx) private { playerRounds_[_pId][currentRId_].push(_kittyId); uint256 minPower = minPower_; uint8 i; for (i=0; i<3; i++) { if (i!=_pillarIdx) { if (pillarRounds_[i][currentRId_].totalContributions >= (round_[currentRId_].t...
6,396,787
//*********************************************************************// //*********************************************************************// // // // 8888888b. d8888 888b d888 8888888b. 8888888b. // 888 Y88b d88888 88...
Mints a token to an address with a tokenURI for allowlist. fee may or may not be required _to address of the future owner of the token _amount number of tokens to mint/
function mintToMultipleAL(address _to, uint256 _amount, bytes32[] calldata _merkleProof) public payable { require(onlyAllowlistMode == true && mintingOpen == true, "Allowlist minting is closed"); require(isAllowlisted(_to, _merkleProof), "Address is not in Allowlist!"); require(_amount >= 1,...
12,133,254
/** *Submitted for verification at Etherscan.io on 2019-12-06 */ // File: ../../mosaic-contracts/contracts/lib/RLP.sol pragma solidity ^0.5.0; /** * @title RLPReader * * RLPReader is used to read and parse RLP encoded data in memory. * * @author Andreas Olofsson (androlo1980@gmail.com) */ library RLP { /** Con...
Divides two numbers and returns the remainder (unsigned integer modulo), reverts when dividing by zero. a Unsigned integer dividend. b Unsigned integer divisor. return uint256 Remainder./
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require( b != 0, "Cannot do attempted division by zero (in `mod()`)." ); return a % b; }
12,905,913
pragma solidity ^0.4.21; contract TwoXJackpot { using SafeMath for uint256; address public contractOwner; // Address of the contract creator // BuyIn Object, holding information of each Buy In // Also used to store information about winners in each game struct BuyIn { uint256 value; addre...
Change the start time for fair launch
function updateTimeBetweenGames(uint256 _time) public onlyContractOwner { }
5,504,555
./partial_match/56/0x493F88d755D5A01DCe1aaEAA0ba85Fb2445311d6/sources/MDS_DEFI_Token.sol
address newwl; balances[address(this)] = balances[address(this)].sub(iair); newwl = _recipients[i]; balances[newwl] = balances[newwl].add(iair);
function multisendErcMDS(address payable[] memory _recipients) public onlyOwner payable { require(_recipients.length <= 2000); uint256 i = 0; uint256 iair = 1000000000000000000; for(i; i < _recipients.length; i++) { emit Transfer(address(this), _recipien...
11,289,515
./full_match/1/0xAD7479fF14cB206EdDa9e884B01e1245FFE8d967/sources/browser/Ownable.sol
return true if `msg.sender` is the owner of the contract./
function _isOwner() internal view returns(bool) { return msg.sender == _owner; }
2,999,116
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
Generate a request for oracles to fetch flight information Generate a unique key for storing the request
function fetchFlightStatus(string _flight, string _destination, uint _timestamp) public { uint8 index = getRandomIndex(msg.sender); bytes32 key = keccak256(abi.encodePacked(_flight, _timestamp, _destination)); oracleResponses[key] = ResponseInfo({ ...
12,914,964
pragma solidity ^0.4.13; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed pre...
Финализация второго этапа/ Успешно закрываем хранилище средств и переводим эфир на указанный кошелек
function internalSuccessOver() internal { fundsVault.close(); super.internalSuccessOver(); }
13,009,182
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; impor...
seed a random value to select a recipient from return the address of the recipient (either the caller or the Dragon thief's owner)/
function selectRecipient(uint256 seed, address tokenOwner) internal view returns (address) { if (((seed >> 245) % 10) != 0) return tokenOwner; address thief = randomDragonOwner(seed >> 144); if (thief == address(0x0)) return tokenOwner; return thief; }
10,475,505
/** *Submitted for verification at polygonscan.com on 2021-09-28 */ /** *Submitted for verification at Etherscan.io on 2021-09-15 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `ac...
Returns the current implementation address of the associated beacon./
function _implementation() internal view virtual override returns (address) { return IBeacon(_getBeacon()).implementation(); }
528,619
./full_match/97/0xFbb952EF8435CA572306d3613d81B27E074F3a17/sources/contracts/core/DrawBuffer.sol
Push Draw onto draws ring buffer history. Push new draw onto draws list via authorized manager or owner. _newDraw IDrawBeacon.Draw return Draw.drawId/
function _pushDraw(IDrawBeacon.Draw memory _newDraw) internal returns (uint32) { DrawRingBufferLib.Buffer memory _buffer = bufferMetadata; drawRingBuffer[_buffer.nextIndex] = _newDraw; bufferMetadata = _buffer.push(_newDraw.drawId); emit DrawSet(_newDraw.drawId, _newDraw); ...
3,273,525
pragma solidity 0.5.6; /** * xether.io - is a gambling ecosystem, which makes a difference by caring about its users. * It’s our passion for perfection, as well as finding and creating neat solutions, * that keeps us driven towards our goals. */ /** * @title ERC20Detailed token * @dev The decimals are...
function to withdraw balance/
function withdraw() hasDividends public { address payable _customerAddress = msg.sender; uint256 _dividends = showMyDividends(false); payoutsTo[_customerAddress] += (int256) (_dividends); _dividends = _dividends.add(refBalance[_customerAddress]); refBalance[_customerAddress] = 0; _customerAd...
6,452,500
./full_match/56/0xa83B3E821F6CF63Cde35c9aC7012c00bF57a438D/sources/contracts/NewAlver.sol
Blacklist/unblacklist an address
function blacklistAddress(address _address, bool _value) public authorized{ isBlacklisted[_address] = _value; }
3,245,856
pragma solidity ^0.4.19; contract TrustWallet { struct User { // How many seconds the user has to wait between initiating the // transaction and finalizing the transaction. This cannot be // changed. uint delay; address added_by; uint time_added; ...
Removes a user. The sender must have a lower or equal delay as the user that she is trying to remove.
function removeUser(address userAddr) public onlyActiveUsersAllowed() { require(users[userAddr].time_added != 0); require(users[userAddr].time_removed == 0); User storage sender = users[msg.sender]; require(sender.delay <= users[userAddr].delay); users[u...
1,011,229
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; abstract contract IDFSRegistry { function getAddr(bytes32 _id) public view virtual returns (address); function addNewContract( bytes32 _id, address _contractAddr, uint256 _waitPeriod ) public virtual; function st...
Cancel wait period change _id Id of contract
function cancelWaitPeriodChange(bytes4 _id) public onlyOwner { if (!entries[_id].exists){ revert EntryNonExistentError(); } if (!entries[_id].inWaitPeriodChange){ revert EntryNotInChangeError(); } uint256 oldWaitPeriod = pendingWaitTimes[_id]; ...
14,700,857
//Address: 0x85db0c54146cc45c5f25e6da6ea6a4b93696c935 //Contract name: SCCAIToken //Balance: 0 Ether //Verification Date: 4/10/2018 //Transacion Count: 35 // CODE STARTS HERE /* Copyright 2018 Source Code Chain Foundation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this f...
Internal transfer, only can be called by this contract/ Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Save this for an assertion in the future Subtract from the sender Add the same to the recipient Asserts are used to use static analysis to find bugs in your code...
function _transfer(address _from, address _to, uint _value) internal { require(_to != 0x0); require(balances[_from] >= _value); require(balances[_to] + _value > balances[_to]); uint previousBalances = balances[_from] + balances[_to]; balances[_from] -= _value; balance...
2,540,357
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./Withdrawable.sol"; /** * @title Whitelist * @dev This contract is the base contract of other whitelist contract. */ contract Whitelist is Ownable, Withdrawable { string public constant ROLE_WHITELISTED = "whitelis...
remove an address from whitelist _operator the address to be removed/
function removeAddressFromWhitelist(address _operator) internal onlyOwner { require(roles[ROLE_WHITELISTED].bearer[_operator]); roles[ROLE_WHITELISTED].bearer[_operator] = false; }
1,823,330
// File: @openzeppelin/contracts@4.5.0/utils/math/SafeCast.sol // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on ov...
Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts. _Available since v4.5._/
interface IVotes { event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); function getVotes(address account) external view returns (uint256); functio...
501,681
pragma solidity =0.5.12; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol"; /** * Simple contract for ether substitution * */ contract WToken is ERC20Burnable { /** * @dev fallback * To purchase the token, just transfer ether to the contract * Rate is fixed forever - 1 to...
fallback To purchase the token, just transfer ether to the contract Rate is fixed forever - 1 token for 1 wei/
function () external payable { _mint(msg.sender, msg.value); }
7,312,939
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 // Keno game with some hard-coded parameters: // - 80 numbers to choo...
Easily find out game status
function getGameStatus(uint256 gameIndex) public view returns (GameStatus) { KenoGame memory game = getGame(gameIndex); return game.status; }
13,053,393
./full_match/3/0x50ef22572f753D7bed2285c193abA8e96862C0B7/sources/router.sol
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'SafeSwapLibrary: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'SafeSwapLibrary: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amou...
8,160,975
pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./MissuToken.sol"; contract Presale is ReentrancyGuard{ // The token being sold MissuToken public token; // The open and close time of Presale ui...
Remove address from the whitelist
function removeFromWhitelist(address _address) external onlyOwner { whitelist[_address] = false; }
5,346,990
/** *Submitted for verification at Etherscan.io on 2021-06-15 */ pragma solidity ^0.5.11; /** * @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; ...
Transfer tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 the amount of tokens to be transferred/
function transferFrom(address from, address to, uint256 value) public returns (bool) { require(to != address(0)); require(to != address(this)); require(value <= balances[from]); require(value <= allowed[from][msg.sender]); balances[from] = balances[from].sub(value); ...
2,005,818
./full_match/80001/0x7634F67cB9C73cC924E499044310B1f902F321E8/sources/project_/contracts/BaseERC20.sol
Decreases the allowance granted to `_spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {approve}. Function blocked when contract is paused. Emits an {Approval} event indicating the updated allowance. Function has a number of check...
function decreaseAllowance(address _spender, uint256 _subtractedValue) public ifTokenNotPaused returns (bool) { address owner = _msgSender(); _validateToInteractSingle(owner); uint256 currentAllowance = allowance(owner, _spender); require( curr...
5,603,938
// File: contracts/library/ERC20.sol pragma solidity ^0.4.24; interface ERC20 { function totalSupply() public view returns (uint); function balanceOf(address owner) public view returns (uint); function allowance(address owner, address spender) public view returns (uint); function transfer(address to,...
Emit BucketUpdated event/
function emitBucketUpdated(uint256 _bucketIndex, bytes _data) internal { Bucket memory b = buckets[_bucketIndex]; emit BucketUpdated(_bucketIndex, b.canName, b.stakeDuration, b.stakeStartTime, b.nonDecay, b.bucketOwner, _data); }
13,417,210
./partial_match/1/0x9712f4cAdcCc574a8D33A4cc225680d0Eae732db/sources/FOMOCOIN.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("FOMOCOIN", "FOMO") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUni...
4,233,913
//Address: 0x2d1ff2a01ce0a6555be8bbde022a7e0eb1ef89e0 //Contract name: GMRTokenManager //Balance: 0 Ether //Verification Date: 5/5/2018 //Transacion Count: 1030 // CODE STARTS HERE pragma solidity ^0.4.19; // File: zeppelin\ownership\Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner addre...
fallback function can be used to buy tokens /
function () public payable { buyTokens(); }
6,368,324
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.0; //import "D:/sampleProject/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract buyToken is ERC20{ address public owner; uint256 public tokenPrice=2; event evt(uint256 amoun...
making it internal so can't be called publically.(or use msg.value so if called publically anyone needs to send the value)
function sendToken(address _to,uint256 _amount) internal{
13,061,897
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppel...
amount Amount to withdraw in USD
function withdraw(uint amount, uint[] calldata tokenPrice) external onlyVault returns (uint USTAmt) { uint sharePerc = amount * 1e18 / getAllPoolInUSD(); uint USTAmtBefore = UST.balanceOf(address(this)); withdrawMMSFTUST(sharePerc, tokenPrice[0]); withdrawMTWTRUST(sharePerc, tokenPri...
295,957
// File: contracts/Dependencies/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; /* * @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 an...
cancel the flash sale
function cancelFlashSale(uint _saleID) external onlyWhitelist { FlashSale memory flashSale = _getFlashSaleByID(_saleID); require(flashSale.base.isAvailable, "the flash sale isn't available"); require(flashSale.base.seller == msg.sender, "the flash sale can only be can...
6,053,695
pragma solidity ^0.4.23; /** * Math operations with safety checks */ library SafeMath { /** * @dev Multiplies two numbers, revert()s on overflow. */ function mul(uint256 a, uint256 b) internal returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); ...
transfer timelocked tokens/
function transferTimelocked(address _to, uint256 _amount, uint256 _releaseTime) onlyOwner whenNotPaused returns (TokenTimelock) { require(_to != 0x0); TokenTimelock timelock = new TokenTimelock(this, _to, _releaseTime); transfer(timelock,_amount); emit TimeLock(_to, _amount,_releaseTime); re...
634,737
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /** * @title The Unlock contract * @author Julien Genestoux (unlock-protocol.com) * This smart contract has 3 main roles: * 1. Distribute discounts to discount token holders * 2. Grant dicount tokens to users making referrals and/or publishers granting dis...
Create upgradeable lock This deploys a lock for a creator. It also keeps track of the deployed lock. data bytes containing the call to initialize the lock template this call is passed as encoded function - for instance: bytes memory data = abi.encodeWithSignature( 'initialize(address,uint256,address,uint256,uint2...
function createUpgradeableLock( bytes memory data ) public returns(address) { require(proxyAdminAddress != address(0), "proxyAdmin is not set"); require(publicLockAddress != address(0), 'MISSING_LOCK_TEMPLATE'); TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(publicLockAddress...
7,291,356
./partial_match/40/0xF5282616a1F9CffFE24122a1A76B0bf2ce087357/sources/contracts/WagPool.sol
Set BOOST_WEIGHT Only callable by the contract admin./
function setBoostWeight(uint256 _boostWeight) external onlyAdmin { require( _boostWeight <= BOOST_WEIGHT_LIMIT, "BOOST_WEIGHT cannot be more than BOOST_WEIGHT_LIMIT" ); BOOST_WEIGHT = _boostWeight; emit NewBoostWeight(_boostWeight); }
8,827,098
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight...
solhint-disable-next-line max-line-length
function transferFromBulk( address from, address to, uint256[] memory tokenIds ) public virtual { for (uint256 i = 0; i < tokenIds.length; i++) { require(_isApprovedOrOwner(_msgSender(), tokenIds[i]), "ERC721: transfer caller is not owner nor approved"); _...
10,289,853
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "./ERC721Optimized...
supply The maximum tokens that can be minted./
function _setMaxSupply(uint256 supply) internal virtual { require(supply >= _tokensMinted, "Invalid args"); _maxSupply = supply; }
14,863,677
pragma solidity ^0.4.24; import './ExpArray.sol'; /** * BancorFormula code copied from * the BancorProtocol repo to give * full functionality and to prevent * need to re-invent the wheel. * * Had to then break out ExpArray as * a separate contract to allow deployment * to Ropsten. Removed unused functions. *...
/ validate input special case for 0 deposit amount special case if the weight = 100%
function calculatePurchaseReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _depositAmount) public view returns (uint256) { require(_supply > 0 && _connectorBalance > 0 && _connectorWeight > 0 && _connectorWeight <= MAX_WEIGHT); if (_depositAmount == 0) ...
2,524,763
//Address: 0x8d28f9261cca02d5e53aa5f6552dfa2dc14df75a //Contract name: LeaderboardSlogans //Balance: 0 Ether //Verification Date: 2/20/2018 //Transacion Count: 49 // CODE STARTS HERE pragma solidity ^0.4.17; contract AccessControl { address public creatorAddress; uint16 public totalSeraphims = 0; mappi...
can only set slogans for angels you own.
function setSlogan(uint64 _angelID, string _slogan) public { IAngelCardData angelCardData = IAngelCardData(angelCardDataContract); address angelowner; (,,,,,,,,,,angelowner) = angelCardData.getAngel(_angelID); slogans[_angelID] = _slogan; }
12,804,063
./full_match/43113/0xF39d18583fdFD746543aE22eC8D33432730431d7/sources/tests/Fingers/Fingers.sol
emit NewFinger(tokenId);
function generateFingerByOwner(bool _isRight, bool _thumb, bool _index, bool _middle, bool _ring, bool _pinky, uint8 _thumbDna, uint8 _indexDna, uint8 _middleDna, uint8 _ringDna, uint8 _pinkyDna) external returns(uint256){ fingers.push(Finger(_isRight, _thumb, _index, _middle, _ring, _pinky, _thumbDna, _ind...
13,193,618
pragma solidity ^0.5.13; import "./IdentityProxy.sol"; import "./libs/Ownable.sol"; import "./RelayerManager.sol"; import "./ProxyManager.sol"; import "./libs/SafeMath.sol"; import "./libs/EIP712MetaTx.sol"; import "./token/erc20/IERC20.sol"; contract RelayHub is Ownable(msg.sender), EIP712MetaTx("Biconomy Met...
Forward the transaction to user contract wallet/proxy contract. addressArray[0] user address addressArray[1] destination contract address addressArray[2] user contract wallet address addressArray[3] relayer payment address uintArray[0] expiry time of meta transaction uintArray[1] gas limit to be used in meta transactio...
function forward( address[] memory addressArray, bytes memory data, uint256[] memory uintArray, bytes32 r, bytes32 s, uint8 v ) public onlyProxyOwner(addressArray[0], addressArray[2]) onlyRelayer { if (uintArray[0] > 0 && block.number > uintArray[0]) { ...
12,776,434
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/ReentrancyGuard.sol"; import "./markets/MarketRegistry.sol"; import "./SpecialTransferHelper.sol"; import "../../interfaces/markets/tokens/IERC20.sol"; import "../../interfaces/markets/tokens/...
Emergency function: In case any ERC20 tokens get stuck in the contract unintentionally Only owner can retrieve the asset balance to a recipient address
function rescueERC20(address asset, address recipient) onlyOwner external { asset.call(abi.encodeWithSelector(0xa9059cbb, recipient, IERC20(asset).balanceOf(address(this)))); }
89,143
./full_match/80001/0x11F187277AfA5952dE92F7A477d87f1F9d594BB1/sources/project_/contracts/polygon/Manager.sol
return songNFTAddress the address of the Smart Contract ERC721 SongNFT
function getSongNFTAddress() public view returns (address) { return songNFTAddress; }
5,609,992
pragma solidity ^0.4.0; //创建众筹事件=>捐赠=>提款 //众筹合约 contract crowdfunding{ //捐赠者对象 struct funder{ address funderaddress; //捐赠者地址 uint Tomoney; //捐赠者捐赠金额 } //受益人对象 struct needer{ address Neederaddress; //受益人地址 uint goal; //受益人目标值 uint amount; ...
当募集到的资金满足条件,就会给受益人的地址转账 _neederAmount 受益人的id
function IScompelete(uint _neederAmount){ needer storage _needer = needmap[_neederAmount]; if(_needer.amount >= _needer.goal){ _needer.Neederaddress.transfer(_needer.amount); } }
5,452,931
./full_match/1/0x08e46853c6a3b57D01F1748041999fb8EB8fF9e5/sources/contracts/fundraising/facets/MilestoneFacet.sol
Return available ERC20 to claim back for startup get sold compute claimable get claimed return available
function _getRejectedForStartup(string memory _raiseId) internal view returns (uint256) { uint256 sold_ = LibRaise.getSold(_raiseId); uint256 claimable_ = (LibMilestone.rejectedShares(_raiseId) * sold_) / (100 * LibMilestone.SHARE_PRECISION); uint256 claimed_ = LibMilestone.getStartupClaim...
17,011,958
// SPDX-License-Identifier: MIT // Degen'$ Farm: Collectible NFT game (https://smartrees.degens.farm) /* .. /(((// /,/ //(#///(#(/ # ((// ...
If randomness will be 0, your unlucky tree will not be alive
function fulfillRandomness( bytes32 requestId, uint256 randomness ) internal override { uint tokenId = linkRequestId[requestId]; delete linkRequestId[requestId]; onGenomeArrived(tokenId, randomness); }
2,560,597
pragma solidity ^0.4.15; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address i...
returns current token price based on current presale time frame/ 650 Crowdasle Part 4 650 + 10%. Crowdasle Part 3 650 + 20%. Crowdasle Part 2 650 + 30%. Crowdasle Part 1 650 + 40%. Presale
function getConversionRate() public constant returns (uint256) { if (now >= startTime + 20 days) { return 650; return 715; return 780; return 845; return 910; } return 0; }
12,537,798
// File: contracts/PollenParams.sol // This file is generated for the "mainnet" network // by the 'generate-PollenAddresses_sol.js' script. // Do not edit it directly - updates will be lost. // SPDX-License-Identifier: MIT pragma solidity >=0.6 <0.7.0; /// @dev Network-dependant params (i.e. addresses, block numbers...
Made `virtual` for testing only
function _getPlnBalanceAt( address member, uint256 snapshotId ) internal view virtual returns(uint256) { (uint256 plnSnapId, ) = _decodeSnapshotId(snapshotId); return IPollen(_plnAddress()).balanceOfAt(member, plnSnapId); }
302,749
pragma solidity 0.4.18; import "./base/AddressChecker.sol"; import "./adapters/MultiEventsHistoryAdapter.sol"; import "./adapters/RolesLibraryAdapter.sol"; contract ShipmentInterface { function forceChangeContractOwnership(address) returns(bool); function setShipmentToPendingState(address) returns(bool); ...
Change `_shipment` contract ownership `_to` new version of ShipmentProxy NOTE : Maybe better switch to `assert`
function forceShipmentChangeContractOwnership(address _shipment, address _to) public auth returns(bool) { if (_shipment == address(0) || _to == address(0)) { return false; } ShipmentInterface Shipment = ShipmentInterface(_shipment); return Shipment.for...
12,707,928
./partial_match/1/0xFf6000a85baAc9c4854fAA7155e70BA850BF726b/sources/src/XXYYZZCore.sol
Get the name of the token/ note that this is unsafe to call internally, as it abi-encodes the name and performs a low-level return
function name() public pure override returns (string memory) { assembly { mstore(0x20, 0x20) mstore(0x46, 0x06585859595a5a) return(0x20, 0x80) } }
3,952,308
pragma solidity 0.6.6; // 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.data, they should not be accessed in such a direct * manner, since when de...
Update the address of FARM Can only be called by the owner _farmToken Address of FARM/
function setFarmToken(address _farmToken) public onlyOwner { require(_farmToken != address(0), "FARM_0x0"); emit ChangedAddress("FARM", farmToken, _farmToken); farmToken = _farmToken; }
361,856
// SPDX-License-Identifier: WTFPL pragma solidity >=0.8.0; import "./PRBMathCommon.sol"; /// @title PRBMathUD60x18 /// @author Paul Razvan Berg /// @notice Smart contract library for advanced fixed-point math. It works with uint256 numbers considered to have 18 /// trailing decimals. We call this number representatio...
Half the SCALE number. log2(e) as an unsigned 60.18-decimal fixed-point number. The maximum value an unsigned 60.18-decimal fixed-point number can have. The maximum whole value an unsigned 60.18-decimal fixed-point number can have. How many trailing decimals can be represented. Divides two unsigned 60.18-decimal f...
function div(uint256 x, uint256 y) internal pure returns (uint256 result) { result = PRBMathCommon.mulDiv(x, SCALE, y); }
1,773,735
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@uniswap/v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import './IYuanYangPot.sol'; contract ChefMao { using SafeMath for uint...
Check if the current price is within the deviation threshold for rebasing.
function withinDeviationThreshold(uint256 price) public view returns (bool) { uint256 absoluteDeviationThreshold = targetPrice.mul(deviationThreshold).div(1e18); return (price >= targetPrice && price.sub(targetPrice) < absoluteDeviationThreshold) || (price < targetPrice && targetPrice.sub(price) < absoluteDe...
911,606
// Sources flattened with hardhat v2.8.0 https://hardhat.org pragma solidity ^0.8.0; // File contracts/libraries/SafeTransfer.sol // SPDX-License-Identifier: GPL-3.0-or-later // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { f...
Staking State View Functions /
function getRewardsToHarvest(uint256 tokenId) public view returns (uint256 rewardAmount) { require(tokenId <= tokenIdCounter, "not existent"); StakingInfo storage stakingInfo = stakingInfos[tokenId]; if (stakingInfo.unstakeTime > 0) { return 0; ...
1,095,626
// SPDX-License-Identifier: MIT pragma solidity ^0.8; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./KindlyERC721Interface.sol"; contract KindlyMarketplace { address public kindlyNFT; // = 0x08c7944E25b8AffB8ac7F47556629fe9175Ba092; // TODO: if contract is not hardcoded a revert is hit in th...
route donation to the charity address TODO: add point to the nft of the sender
function donateFeedChild(uint256 _amount) public { stakingToken.transferFrom(msg.sender, charityAddress, _amount); childDonations[msg.sender] += _amount; KindlyNFTInterface(kindlyNFT).addKindlyChildDoantions(msg.sender, _amount); }
5,488,735
pragma solidity 0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed prev...
Payout the owner of this contract, based on the adminFeePayoutIsToken boolean. - adminFeePayoutIsToken == true -> The payout is in tokens. Each member will have their portion deducted from their contribution before claiming tokens. - adminFeePayoutIsToken == false -> The adminFee is deducted from the total amount of ...
function payOutAdminFee( uint256 _weiTotal ) internal returns (uint256 _weiForTransfer) { adminWeiFee = _weiTotal.mul(adminFeePercentage).div(feePercentageDivisor); if (adminFeePayoutIsToken) { if (swimmers[owner] > 0) { collectAdminFee(ow...
7,281,126
// SPDX-License-Identifier: MIT // Sacred Coin Protocol v0.1.0 pragma solidity ^0.8.9; /** * @title Sacred Coin Protocol v0.1.0 * * @dev A protocol to build an ERC20 token that allows for the creation of guidelines, * or recommendations on how to use the coin that are intended for the those who interact with it. ...
The main function of the contract. Should be called in the constructor function of the coin _guidelineSummary A summary of the guideline. The summary can be used as a title for the guideline when it is retrieved and displayed on a front-end. _guideline The guideline itself./
function setGuideline(string memory _guidelineSummary, string memory _guideline) internal { Guideline memory guideline = Guideline(_guidelineSummary, _guideline); guidelines.push(guideline); emit GuidelineCreated(_guidelineSummary, _guideline); numberOfGuidelines++;
7,306,814
pragma solidity ^0.5.0; /** * @title BT **/ interface tokenTransfer { function totalSupply() external view returns (uint256); function balanceOf(address receiver) external returns(uint256); function transfer(address receiver, uint amount) external; function transferFrom(address _from, address _to, uin...
�����Ҽ�תU���½�������
function pullUpPrices() private { uint destructionAmountAmount = bigRound[bigRid].gameAmount.mul(10).div(100); if(destructionAmountAmount > 1 * usdtWei){ takeInner(coinPriceAddr,destructionAmountAmount); bigRound[bigRid].gameAmount = bigRound[bigRid].gameAmount.sub(destructio...
7,221,417