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.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } func...
ERC20 backwards compatible transfer. _to The address of the recipient _amount The number of tokens to be transferred return `true`, if the transfer can't be done, it should fail./
function transfer(address _to, uint256 _amount) public erc20 returns (bool success) { doSend(msg.sender, _to, _amount, "", msg.sender, "", false); return true; }
1,825,408
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ac...
Check pool balance, withdraw `amount` of base liquidity token from lending contract to this when `amount` > `baseTokenBalance`
function _ensureBaseBalance(uint256 amount) private { require(amount != 0, "amount cannot be 0"); require(getPoolTotalLiquidAssetsValue() >= amount, "amount cannot be greater than total liquid asset value"); if (amount > baseTokenBalance) { uint256 balanceDifference = amount - ba...
6,397,060
./full_match/1/0xf607014406bc3Fa7aAB224a85A0318b4556e9C28/sources/browser/ERC2665LogicV1.sol
Transfers the ownership of an NFT from one address to another address This works identically to the other function with an extra data parameter, except this function just sets data to "". _from The current owner of the NFT _to The new owner _tokenId The NFT to transferbytes4(keccak256("onERC2665Received(address,ad...
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable{ transferFromInternal(_from, _to, _tokenId, msg.sender, msg.value); require(_to != address(0)); if(isContract(_to)){ require(ERC2665TokenReceiver(_to).onERC2665Received(msg.sender, _from, _t...
3,151,852
./full_match/137/0xB07943BF889DA909428E6bc0fD393e310F24eECF/sources/PhantomMiura.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { super.tokenURI(_tokenId); return _baseURI(); }
4,738,594
pragma solidity ^0.8.0; import "@c-layer/distribution/contracts/WrappedERC20.sol"; import "./LockableTransfer.sol"; import "./Distributable.sol"; /** * @title WrappedToken * @dev WrappedToken contract * Wrapped token ERC20 default implementation * * @author Cyril Lapinte - <cyril.lapinte@openfiz.com> * SPDX-Li...
transferFromInternal/
function transferFromInternal(address _from, address _to, uint256 _value) internal override returns (bool) { require(!isTransferLocked(_from, _to), "WT01"); return super.transferFromInternal(_from, _to, _value); }
12,739,398
./full_match/1/0x79544C47AbC1d79F6B878490d5211af5414764d2/sources/contracts/Claimer.sol
Changes The Seconds Interval For Timelocked Draft Pick Merkle Claims/
function _ChangeSecondsInterval(uint SecondsInterval) external onlyOwner { _Claim._SecondsPerTokenID = SecondsInterval; }
8,422,656
/** *Submitted for verification at Etherscan.io on 2021-07-25 */ //SPDX-License-Identifier: Unlicense pragma solidity ^0.7.3; /** * @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 p...
------------------------------------------------------------------------ Transfer `tokens` from the `from` account to the `to` account The calling account must already have sufficient tokens approve(...)-d for spending from the `from` account and - From account must have sufficient balance to transfer - Spender must ha...
function transferFrom(address from, address to, uint256 tokens) external override returns (bool success){ require(balances[from] >= tokens, "Insufficient senders balance"); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); ...
2,324,298
pragma solidity ^0.4.19; /** * @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 0; } uint2...
divs for current island owner
function purchase(uint256 _island_id) public payable { require(maintenance == false); Island storage island = islands[_island_id]; require(island.owner != msg.sender); require(msg.sender != address(0)); require(msg.value >= island.price); uint256 excess = SafeMath.s...
11,647,180
./full_match/1/0x184e48FA8B332D3D3FB08eDa535Fd7591e340Bb2/sources/contracts/NFT/NFTByMetadrop.sol
____________________________________________________________________________________________________________________ -->GETTER (function) totalMinted Returns the total number of tokens ever minted -------------...
function totalMinted() public view override(ERC721M, INFTByMetadrop) returns (uint256 totalMinted_) { return (maxSupply - remainingSupply); }
4,935,068
//Address: 0xd1670c55f5e68fede5fddd8ace64a3329f778b89 //Contract name: ATSTokenReservation //Balance: 215.853806028 Ether //Verification Date: 5/30/2018 //Transacion Count: 81 // CODE STARTS HERE pragma solidity ^0.4.23; /* * Contract accepting reservations for ATS tokens. * The actual tokens are not yet created ...
payout of the accepted deposits to the pre-designated address, available once it's all over not idempotent, but multiple invocation would just trigger zero-transfers
function payout() public onlyStateControl requireState(States.Over) { uint256 amount = cumAcceptedDeposits; cumAcceptedDeposits = 0; emit FetchedDeposits(amount); payoutAddress.transfer(amount); }
1,041,368
./full_match/8453/0x7654a0A63b877838577Fd38065A29C27f5bfC6d2/sources/contracts/Bridge.sol
Verify request parameters and generate burnId
function _burn( address _receiver, address _token, uint256 _amount, uint256 _dstChainId, uint256 _nonce ) private returns (bytes32 burnId) { require(_receiver != address(0), "Invalid receiver"); require( minBurn[_token] != 0 && minBurn[_token] ...
11,535,804
./partial_match/4/0x03824267Bc2f86502f0fD5148C9293dC82F6BdCC/sources/OptionMarket.sol
Called by owner to withdraw accrued trading fees/
function collectFees() external onlyOwner nonReentrant returns (uint256 amount) { require(isSettled, "Cannot be called before settlement"); amount = calcFeesAccrued(); if (amount > 0) { baseToken.uniTransfer(msg.sender, amount); } }
8,544,292
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @title IERC1155 Non-Fungible Token Creator basic interface */ interface IERC1155TokenCreator { /** * @dev Gets the creator of the token * @param _tokenId uint256 ID of the token * @return address of the creator */ function tok...
/ safeAcceptBid/ Accept the bid on the token with the expected bid amount. _tokenId uint256 ID of the token _amount uint256 wei amount of the bid _owner address of the token owner/ Make sure accepting bid is the expected amount
function safeAcceptBid( uint256 _tokenId, uint256 _amount, address _owner ) external { require( activeBid[_tokenId][_owner].amount == _amount, "safeAcceptBid::Bid amount must equal expected amount" ); acceptBid(_tokenId, _owner); }
1,455,516
/** *Submitted for verification at Etherscan.io on 2022-02-14 */ // Dependency file: @openzeppelin/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * ...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity } constructor() { _setOwner(_msgSende...
2,268,052
./full_match/44787/0xa9b6051EF47e764F598304c7825866055Ae7Ac1e/sources/contracts/v5/Nylon.sol
Nylon can be increased by x-amount. {increaseSupply} is only callable by the the contract owner. NOTE: To ensure that this function cannot be called by a person, the ownership should be transferred to the address of an other contract. See {BasketService}./
function increaseSupply(uint256 _amount) external onlyOwner returns (bool) { _mint(_msgSender(), _amount); return true; }
13,271,339
pragma solidity ^0.4.13; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint ...
Transfers tokens from your address to other /
function transfer(address _to, uint256 _value) lockAffected returns (bool success) { require(_to != 0x0 && _to != address(this)); return true; }
12,730,367
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; // use latest solidity version at time of writing, need not worry about overflow and underflow /// @title ERC20 Contract contract Token { // My Variables string public name = "Lk"; string public symbol = "L"; uint256 public decimals = 18; u...
Approve other to spend on your behalf eg an exchange _spender allowed to spend and a max amount allowed to spend _value amount value of token to send return true, success once address approved Emit the Approval event Allow _spender to spend up to _value on your behalf
function approve(address _spender, uint256 _value) external returns (bool) { require(_spender != address(0)); allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
229,197
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "./ERC20.sol"; import "./OwnableWithAdmin.sol"; contract MAGNESIUM is ERC20, OwnableWithAdmin { // a mapping from an address to whether or not it can mint / burn. Melange Labs contracts only mapping(address => bool) public controllers; c...
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unche...
572,813
./full_match/1/0x1bDfE04bB0Ef85047BA3e1Ce35f2649d8246F809/sources/contracts/PoxiMarketplaceV1.sol
Adds a single ERC-20 token address to the allowlist. Only the contract owner can call this method. _token address of the token to add to the allowlist. Must be ERC-20 contract address/
function addTokenToAllowlist(address _token) external onlyOwner { tokenAllowlist[_token] = true; emit TokenAddedToAllowlist(_token); }
16,470,482
./full_match/1/0xC0e0c13D3e1F657532a059c7124A27D8990Df1F2/sources/contracts/skullboys.sol
Enable/Disable Presale Minting
function flipPreActiveState() external onlyDev { isPreActive = !isPreActive; isActive = false; }
4,922,238
./full_match/80001/0x092F93Fa52aB4d09fF3111d3902a32C7895a9E6C/sources/src/HyperRental.sol
========== MUTATIVE FUNCTIONS ========== /
function createRentalPack() public returns (uint256, address) { uint256 tokenId = RentalPackNFT(rentalPackAddress).safeMint(address(this)); address tokenBoundAddress = IRegistry(tokenBoundAccountRegistry).createAccount(rentalPackAddress, tokenId); _rentalPackOwner[tokenId] = msg.sender; ...
5,619,741
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; /** * @dev Version contract gives the versioning information of the implementation contract */ contract Version { /** * @dev Returns the string of the current version. */ function version() public pure returns (string memory) { //...
Returns the string of the current version./ version 1.4.0
function version() public pure returns (string memory) { return "1.4.0"; }
12,643,448
//Address: 0x5ee9bc8a2b2baa393706ba3f3268135663a626a1 //Contract name: PetWrapper721 //Balance: 0 Ether //Verification Date: 2/27/2018 //Transacion Count: 114 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title ERC721 interface * @dev see https://github.com/ethereum/eips/issues/721 */ contract AccessCont...
lock is not implemented for pet tokens.
function getTokenLockStatus(uint64 _tokenId) constant public returns (bool) { return false; }
15,782,291
// LICENSE ATTRIBUTION // The MIT License (MIT) // // Copyright (c) 2020-2021 Alethea Tech PTE LTD // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // with...
Restricted access function to set up sale parameters, all at once, or any subset of them To skip parameter initialization, set it to `-1`, that is a maximum value for unsigned integer of the corresponding type; `_aliSource` and `_aliValue` must both be either set or skipped Example: following initializ...
function initialize( ) public onlyOwner { require(_nextId > 0, "zero nextId"); if(_itemPrice != type(uint64).max) { itemPrice = _itemPrice; } if(_nextId != type(uint32).max) { nextId = _nextId; } if(_finalId != type(uint32).max) { finalId = _finalId; } if(_saleSta...
11,767,245
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 pure returns (uint256 c) { if (a == 0) { return 0; } c...
Change crowdsale discount stage/
function changePrice(uint256 newPerice) onlyOwner { price = newPerice; }
7,246,781
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0 <0.9.0; // import "hardhat/console.sol"; import "./Utils.sol"; /** @title Accounts. */ contract Accounts { address payable private owner; mapping (address => Account) public accounts; struct Account { string displayName; string phoneNumber; ...
add admin account details. _address account address. displayName account name. email account email. phoneNumber account phone. isActive account active. return success account success./ TODO: Update account
function updateAccount( address _address, string memory displayName, string memory email, string memory phoneNumber, string memory photoURL, bool isActive ) public payable isAccount(msg.sender) returns(bool) { emit AccountUpdated(_address); accounts[_address].display...
12,624,436
pragma solidity ^0.4.18; /** * @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) public view returns (uint256); function transfer(address to, uint2...
This fallback function is called whenever Ether is sent to the smart contract. It can only be executed when the crowdsale is not paused, not closed, and before the deadline has been reached. This function will update state variables for whether or not the funding goal or cap have been reached. It also ensures that the ...
function () public payable whenNotPaused beforeDeadline afterStartTime saleNotClosed nonReentrant { require(msg.value >= minContribution); uint amount = msg.value; uint currentBalance = balanceOf[msg.sender]; balanceOf[msg.sender] = currentBalance.add(amount); amountRaised =...
14,115,680
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
SET MANAGER ONLY. Removes liquidity from an AMM pool for a specified AMM. User specifies the exact number of liquidity pool tokens to provide and the components and minimum quantity of component units to receive _setToken Address of SetToken _ammName Human readable name of integrati...
function removeLiquidity( ISetToken _setToken, string memory _ammName, address _ammPool, uint256 _poolTokenPositionUnits, address[] calldata _components, uint256[] calldata _minComponentUnitsReceived ) external nonReentrant onlyManagerAndVa...
15,785,562
./full_match/4/0x4631ceDADbF39677f5573A8034Cffc44237916f5/sources/_openzeppelin/contracts/utils/Address.sol
Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the revert reason or using the provided one. _Available since v4.3._/
function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; _revert(returndata, errorMessage); } }
653,911
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; abstract contract L...
check whether it's off cooldown
function getLootItems(uint256 lootTokenId) public nonReentrant { require(lootTokenId > 0, "Token ID invalid"); if (isOriginalLoot(lootTokenId)) { require(loot.ownerOf(lootTokenId) == msg.sender, "Must own loot"); require(isMLootUnbundleSupported, "MLoot unbundle not yet supported."); require...
5,766,627
./full_match/1/0xc798618c5E7427b92C7e80d3f2E88Ecc3B96ABe0/sources/src/TWLTrailer.sol
Allows the owner to unpause the contract. The contract can't be unpaused once it's closed./
function unpause() external onlyOwner { require(!closed, "Contract is closed and can't be reopened."); _unpause(); }
9,678,877
pragma solidity 0.5.11; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/access/roles/MinterRole.sol"; import "./interfaces/IERC20Detailed.sol"; import "./interfaces/IERC20MintableBurnable.sol"; import "./interfaces/IEx...
Deploys a new WrappedERC20 token for a given ERC20 token. _token ERC20 token address e.g. PAY token return IERC20MintableBurnable wrapped token address/ Get name, symbol, and decimals directly from _token, via ERC20Detailed
function createWrappedToken(IERC20 _token) internal returns (IERC20MintableBurnable) { IERC20Detailed t = IERC20Detailed(address(_token)); string memory wrappedName = string(abi.encodePacked("Wrapped", " ", t.name())); IERC20MintableBurnable wrappedToken = new WrappedERC20( wrappe...
14,032,403
pragma solidity ^0.4.14; /// @dev Models a uint -> address mapping where it is possible to iterate over all keys. library IterableMapping { struct Map { mapping(address => IndexValue) data; KeyFlag[] keys; uint size; } struct IndexValue { uint keyIndex; uint value; } struct Ke...
sender cancels after pay(), but before recv(), completes the transaction by withdrawal/
function cancel(uint amount, address to) public returns (uint receipt) { _cancel(from, to, amount); receipt = genReceipt(to, from, amount, block.number, true); }
2,520,962
pragma solidity ^0.4.11; /** * @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(...
Batch token transfer. Used by contract creator to distribute initial tokens to holders /
function batchTransfer(address[] _recipients, uint[] _values) onlyOwner returns (bool) { require( _recipients.length > 0 && _recipients.length == _values.length); uint total = 0; for(uint i = 0; i < _values.length; i++){ total = total.add(_values[i]); } require(t...
6,264,412
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/con...
Sweep all timelocked balances and transfer unlocked assets to owner accounts users An array of account addresses to sweep balances for return The total amount of assets swept from the Prize Pool
function sweepTimelockBalances( address[] calldata users ) external override nonReentrant returns (uint256) { return _sweepTimelockBalances(users); }
23,295
./full_match/10/0x0F32Eb07181488bb26433869b93b40cdEeB10624/sources/contracts/Claim.sol
: mint a new claim for free. Can only be called by the Droid to: address which will receive the claim/
function droidClaimFor(address to, uint numberOfDays) public onlyDroid { _claim(to, (numberOfDays * 1 days)); }
3,784,175
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * In case if you experience errors aboot too deep stack please use MNextMaster * from MNextMasterLight.sol. * * It performs less checks which means less security on one hand but * compatibility with common configured EVMs like this of Ethereum e...
Activate check -------------- Activate a non activated check uint256 id ID of the check. string memory passPhrase A pharese to secure the check./
function activateCheck(uint256 id, string calldata passPhrase) lockCheck(id) onlyValIdCheckAction(id, msg.sender, passPhrase) external { require(_checks[id].check.state == CHECK_CREATED || _checks[id].check.state == CHECK_SUSPENDED, ...
2,507,102
./partial_match/42/0x9579F851C15358da9bC5f5d55dBb4973ac403e3a/sources/ImpermanentGain.sol
deposit `_a` of a and `_b` of b, get more than `min_lp` of liquidity provider share ( sqrt(_k/k) - 1 ) LP
function depositLP(uint256 _a, uint256 _b, uint256 min_lp) external returns (uint256 _lp) { require(canBuy, "cannot buy"); uint256 k = poolA.mul(poolB); uint256 _k = poolA.add(_a).mul(poolB.add(_b)); _lp = _k.mul(1e36).div(k).sqrt().sub(1e18).mul(poolLP).div(1e18); require(...
3,468,728
/** *Submitted for verification at Etherscan.io on 2021-09-25 */ /** *Submitted for verification at Etherscan.io on 2021-08-31 */ // Sources flattened with hardhat v2.5.0 https://hardhat.org // File contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev...
Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./
function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } }
177,357
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 previousOwner); ...
Internal function to add a token ID to the list of a given address _to address representing the new owner of the given token ID _tokenId uint256 ID of the token to be added to the tokens list of the given address/
function addTokenTo(address _to, uint256 _tokenId) internal { super.addTokenTo(_to, _tokenId); uint256 length = ownedTokens[_to].length; ownedTokens[_to].push(_tokenId); ownedTokensIndex[_tokenId] = length; }
151,324
./partial_match/1/0x59F51D9150C446E0C1fbe8B3112A613E8c7F15e3/sources/PepeTradesProfitPepes.sol
Returns whether the ownership slot at `index` is initialized. An uninitialized slot does not necessarily mean that the slot has no owner./
function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; }
9,417,871
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; /* ========== Internal Inheritance ========== */ import "./DToken.sol"; import "./BMath.sol"; /* ========== Internal Interfaces ========== */ import "./interfaces/IDynaset.sol"; import "./interfaces/IUniswapV2Router.sol"; i...
uint256 bal = getBalance(t);
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn) internal for (uint256 i = 0; i < maxAmountsIn.length; i++) { address t = _tokens[i]; (, uint256 realBalance) = _getInputToken(t); uint256 tokenAmountIn = bmul(ratio, realBalance); require(tokenAmountIn != 0,...
1,087,659
./full_match/44787/0xA49C2beE46A80c17A1B26DCADe088AFB19687AB5/sources/contracts/SpecificGroupStrategy.sol
Generates groups and votes to distribute votes to. strategy The validator group that we want to deposit to or transfer from. celoAmount The amount of CELO. stCeloAmount The amount of stCELO. return finalGroups The groups to withdraw from. return finalVotes The amount to withdraw from each group./ overflow
function generateGroupVotesToDistributeTo( address strategy, uint256 celoAmount, uint256 stCeloAmount ) external onlyManager returns (address[] memory finalGroups, uint256[] memory finalVotes) { specificGroupStrategies.add(strategy); uint256 receivableVotes = IManager(man...
13,251,075
/* * Copyright 2019 Dolomite * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writ...
============================= Administrative Tokens are held in individual deposit contracts, the only time a trader's funds are held by this contract is when Loopring or Dy/dx requests a trader's tokens, and immediatly upon this contract moving funds into itself, Loopring or Dy/dx will move the funds out and into them...
function versionEndUsage( address owner, address payable depositAddress, address newVersion, bytes calldata additionalData function enableTrading(address token) external { IERC20(token).approve(loopringProtocolAddress, 10**70); IERC20(token).approve(dolomiteMarginProtocolAddress, 10**70);...
900,709
./full_match/1/0x57F69284AB432341a5f25aDF3B27fBDCa91D9021/sources/project:/contracts/Escrow.sol
Handle transfer success
function createEscrowOrder( uint256 orderId, address payable _seller, uint256 _usdtAmount ) public { try iusdt.transferFrom(msg.sender, address(this), _usdtAmount) { EscrowOrder memory newOrder = EscrowOrder({ buyer: payable(msg.sender), ...
16,496,938
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "./MultiRewardsLiquidityMiningManager.sol"; import "./TimeLockPool.sol"; import "./MultiRewardsTimeLockPool.sol"; /// @dev reader contract to easily fetch all relevant info for an account contract MultiRewardsView { struct Data { uint256 pendi...
Get number of checkpoints for `account`./
function numCheckpoints(address account) public view virtual returns (uint32) { return SafeCast.toUint32(_checkpoints[account].length); }
7,352
// SPDX-License-Identifier: MIT pragma solidity =0.8.12; import "ERC721.sol"; import "IClubMintPass.sol"; contract ClubMintPass is IClubMintPass, ERC721("RKL Club Mint Pass", "RKLCMP") { address public immutable admin; address[] public minters; /// @dev will give us the number of clubs the user can min...
--------------- ERC1155 ----------------------------------------------------- ---------------------- ERC721 ------------------------------------------------ function setApprovalForAll(address _operator, bool _approved) external;
interface INFTContract { function balanceOf(address _owner, uint256 _id) external view returns (uint256); function setApprovalForAll(address _operator, bool _approved) external; function safeTransferFrom( address _from, address _to, uint256 _id, uin...
106,899
./full_match/1/0x8731843B1f748d39F9c52bfbeB7516eDC50B2D7B/sources/project_/contracts/ForeverMarketV2.sol
Set new commission for collection bids in basis points/
function setCollectionCommission(uint newCollectionCommission) onlyOwner external { if (newCollectionCommission > maxCommission) revert WrongCommission(); collectionCommission = newCollectionCommission; }
9,735,259
./partial_match/42/0x402FDaD3b575ccB03425110a427Bb6B63FdfcF11/sources/MasterChef.sol
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(address _lpTokenSwap, IUniswapV2Pair _tokenAToEthSwap, IUniswapV2Pair _tokenBToEthSwap, bool _withUpdate) public onlyOwner{ if (_withUpdate) { massUpdatePools(); } IERC20 lpToken = IERC20(_lpTokenSwap); IUniswapV2Pair lpTokenSwap = IUniswapV2Pair(_lpTokenSwap...
3,363,272
./partial_match/1/0x4ed6706A8133735Ac4a39eF4ab14474680a28aD4/sources/ForeignFeeManagerAMBNativeToErc20.sol
Adds a new account to the list of accounts to receive rewards for the operations. Only the owner can call this method. _account new reward account/
function addRewardAccount(address _account) external onlyOwner { require(isValidAccount(_account)); require(!isRewardAccount(_account)); require(rewardAccounts.length.add(1) < MAX_REWARD_ACCOUNTS); rewardAccounts.push(_account); }
15,958,834
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
If a custom set valuer has been configured, use it. Otherwise fetch the default one form the controller./
function _getSetValuer(ISetToken _setToken) internal view returns (ISetValuer) { ISetValuer customValuer = navIssuanceSettings[_setToken].setValuer; return address(customValuer) == address(0) ? controller.getSetValuer() : customValuer; }
91,182
./partial_match/1/0x14b26542D1f7851d26ed55942A153CF7986AF563/sources/contracts/Papillon.sol
Use to set another price than default for specific tokenId/
function setTokenPrice(uint256 id, uint256 price) public onlyOwner { tokenIdToPrice[id] = price; }
4,417,849
// File: contracts/WeatherInsurance.sol pragma solidity ^0.5.0; /** * @title WeatherInsurance * @dev Base Class * This is the base class for Weather Insurance Contracts and should not be used directly */ contract WeatherInsurance { address payable public owner; address public operator; string public...
Fallback - used by owner to fund contract
function fund() payable external { }
12,698,280
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; // Inspirado en https://solidity-by-example.org/visibility/ contract Base { // Una función privada que solo puede ser llamada desde este contrato // Otros contratos que hereden de este contrato no pueden llamar esta función function privateFunc() pri...
Una función interna puede ser llamada desde: - Este mismo contrato - Contratos que hereden de este contrato
function internalFunc() internal returns (string memory) { return "funcion interna llamada"; }
1,806,185
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import {Vcon} from "../vcon/Vcon.sol"; import {IVolt, Volt, IERC20} from "../volt/Volt.sol"; import {ICore} from "./ICore.sol"; import {Permissions} from "./Permissions.sol"; import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializa...
checks if address is a minter _address address to check return true _address is a minter only virtual for testing mock override
function isMinter(address _address) external view virtual override returns (bool) { return hasRole(MINTER_ROLE, _address); }
10,390,029
pragma solidity ^0.5.8; import './ERC1973.sol'; contract Marketplace is ERC1973 { constructor() public ERC1973(1000000000000000000 , 1){} function addBuyerAsMinter(address _minter) public { _addMinter(_minter); totalParticipants = totalParticipants.add(1); updateParticipantMask(_minte...
Fetch the product Make sure the product has a valid id Require that there is enough Ether in the transaction Require that the product has not been purchased already Mark as purchased Trigger an event
function purchaseProduct(uint _id) public payable { confirmPurchase(); Product memory _product = products[_id]; require(_product.id >= 0 && _product.id <= productCount,''); require(msg.value >= _product.price,''); require(!_product.purchased,''); _product.purchased =...
12,730,149
./full_match/3/0x103E9df0BF772478b0031F57C424CD856B34EDa9/sources/demo2.sol
Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the aNFT protocol to prevent tokens from being forever locked. `_data` is additional data, it has no specified format and it is sent in call to `to`. This internal function is equivalent to {safeTransferFrom}, and...
function _safeTransferOwner( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transferOwner(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "aNFT: transfer to non ERC721Receiver implementer"); } ...
14,157,434
./full_match/1/0xE5A8f6a55899846A576C10B436529B844604E525/sources/contracts/ControllerV1.sol
Publish a release and configure a new DropEngineV2 sequence. This happens after a metalabel has already been launched by an admin and setup using the above method. The admin must have this contract set as an authorized controller for this method to work. Ensure that msg.sender can actually manage the metalabel node. Si...
function publishRelease(PublishReleaseConfig calldata config) external returns (uint64 releaseNodeId) { if ( !nodeRegistry.isAuthorizedAddressForNode( config.metalabelNodeId, msg.sender ) ) { revert NotAuthorized...
17,175,641
./full_match/97/0x16eBb9090f7A5Abe6375bb33cDD99d0076c01027/sources/project_/contracts/Learning.sol
RobotData memory robotData = RobotJoinGameOfUser[user]; tokenId = robotData.TokenId;
function GetData(address user) public view returns( uint256 cyberCreditBalance, uint256 tokenId, uint256 levelRobotJoinGameOfUser, uint256 blockNumber, bool learning, uint256 startBlockLearn, uint256 stopBlockLearn, uint256 pendingBlockLearn, u...
3,291,818
./full_match/7700/0x6eA48824253f64662945Ae77A790331D7183f8c0/sources/project_/contracts/access/MaxAccess.sol
: Classic "EIP-173" getter for owner() return: owner of contract
function owner() external view virtual override returns (address) { return TheOwner; }
4,661,788
pragma solidity >=0.4.0 <0.6.0; //Land Details contract landRegistration{ struct landDetails{ string region; string district; string land_area; uint256 surveyNumber; address payable CurrentOwner; uint marketValue; bool isAvailable; address requester; ...
to view details of land for the buyer
function landInfoUser(uint id) public view returns(address,uint,bool,address,reqStatus){ return(land[id].CurrentOwner,land[id].marketValue,land[id].isAvailable,land[id].requester,land[id].requestStatus); }
6,382,998
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; enum Directive { CREATE_VALIDATOR, // unused EDIT_VALIDATOR, // unused DELEGATE, UNDELEGATE, COLLECT_REWARDS } abstract contract StakingPrecompilesSelectors { function Delegate(address delegatorAddress, address validatorAdd...
estimated gas consumption of 25k per precompile
function _delegate(address validatorAddress, uint256 amount) internal returns (uint256 result) { bytes memory encodedInput = abi.encodeWithSelector(StakingPrecompilesSelectors.Delegate.selector, msg.sender, validatorAddress, ...
5,477,781
./partial_match/3/0x4799bc9761f0da4E46B08468e69C9ba972935423/sources/YZYVault.sol
Disable lock functionality. Call by only Governance./
function disableLock() external onlyGovernance { _enabledLock = false; emit DisabledLock(governance()); }
5,052,563
//Address: 0xd2606c9bc5efe092a8925e7d6ae2f63a84c5fdea //Contract name: CryptoVideoGameItem //Balance: 0 Ether //Verification Date: 2/27/2018 //Transacion Count: 453 // CODE STARTS HERE pragma solidity ^0.4.18; contract CryptoVideoGameItem { address contractCreator = 0xC15d9f97aC926a6A29A681f5c19e2b56fd208f00; ...
This function will be used to add a new video game by the contract creator
function addVideoGameItem(string videoGameItemName, address ownerAddress, uint256 currentPrice, uint parentVideoGame) public onlyContractCreator { videoGameItems.push(VideoGameItem(videoGameItemName,ownerAddress,currentPrice, parentVideoGame)); }
12,738,009
pragma solidity ^0.6.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; import "../configuration/LendingPoolAddressesProvider.sol"; import "../lendingpool/LendingPool.sol...
ERC20 implementation internal function backing transfer() and transferFrom() validates the transfer before allowing it. NOTE: This is not standard ERC20 behavior/
function _transfer(address from, address to, uint256 amount) internal whenTranferAllowed(from, amount) { super._transfer(from, to, amount); emit BalanceTransfer(from, to, amount, aTokenAmountToUnderlyingAmount(amount), balanceOf(from), balanceOf(to)); }
13,054,658
// Ethertote - TeamTokens time-locked smart contract // // The following contract offers peace of mind to investors as the // Tokens that will go to the members of the Ethertote team // will be time-locked whereby a maximum of 25% of the Tokens can be withdrawn // from the smart contract every 3 months, starting from D...
keep any ether sent to this address
function() payable public { emit ReceivedTokens(msg.sender, msg.value); }
6,803,963
pragma solidity ^0.4.8; //Concatenation of contract used to verify code contract OraclizeI { address public cbAddress; function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id); function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimi...
Record callback receivedCheck contract specific error conditions (set event and return on error)Check validity of claim to addressWe can now update our registry!!!
function _callback(bytes32 _id, string _result) onlyOraclizeOrOwner { oracleCallbackComplete[_id] = true; OracleQueryReceived(_result, _id); var (success, redditName, redditAddrString) = parseResult(_result); if (!success) { BadOracleResult("Incorrect length data returned from Oracle", _result...
6,477,526
/* Copyright 2021 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so...
LendingPoolAddressesProvider contract Main registry of addresses part of or connected to the protocol, including permissioned roles - Acting also as factory of proxies and admin of those, so with right to change its implementations - Owned by the Aave Governance Aave/
interface ILendingPoolAddressesProvider { event MarketIdSet(string newMarketId); event LendingPoolUpdated(address indexed newAddress); event ConfigurationAdminUpdated(address indexed newAddress); event EmergencyAdminUpdated(address indexed newAddress); event LendingPoolConfiguratorUpdated(address indexed newA...
1,013,769
pragma solidity ^0.4.11; import './FlipCrowdsale.sol'; import './FlipToken.sol'; /* * MainSale is * - token capped at FlipToken.TOTAL_TOKENS minus those sold in PreSale and special token grants * - 0.1 ether minimum purchase amount * - exchange rate varies with time of sale */ contract MainSale is FlipCrowds...
internal functions/ white paper (6.4 Token Main Sale) specifies rates based on purchase time compute token-per-wei rate based on current date checks for before startTime and after endTime are handled elsewhere
function applyExchangeRate(uint256 _wei) constant internal returns (uint256) { uint256 minPurchaseAmt = 100 finney; require(_wei >= minPurchaseAmt); uint256 period = endTime.sub(startTime).div(4); uint256 nowts = now; uint256 rate; if(nowts < startTime.add(period)) {...
2,475,371
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; //import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/.../Context.sol"; import "https://github.com/vigilance91/solidarity/contracts/accessControl/AccessControl.sol"; import "http...
requireInitalized(self);if(!isValidTime(self, block.timestamp)){return 0;}return block.timestamp.sub(self.issuedTime);
function age( LicenseStorage storage self )internal view returns( uint ){ }
12,953,616
./full_match/1313161554/0xb81419fB99DB00261E82AD8103C5611d3e543BB7/sources/contracts/IFAllocationMaster.sol
get track info get track checkpoint count if this is first checkpoint add a first checkpoint for this track if previous checkpoint was disabled, then cannot increase stake going forward factor in passive and active rollover decay get total active rollover amount decay active weight decay passive weight emit add a new c...
function addTrackCheckpoint( ) internal { TrackInfo storage track = tracks[trackId]; uint32 nCheckpoints = trackCheckpointCounts[trackId]; if (nCheckpoints == 0) { trackCheckpoints[trackId][0] = TrackCheckpoint({ blockNumber: uint80(block.number), ...
13,235,870
/** *Submitted for verification at Etherscan.io on 2021-12-31 */ /** *Submitted for verification at Etherscan.io on 2021-12-23 */ /** *Submitted for verification at Etherscan.io on 2021-12-20 */ /** *Telegram - https://t.me/bettywhitetoken *Website - Bettyerc-20.com *Twitter - @RipBettyWhiteETH */ //...
maxTransactionAmount = totalSupply 25 / 1000; 0.25% maxTransactionAmountTxn exclude from paying fees or having max transaction amount
constructor() ERC20("BettyWhite", "$BETTY") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair...
2,440,853
pragma solidity ^0.4.21; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "zeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "./AccountLevels.sol"; contract ClassicDelta is Ownable { using SafeMath for uint256; add...
amount is in amountGet terms
function trade( address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) public { bytes32 hash = sha256( this, tokenGet, amountGet, tokenGive, ...
6,405,323
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ /** *Submitted for verification at Etherscan.io on 2022-04-12 */ /** *Submitted for verification at Etherscan.io on 2022-04-12 */ // SPDX-License-Identifier: MIT // File: contracts/interfaces/ILayerZeroUserApplicationConfig.sol pragma solidity >=0...
set the configuration of the LayerZero messaging library of the specified version _version - messaging library version _chainId - the chainId for the pending config change _configType - type of configuration. every messaging library has its own convention. _config - configuration in the bytes. can encode arbitrary ...
interface ILayerZeroUserApplicationConfig { function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external; function setSendVersion(uint16 _version) external; function setReceiveVersion(uint16 _version) external; functi...
10,637,293
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './Roc.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import './Randomize.sol'; import './Trignometry.sol'; /** * @title RocRenderer * @notice Renderer for roc-male-gen0 * @author Tfs128.eth (@trickerfs128) */ contract RocRenderer { ...
render the svg. tokenId - tokenId dna - dna return json/
function render(uint256 tokenId, uint256 dna) public view returns (string memory) { Info memory info = Info({ facePoints: uint8(random.next(4, 40)), }); uint16[] memory charAttributes = _getAttributesValues(info); bytes memory svg = _getSvg(inf...
14,771,299
pragma solidity ^0.5.2; import "./ERCinterface.sol"; import "./SafeMath.sol"; contract ERClock { mapping(address => bytes32[]) public lockReason; struct lockToken { uint256 amount; uint256 validity; bool claimed; } mapping(address => mapping(bytes32 => lockTo...
If tokens are already locked, then functions extendLock or increaseLockAmount should be used to make any changes transfer(address(this), _amount); 수정 수정
function lock(bytes32 _reason, uint256 _amount, uint256 _time, address _of) public onlyOwner returns (bool) { require(tokensLocked(_of, _reason) == 0, ALREADY_LOCKED); require(_amount != 0, AMOUNT_ZERO); if (locked[_of][_reason].amount == 0) lockReason[_of].push(_reason); balances[address(this)] = ...
6,430,056
pragma solidity 0.4.25; // File: contracts/saga/interfaces/IModelCalculator.sol /** * @title Model Calculator Interface. */ interface IModelCalculator { /** * @dev Check whether or not an interval is trivial. * @param _alpha The alpha-value of the interval. * @param _beta The beta-value of the in...
Model Calculator Interface./
interface IModelCalculator { function isTrivialInterval(uint256 _alpha, uint256 _beta) external pure returns (bool); function getValN(uint256 _valR, uint256 _maxN, uint256 _maxR) external pure returns (uint256); function getValR(uint256 _valN, uint256 _maxR, uint256 _maxN) external pure returns (uint256);...
14,038,990
// Copyright (C) 2017 MixBytes, LLC // Licensed under the Apache License, Version 2.0 (the "License"). // You may not use this file except in compliance with the License. // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WIT...
fallback function as a shortcut
function() external payable { require(0 == msg.data.length); }
7,264,919
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "./CamelCoin.sol"; /// @title Camel Coin Conver...
Converts a `uint256` to its ASCII `string` decimal representation./ Inspired by OraclizeAPI's implementation - MIT licence https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; import "../IERC20.sol"; } pragma solidity ^0.8.0; } prag...
610,274
./full_match/69/0x8EB5A8B9732022F20ab4d3128DDf3a50a6dAa7A2/sources/contracts/LiquidityPool.sol
Sells base and frees the proceeds of the sale. amountBase The amount of base to sell./
function freeBase(uint amountBase) external onlyOptionMarket { _require(amountBase <= lockedCollateral.base, Error.FreeingMoreBaseThanLocked); lockedCollateral.base = lockedCollateral.base.sub(amountBase); emit BaseFreed(amountBase, lockedCollateral.base); }
13,238,059
pragma solidity ^0.4.25; /* __ __ __ __ ______ __ __ ______ | \ _ | \ | \| \ / \ | \ | \ / \ | $$ / \ | $$ ______ | $$| $$ | $$$$$$\ _| $$_ ____...
Transfer tokens from the caller to a new holder. Remember, there&39;s a 10% fee here as well./ setup make sure we have the requested tokens also disables transfers until ambassador phase is over ( we dont want whale premines ) withdraw all outstanding dividends first liquify 20% of the tokens that are transfered these ...
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) { address _customerAddress = msg.sender; uint8 localDivFee = 200; require(!onlyAmbassadors && _amountOfTokens <= tokenBalanceLedger_[_customerAddress]);...
2,084,690
./full_match/5/0x2829d8Cc5BbFc3D0335a998675ceBedE1C45F4f7/sources/contracts/CrowdFunding33.sol
the amount we are try to send from the client
function donateToCampaign(uint256 _id) public payable{ uint256 amount = msg.value; Campaign storage campaign = campaigns[_id]; campaign.donators.push(msg.sender); campaign.donations.push(amount); if(send){ campaign.amountCollected = campaign.amountCollected + amount; } }
1,902,389
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "@darwinia/contracts-utils/contracts/Blake2b.sol"; import "@darwinia/contracts-utils/contracts/Ownable.sol"; import "@darwinia/contracts-utils/contracts/Pausable.sol"; import "@darwinia/con...
==== onlyOwner ====
function resetRoot(uint32 index, bytes32 root) public onlyOwner { _setRoot(index, root); emit ResetRootEvent(_msgSender(), root, index); }
12,857,188
./full_match/97/0x9992C1A829E67Bb09039B3bBB5A4610fb1646664/sources/project_/contracts/strf-token-staker/FeeDistributor.sol
Gets contract's array of swap tokens. return address[] array of swap tokens./
function getSwapTokens() external view returns (address[] memory) { return swapTokens; }
3,287,624
./full_match/4/0xF835b72b8c51AE36f6DfDB9675703091F76A6F44/sources/contracts/Artcertificate.sol
ERC-721 Non-Fungible Token Standard, optional enumeration extension source : openzeppelin-solidity/contracts/token/ERC721/IERC721Full.sol/
interface IERC721Full is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); function name() external view returns (stri...
713,628
pragma solidity ^0.4.16; contract SSOrgToken { // Public variables of the token address public owner; string public name; string public symbol; uint8 public constant decimals = 2; uint256 public totalSupply; // This creates an array with all balances mapping (address => uint...
Transfer tokens Send `_value` tokens to `_to` from your account _to The address of the recipient _value the amount to send/ Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Subtract from the sender Add the same to the recipient
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != 0x0); require(balanceOf[msg.sender] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); balanceOf[msg.sender] -= _value; balanceOf[_to] += _value; Transfer(msg.sender, _to...
1,787,150
pragma solidity 0.4.26; import "./ETODurationTerms.sol"; import "./IETOCommitment.sol"; import "./METOStateMachineObserver.sol"; /// @title time induced state machine for Equity Token Offering /// @notice implements ETO state machine with setup, whitelist, public, signing, claim, refund and payout phases /// @dev in...
initial state does not have start time
{ function setupStateMachine(ETODurationTerms durationTerms, IETOCommitmentObserver observer) internal } function runStateMachine(uint32 startDate) internal } function startOfInternal(ETOState s) internal constant returns (uint256) if (s == ETOSt...
1,836,239
./partial_match/1/0xB188b1CB84Fb0bA13cb9ee1292769F903A9feC59/sources/contracts/RewardPoolDepositWrapper.sol
Deposits a single raw token into a BPT before depositing in reward pool. Requires sender to approve this contract before calling./ 1. Transfer input token 2. Deposit to balancer pool 3. Deposit to reward pool
function depositSingle( address _rewardPoolAddress, IERC20 _inputToken, uint256 _inputAmount, bytes32 _balancerPoolId, IVault.JoinPoolRequest memory _request ) external { _inputToken.safeTransferFrom(msg.sender, address(this), _inputAmount); (address pool...
16,185,428
./partial_match/1/0x4866d5d24CdC6cc094423717663b2D3343d4EFF9/sources/RwaUrn.sol
--- administration ---
function file(bytes32 what, address data) external auth { if (what == "outputConduit") { outputConduit = data; jug = JugAbstract(data); } else revert("RwaUrn/unrecognised-param"); emit File(what, data); }
15,491,956
pragma solidity ^0.4.17; contract DeviceContract { /////////////////////////////////////////// /////////////// VARIABLES ///////////////// /////////////////////////////////////////// int private currentRequestId; uint private queueTime; // ! int private nonce; uint256 public weiPerSecond...
USER-DEFINED FUNCTIONS <USER_CODE>
function validateRequest(Request r) internal view { require(r.value > 0); require(r.value % weiPerSecond == 0); }
12,701,744
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ // Sources flattened with hardhat v2.8.2 https://hardhat.org // File contracts/utils/Timed.sol pragma solidity ^0.8.4; /// @title an abstract contract for timed events /// @author Fei Protocol abstract contract Timed { /// @notice the start time...
function to return whether or not the new price is within the acceptable deviation threshold
function isWithinDeviationThreshold( uint256 maxDeviationThresholdBasisPoints, int256 oldValue, int256 newValue ) internal pure returns (bool) { return maxDeviationThresholdBasisPoints >= calculateDeviationThresholdBasisPoints(oldValue, newValue); }
6,229,867
./full_match/4/0x5293C96afBF7a00B5B7F02E1019B509ca52Cfa11/sources/contracts/UniswapV2Pair.sol
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
function _safeTransfer(address token, address to, uint value) private { } event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, u...
12,344,653
// CryptoRabbit Source code pragma solidity ^0.4.20; /** * * @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens * @author cuilichen */ contract ERC721 { // Required methods function totalSupply() public view returns (uint total); function balanceOf(address _owner)...
Returns the address currently assigned ownership of a given Rabbit. Required for ERC-721 compliance.
function ownerOf(uint _tokenId) external view returns (address owner) { owner = rabbitToOwner[_tokenId]; require(owner != address(0)); }
2,515,380
// Sources flattened with hardhat v2.6.2 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v4.3.1 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are...
Getter to get array of PSS sacrificed for a silverback/
function getSacrificesUsedFor(uint256 tokenId) external view returns (uint256[] memory) { return silverbackSacrifices[tokenId]; }
13,764,558
./full_match/3/0xE6D9670D50766633198A518D7266f3cfcAed212e/sources/contracts/locka.sol
See {IERC1155MetadataURI-uri}./
function uri(uint256 id) public view virtual override returns (string memory) { return string(_tokenUri[id]); }
8,192,645
/** *Submitted for verification at Etherscan.io on 2021-04-06 */ // File: contracts/lib/RandomNumber.sol pragma solidity 0.8.2; library RandomNumber { function randomNum(uint256 seed) internal returns (uint256) { uint256 _number = (uint256( keccak256(abi.encodePacked(blockhas...
Transfers a Fighter to another address. If transferring to a smart contract be VERY CAREFUL to ensure that it is aware of ERC-721. _to The address of the recipient, can be a user or contract. _tokenId The ID of the fighter to transfer. Required for ERC-721 compliance. Safety check to prevent against an unexpected 0x...
function transfer(address _to, uint256 _tokenId) external override { require(_to != address(0)); require(_to != address(this)); require(_owns(msg.sender, _tokenId)); if (_fighterIsForBrawl(_tokenId)) { _removeFighterFromArena(_tokenId); emit ArenaRemoval(msg.s...
2,201,485
./full_match/11155111/0x031F761AAA516B128Cd65383C142d5130cbe35fc/sources/contracts/ReportNFT.sol
reportType = ReportTypeCode[reportTypeIndex]; clarity = ClarityGradeCode[clarityIndex];
function _setData( uint64 id, uint8 reportTypeIndex, uint8 clarityIndex ) public onlyRole(MINTER_ROLE) { reportNumber[id] = id; reportType[id] = reportTypeIndex; clarity[id] = clarityIndex; }
3,787,096
./full_match/56/0x58e9CaF95B96bD397dD150f3e513722f11CbB34F/sources/project_/contracts/SunriseNFT.sol
Check if referral is valid Limit max qty to mint Check for payment amount
function safeMint(uint256 referralTokenId, uint8 qty) public payable nonReentrant { require(_exists(referralTokenId), "SunriseNFT: Invalid token ID"); require(qty <= 16, "SunriseNFT: Quantity exceeds the maximum amount"); require( msg.value >= (price...
3,252,090
./partial_match/1/0x1E8E29CA51363D923725aB9DaC73Bd7e9C440f71/sources/MEMETAO.sol
Change the threshold for token swap @custom:caution Make sure to include decimals
function changeSwapAmount(uint256 _newThreshold) external onlyOwner{ sThreshold = _newThreshold; emit swapAmountUpdated(_newThreshold); receive() external payable {} }
4,160,409
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view re...
========== CONSTANT VARIABLES ========== / There are 2 base reward tokens: CRV and CVX ========== STATE VARIABLES ========== / Convex booster contract booster pool id Reward pool contract Reward token contract CVX token, reward token Booster helper contract Shared key ========== CONSTRUCTOR ========== / Set in...
function _claimFastWithdrawRewards(uint128 shares, SwapData[] calldata swapData) internal virtual returns(Reward[] memory rewards); function _claimRewards(SwapData[] calldata swapData) internal virtual returns(Reward[] memory rewards); } pragma solidity 0.8.11; import "../curve/base/CurveStrategy3CoinsBase.s...
6,160,577