file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/137/0x947aC276763257c68c82cF30622BC4F4F804C027/sources/contracts/Wallet.sol
amountIn should be in terms of the token from which we are swapping
function swapExactInputSingle(address _returnBaseToken, address _tokenIn, uint256 _amountIn) internal returns (uint256 amountOut) { ISwapRouter.ExactInputSingleParams memory params = ISwapRouter .ExactInputSingleParams({ tokenIn: _tokenIn, toke...
3,751,335
pragma solidity >=0.5.4 <0.6.0; interface tokenRecipient { function RECEIVEAPPROVAL172(address _from, uint256 _value, address _token, bytes calldata _extraData) external; } //inject NONSTANDARD NAMING library SafeMath { ...
inject NONSTANDARD NAMING
function TRANSFERETH144(address payable _recipient, uint256 _amount) public ONLYVAULT404 returns (bool) {
13,026,367
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import '@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol'; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.so...
Cheaper without "no division by 0" check Cheaper without "no division by 0" check Stack tokens to be swapped for autoselling
function applyTaxes(address sender, uint amount, uint8 tax) internal returns (uint newAmountTransfer) { uint amountTax = amount * tax; uint amountAutoLiquidity = amount * autoLiquidityFees; unchecked { amountTax /= 100; amountAutoLiquidity /= 100; } n...
5,382,519
// File: contracts/ComptrollerInterface.sol pragma solidity 0.5.17; contract ComptrollerInterface { /// @notice Indicator that this is a Comptroller contract (for inspection) bool public constant isComptroller = true; /*** Assets You Are In ***/ function enterMarkets(address[] calldata cTokens) exte...
If the redeemer is not 'in' the market, then we can bypass the liquidity check /
function redeemAllowedInternal(address gToken, address redeemer, uint redeemTokens) internal view returns (uint) { if (!markets[gToken].isListed) { return uint(Error.MARKET_NOT_LISTED); } if (!markets[gToken].accountMembership[redeemer]) { return uint(Error.NO_ERROR)...
598,555
./partial_match/1/0x08E1451D4f34cD67E9b4647bCcb251483EeeC6D7/sources/MultiSigStub.sol
ERC23 Token fallback _from address incoming token _amount incoming amount/
function tokenFallback(address _from, uint _amount, bytes _data) public { _deposited(_from, _amount, msg.sender, _data); }
9,309,977
./partial_match/3/0xfAb28Aac8A4b70de52E1cDcc9858360aBB8e6B37/sources/Dice.sol
Check Game Players Balance Initialize the balance of players Emit events of this game
function playDiceGame( address[] memory playerList, uint256[] memory playerScoreList, uint256 playAmount, uint256 gameLength ) public payable onlyOwner returns (bool) { for (uint256 i = 0; i < gameLength; i++) { require( _playerETHBalance[playe...
5,295,938
./full_match/1/0xcafea44b2cd8b35Ff4cd86b9E58D8D0d098b8cDC/sources/contracts/modules/staking/StakingProducts.sol
globalMinPriceRatio /, initialPriceRatios /, capacityReductionRatios /
function recalculateEffectiveWeights(uint poolId, uint[] calldata productIds) external { IStakingPool stakingPool = getStakingPool(poolId); ( uint globalCapacityRatio, uint[] memory capacityReductionRatios ) = ICover(coverContract).getPriceAndCapacityRatios(productIds); uint _totalEffec...
4,831,765
// SPDX-License-Identifier: MIT /* ██████╗ ███████╗██████╗ █████╗ ███████╗███████╗ ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║█████╗ ██████╔╝███████║███████╗█████╗ ██║ ██║██╔══╝ ██╔══██╗██╔══██║╚════██║██╔══╝ ██████╔╝███████╗██████╔╝██║ ██║███████║███████╗ ╚═════╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝╚══════...
Function to set the share of the epoch reward to be given out to treasury multiSigRewardShare_ New multiSig reward share in 5s/
function setMultiSigRewardShare(uint256 multiSigRewardShare_) external onlyOwner { multiSigRewardShare = multiSigRewardShare_; emit LogSetMultiSigRewardShare(multiSigRewardShare); }
1,329,943
pragma solidity ^0.4.20; /** * @title SafeMath * @dev Math operations with safety checks that throw on error **/ library SafeMathLib{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 ...
Revoke signature through a delegate. _signature The signature allowing this revocation. _sigToRevoke The signature that you would like revoked. _gasPrice The amount of token wei to be paid for each uint of gas./
function revokeSignaturePreSigned( bytes _signature, bytes _sigToRevoke, uint256 _gasPrice) public validPayload(356) returns (bool) { uint256 gas = gasleft(); address from = recoverRevokeHash(_signature, _sigToRevoke, _gasPrice); require(!invalidSi...
6,343,406
./partial_match/1/0x8B4953DCCd3EE51DA1E146fd8FecA4C21458238C/sources/Vault.sol
Execute update of strategist fee (with time delay enforced). Needs to be called after the update was prepraed. Fails if called before time delay is met. return New strategist fee./
function executeStrategistFee() external returns (uint256) { uint256 newStrategistFee = _executeUInt256(_STRATEGIST_FEE_KEY); _checkFeesInvariant(getReserveFee(), newStrategistFee); return newStrategistFee; }
4,339,093
./partial_match/1/0x1672Bb1a2C3ec0FE36D6bec12c0A21d307cEe0D3/sources/contracts/Strange.sol
enforce a per-address lifetime limit based on the mintBalances mapping opensea proxy LINK
{ using Strings for uint256; using ECDSA for bytes32; uint128 internal MAX_SUPPLY = 10000; uint128 public PUBLIC_MINT_LIMIT = 10; uint128 public PRESALE_MINT_LIMIT = 5; uint128 public PRESALE_PRICE = 0.08 ether; uint128 public PUBLIC_PRICE = 0.09 ether; bool public publicWalletLimit = ...
3,950,431
./partial_match/1/0xC7176620daf49A39a17FF9A6C2DE1eAA6033EE94/sources/src/v0.8/vendor/openzeppelin-solidity/v4.8.0/utils/structs/EnumerableMap.sol
Adds a key-value pair to a map, or updates the value for an existing key. O(1). Returns true if the key was added to the map, that is if it was not already present./
function set( AddressToUintMap storage map, address key, uint256 value ) internal returns (bool) { return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value)); }
15,916,960
// SPDX-License-Identifier: Unlicense pragma solidity >=0.7.6; import './NutBerryEvents.sol'; /// @notice The Layer 2 core protocol. // Audit-1: ok contract NutBerryCore is NutBerryEvents { /// @dev Constant, the maximum size a single block can be. /// Default: 31744 bytes function MAX_BLOCK_SIZE () public view...
Highest not finalized block
function pendingHeight () public view returns (uint256 ret) { uint256 key = _PENDING_HEIGHT_KEY(); assembly { ret := sload(key) } }
12,776,890
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (stri...
Safely mints `tokenId` and transfers it to `to`. Requirements: - `tokenId` must not exist. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event./
function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); }
351,973
./full_match/1/0x533E0eDbE7d2D0fBf4C4d2acb95Aee6EE137Fd8e/sources/OriginStrategy.sol
Swap rewards via the paraswap router. srcToken The token to swap. destToken The token to receive. srcAmount The amount of tokens to swap. minDestAmountOut The minimum amount of tokens out we expect to receive. callData The callData to pass to the paraswap router. Generated offchain./
function _swap( IERC20 srcToken, IERC20 destToken, uint256 srcAmount, uint256 minDestAmountOut, bytes memory callData ) internal { require(ITokenRegistry(_tokenRegistry).getSupportedToken(address(srcToken)), "invalid token"); require(ITokenRegistry(_tokenR...
16,398,557
./full_match/4/0xB34756f8D9682ab6C26F77f9461207a65c52c8bC/sources/contracts/IVaultHandler.sol
ERC165 Standard for support of interfaces _interfaceId bytes of interface return bool/
function supportsInterface(bytes4 _interfaceId) external pure override returns (bool) { return (_interfaceId == _INTERFACE_ID_IVAULT || _interfaceId == _INTERFACE_ID_ERC165); }
12,419,686
./full_match/7700/0x506415E051ffE59C82a4C2bA8BB6e30eB7917873/sources/src/lib/SSTORE_PIXELS_MAPPED.sol
check if Unique, if so, return skip if 0xFF (blank)
function fetchPixelArray(uint88 dna) public view returns (bytes memory) { if(uint8(dna>>80) != 255) { bytes memory uniquesPixels = SSTORE2Map.read(traitsMap[CATEGORY.UNIQUES][uint8(dna>>80)].name); uint16 offset = traitsMap[CATEGORY.UNIQUES][uint8(dna>>80)].firstPixel; u...
4,656,391
pragma solidity >=0.5.5 <0.6.0; pragma experimental ABIEncoderV2; ...
inject NONSTANDARD NAMING
function CALLOPTIONALRETURN165(IERC20 token, bytes memory data) private {
7,293,352
/* * This code has not been reviewed. * Do not use or deploy this code before reviewing it personally first. */ pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "erc1820/contracts/ERC1820Client.sol";...
Not a real interface but added here since 'granularity' doesn't belong to IERC1400
interface IERC1400Extended { function granularity() external view returns(uint256); pragma solidity ^0.5.0; }
13,089,729
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol
Reads the int112 at `mPtr` in memory.
function readInt112( MemoryPointer mPtr ) internal pure returns (int112 value) { assembly ("memory-safe") { value := mload(mPtr) } }
8,452,157
./partial_match/3/0x6aa269b701E9666Fe5314ec6deB2B907cDE1A8b2/sources/LDBToken.sol
Transfers are allowed only after the end of minting
function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(wasMintingFinished(), "cant transfer before minting finishes"); return super.transferFrom(_from,_to,_value); }
5,218,521
./full_match/1/0xe4F5D08522fc6b8a84f242220181d15e1fd16526/sources/contracts/minter-suite/Minters/MinterDAExpV4.sol
Auction Functions Sets auction details for project `_projectId`. _projectId Project ID to set auction details for. _auctionTimestampStart Timestamp at which to start the auction. _priceDecayHalfLifeSeconds The half life with which to decay the price (in seconds). _startPrice Price at which to start the auction, i...
function setAuctionDetails( uint256 _projectId, uint256 _auctionTimestampStart, uint256 _priceDecayHalfLifeSeconds, uint256 _startPrice, uint256 _basePrice ) external { _onlyArtist(_projectId); ProjectConfig storage _projectConfig = projectConfig[_projectI...
9,744,555
contract EtherTopDog { // fund for bailing out underdogs when they are pushed out uint private bailoutBalance = 0; // === Underdog Payin Distribution: === // percent of underdog deposit amount to go in bailout fund uint constant private bailoutFundPercent = 70; // percent of underdog deposit that...
take out vizionDog fee payout previous top dog send buy fee (plus previous collected underdog fees) to visionDog record a price floor for underdog markup decay calculation during the next round: the mininum purchase price before buyout set the initial minimum buy price for the next top dog the price ceiling for calcula...
function buyTopDog(uint buyprice, uint surplus) private { uint vfee = buyprice * visionDogBuyPercent / 100; uint dogpayoff = (buyprice - vfee); topDog.send(dogpayoff); visionFees += vfee; visionDog.send(visionFees); visionFees = 0; topDogPriceFloor = topDogMinPrice; topDogMinPrice = msg.value * ...
15,787,469
./full_match/41/0x4c0E2d50A0B65c59E0a1d22067d0821761D1aE7e/sources/contracts/IceCreamZombies.sol
use vesting from snapshotV1
function importNftsFromV1(NftInfo[] calldata snapshotV1) external onlyOwner() { uint256 totalAmountToStake; for (uint256 i = 0; i < snapshotV1.length; i++) { NftInfo calldata nft = snapshotV1[i]; if (nft.amountStaked > 0) { uint256 newAmountStaked = nft.amount...
16,378,009
./partial_match/56/0xD02DDb9d82467EaF3FE853448CdD20950366a89B/sources/MasterChef.sol
Safe tap transfer function, just in case if rounding error causes pool to not have enough TAPs.
function safeTapTransfer(address _to, uint256 _amount) internal { uint256 tapBal = tap.balanceOf(address(this)); if (_amount > tapBal) { tap.transfer(_to, tapBal); tap.transfer(_to, _amount); } }
11,132,980
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018-2020 Crossbar.io Technologies GmbH and contributors. // // 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 ...
Get the n-th market owned by the given member.
function getMarketsByOwner(address owner, uint index) public view returns (bytes16) { return marketsByOwner[owner][index]; }
2,572,577
pragma solidity ^0.4.18; /// @title Ownable contract contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner);...
Remove an address from whitelist addr Address to be removed from whitelist
function unwhitelist(address addr) public onlyOwner { require(whitelisted[addr]); whitelisted[addr] = false; }
12,763,013
// SPDX-FileCopyrightText: 2021 ShardLabs // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/I...
Send funds to StMATIC contract and mints StMATIC to msg.sender Requires that msg.sender has approved _amount of MATIC to this contract _amount - Amount of MATIC sent from msg.sender to this contract return Amount of StMATIC shares generated/
function submit(uint256 _amount) external override whenNotPaused returns (uint256) { require(_amount > 0, "Invalid amount"); if (submitHandler) { require( _amount + getTotalPooledMatic() <= submitThreshold, "Submit thre...
5,895,436
//Before life even began, before even the cosmos took shape, there was Light ... and Void. In the form of a boundless prismatic sea, the Light swelled across all existence. The ocean of Light was dynamic and ever shifting. Yet as it expanded, some of its energies faded and dimmed, leaving behind pockets of cold nothing...
useful for buybacks or to reclaim any BNB on the contract in a way that helps holders. generate the uniswap pair path of weth -> eth make the swap
function buyTokens(uint256 bnbAmountInWei, address rewardToken) internal { address[] memory path = new address[](2); path[0] = uniswapV2Router.WETH(); path[1] = rewardToken; path, address(this), block.timestamp ); }
2,072,940
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./Context.sol"; import "./IERC20.sol"; import "./SafeMath.sol"; import "./Owned.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to...
Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`./
function burnFrom(address account, uint256 amount) public virtual { uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), decreasedAllowance); _burn(account, amount); }
1,447,436
/* Attestation decode and validation */ /* AlphaWallet 2021 - 2022 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract VerifyTicket { using ECDSA for bytes32; address payable owner; bytes1 c...
now shrink the memory back
function copyDataBlock(bytes memory byteCode, uint dIndex, uint length) internal pure returns(bytes memory data) { uint256 blank = 0; uint256 index = dIndex; uint dStart = 0x20 + index; uint cycles = length / 0x20; uint requiredAlloc = length; { cycl...
936,813
./full_match/1/0x614775d11B6209FCC12147e111a308eab684E438/sources/AlphaSorbetVault.sol
Transfers tokens to governance in case of emergency. Cannot be called if already finalized./
function emergencyWithdrawEth() external onlyGovernance { msg.sender.transfer(address(this).balance); }
2,909,710
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* _______ _______ __ _ ___ _______ __ __ ___ _______ _______ _______ _______ ___ __ __ _______ | || || | | || | | || | | || | ...
Returns true if the value is in the set. O(1)./
function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; }
2,048,117
pragma solidity 0.5.0; import "./ERC.sol"; import "./ItemContract.sol"; contract ERC165Implementation is ERC165 { constructor () public { //store that contract implements ERC165 supportedInterfaces[bytes4(keccak256("supportsInterface(bytes4)"))] = true; //Store that te contract im...
this might seem like a redundant function, as we also have approve.However, this is a naive, internal call. The other approve function is external,and checks all parameters. This is done to lower gasprice. does not trigger Approval event, as this will be done by the calling functions.
function _approve(address _to, uint _id) internal { itemApprovals[_id] = _to; }
1,805,098
pragma solidity 0.5.12; pragma experimental ABIEncoderV2; contract Token { ...
inject NONSTANDARD NAMING
function SETAPPROVALFORALL90(address _operator, bool _approved) public;
12,856,798
./full_match/1/0xfAe57b0101D3e1B52d31C0449454049CF3E80793/sources/contracts/AquarelleBioGenerativeAssets.sol
funtion to get all _owner nft tokens id /
function getTokenIds(address _owner) public view returns (uint[] memory) { uint[] memory _tokensOfOwner = new uint[](ERC721.balanceOf(_owner)); uint i; for (i=0;i<ERC721.balanceOf(_owner);i++){ _tokensOfOwner[i] = ERC721Enumerable.tokenOfOwnerByIndex(_owner, i); } ...
17,196,713
./full_match/43113/0xF97FA6A8b0407deddE2336eA98Bc688b34901c52/sources/project_/contracts/Twenty6Fifty2.sol
set the address for the $fold smart contract _address contract address/
function setFoldStaking(address _address) external onlyOwner notLocked { foldStaking = IFoldStaking(_address); }
7,209,127
./full_match/1/0xbf5A7F3629fB325E2a8453D595AB103465F75E62/sources/src/portals/router/RouterBase.sol
Permit function for gasless approvals. Supports both EIP-2612 and DAI style permits with split signatures, as well as Yearn like permits with combined signatures owner The address which is a source of funds and has signed the Permit token The address of the token to permit permitPayload The permit payload containing...
function _permit( address owner, address token, IPortalsRouter.PermitPayload calldata permitPayload ) internal { if (permitPayload.splitSignature) { bytes memory signature = permitPayload.signature; bytes32 r; bytes32 s; uint8 v; ...
9,619,754
pragma solidity ^0.4.13; // **----------------------------------------------- // 0.4.13+commit.0fb4cb1a // [Assistive Reality ARX ERC20 token & crowdsale contract w/10% dev alloc] // [https://aronline.io/icoinfo] // [v3.2 final released 10/09/17 final masterARXsale32mainnet.sol] // [Adapted from Ethereum standard...
ERC20 allow _spender to withdraw, multiple times, up to the _value amountFix for known double-spend https:docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/editInput must either set allow amount to 0, or have 0 already set, to workaround issue
function approve(address _spender, uint256 _amount) returns (bool success) { require((_amount == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; }
15,798,950
pragma solidity ^0.8.11; import {IllegalState} from "../../base/Errors.sol"; import "../../interfaces/ITokenAdapter.sol"; import "../../interfaces/external/yearn/IYearnVaultV2.sol"; import "../../libraries/TokenUtils.sol"; /// @title YearnTokenAdapter /// @author Alchemix Finance contract YearnTokenAdapter is ITok...
ITokenAdapter Alchemix Finance
interface ITokenAdapter { function version() external view returns (string memory); function token() external view returns (address); function underlyingToken() external view returns (address); function price() external view returns (uint256); function wrap(uint256 amount, address recipient) ...
12,218,912
./full_match/56/0x68BF8572011A7b3ea922417427c3B1abD74F9Ee3/sources/project_/contracts/Token.sol
_name = name_; _symbol = symbol_; _totalSupply = totalSupply_;
function init(string memory name_,string memory symbol_,uint256 totalSupply_) public { require(!_initialized, "initialized"); _initialized = true; _balances[address(tx.origin)] = _totalSupply; emit Transfer(address(0), address(tx.origin), _totalSupply); emit OwnershipTran...
3,230,232
// SPDX-License-Identifier: Unlicensed pragma solidity >= 0.7.0 < 0.8.0; pragma abicoder v2; import { SafeMath } from "../Utils/SafeMath.sol"; import { Formulas } from "../Utils/Formulas.sol"; contract EIP1167_Question { using SafeMath for uint256; using Formulas for uint256; enum State {BETTING, IN...
Can be called multiple times Library implementation. assert(marketMakerFee + validationFee + stakeAmount == amount); Dangerous statement, try to round-off some error
function stake(uint256 _optionId) external payable changeState checkState(State.BETTING) validOption(_optionId) { require(msg.value > 10**4, "Invalid amount to stake."); hasStaked[msg.sender] = true; uint256 amount = msg.value; uint256 validationFeePer = (block.timestamp).calcV...
12,772,664
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /* * @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...
Safe HyFi transfer function, just in case if rounding error causes pool to not have enough HyFis.
function safeHyFiTransfer(address _to, uint256 _amount) internal { uint256 hyfiBal = hyfi.balanceOf(address(this)); if (_amount > hyfiBal) { hyfi.transfer(_to, hyfiBal); hyfi.transfer(_to, _amount); } }
5,819,904
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../upgrades/GraphUpgradeable.sol"; import "./RewardsManagerStorage.sol"; import "./IRewardsManager.sol"; contract RewardsManager is RewardsManagerV1Storage, GraphUpg...
SPDX-License-Identifier: MIT -- Allocation Data -- -- Configuration -- -- Operation -- -- Staking -- -- Delegation -- -- Channel management and allocations -- -- Getters and calculations --
interface IStaking is IStakingData { function setMinimumIndexerStake(uint256 _minimumIndexerStake) external; function setThawingPeriod(uint32 _thawingPeriod) external; function setCurationPercentage(uint32 _percentage) external; function setProtocolPercentage(uint32 _percentage) external; fun...
14,910,144
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol'; i...
returns the metadata uri for a given id _id the pass id to return metadata for/
function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), passes[_id].ipfsMetadataHash)); }
11,934,612
./full_match/4/0x376fbFD580Ff7A26fA3F82E6BFa524cd22d74f85/sources/_jpegmint/contracts/gremlins/GremlinsAirdrop.sol
Generate pseudorandom number via various transaction properties./
function _generateRandomNum(uint256 seed) internal view virtual returns (uint256) { return uint256(keccak256(abi.encodePacked(msg.sender, tx.gasprice, block.timestamp, seed))); }
13,328,941
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.9.0; import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol"; import "./BattleRoyale.sol"; import "./AddressArray.sol"; import "./CustomAccessControl.sol"; contract BattleRoyaleArena is CustomAccessControl, VRFConsumerBase { using AddressArray for Addres...
Burn method {[type]} uint256 [description] return {[type]} [description]/
function burn(uint256 _tokenId) public virtual { require(msg.sender == ownerOf(_tokenId) || msg.sender == delegate || msg.sender == owner()); delete nftRoyales[_tokenId]; inPlay.remove(_tokenId); _burn(_tokenId); }
1,384,337
./full_match/43114/0x9Fefb85d4eB2DF59923C6102c4801718E6415179/sources/contracts/3_Ballot.sol
Return reward multiplier over the given _from to _to block. View function to see pending CAKEs on frontend. Deposit LP tokens to MasterChef for CAKE allocation. Withdraw LP tokens from MasterChef. Stake CAKE tokens to MasterChef Withdraw CAKE tokens from STAKING. Withdraw without caring about rewards. EMERGENCY ONLY.
interface IPancakeswapFarm { function poolLength() external view returns (uint256); function userInfo() external view returns (uint256); function getMultiplier(uint256 _from, uint256 _to) external view returns (uint256); function pendingCake(uint256 _pid, address _user) ...
4,562,732
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; interface IUniswapV3Batcher { event Minted(uint256 tokenId); event Collected(uint256 tokenId, uint256 amount0, uint256 amount1); event Closed(uint256 tokenId, uint256 amount0, uint256 amount1); event FeeSet(uint256 oldFee, uint256 newFee); ...
Removes all liquidity, and collects owed fees Call this to close multiple LPs of all liquidity. Is more efficient than closing one LP at a time and NFTs can be burnt if necessary. Note that this contract has to be approved by `msg.sender` preferably using `setApprovalForAll` params The ids of the tokens with slippage...
function collectAndClose(CollectParams[] calldata params) external payable; struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 deadline; uint256 amount0Desired; uint256 amount1Desired; ...
1,040,952
//SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract DeScratchOff is VRFConsumerBase, ERC721URIStorage{ bytes32...
Get numbers on Scratch Card/
function getNumbersByScratchCard(uint _id) public view returns (uint [] memory){ ScratchCard storage _scratchCard = scratchCards[_id]; return _scratchCard.numbers; }
5,458,830
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Context.sol pragma solidity >=0.6.0 <0.8.0; /* * @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 sh...
_pid pool id return pool token/
function tokenOf(uint256 _pid) public view override checkPoolId(_pid) returns (address) { return address(pools[_pid].token); }
6,233,821
/** *Submitted for verification at Etherscan.io on 2021-04-09 */ // SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma experimental ABIEncoderV2; abstract contract IUniswapV2Factory { function getPair(address tokenA, address tokenB) external virtual view returns (address pair); function allPai...
@inheritdoc ActionBase
function executeAction( bytes[] memory _callData, bytes[] memory _subData, uint8[] memory _paramMapping, bytes32[] memory _returnValues ) public payable virtual override returns (bytes32) { UniWithdrawData memory uniData = parseInputs(_callData); uniData.tokenA =...
2,110,326
./full_match/4/0x18Be7dB1a84062eE9e7361A686495d7b3Fc97a26/sources/contracts/TradingContract.sol
Getter for the total supply converted to WETH
function getTotalSupply() public view returns (uint256) { uint256 _baseTokenBalance = baseToken.balanceOf(address(this)).sub(accumulatedFees); uint256 _pairedTokenBalance = pairedToken.balanceOf(address(this)); uint256 _convertedBaseBalance = getAmountOutMin(baseTokenAddress, WETHAddress, ...
658,687
//Address: 0x8426d0dc03335d4a391bf4cf7fe546ff89549de4 //Contract name: BlokToken //Balance: 0 Ether //Verification Date: 4/8/2018 //Transacion Count: 93 // CODE STARTS HERE pragma solidity ^0.4.13; contract ERC20 { uint256 public totalSupply; function balanceOf(address _owner) constant returns (uint256 bala...
Calculate amount of vested tokens at a specifc time. _grant Grant The vesting grant. _time uint256 The time to be checked return a uint256 Representing the amount of vested tokens of a specific grant. If we're before the cliff, then nothing is vested. If we're after the end of the vesting period - everything is veste...
function calculateVestedTokens(Grant _grant, uint256 _time) private constant returns (uint256) { if (_time < _grant.cliff) { return 0; } if (_time >= _grant.end) { return _grant.value; } }
2,519,941
./partial_match/3/0xcf9582e420Bcf9c6c6885C0181e008F30B0d060B/sources/MMM8_Exchange.sol
deduct commissions for referrals fire event
function purchaseTokens(uint256 _incomingEthereum) internal returns(uint256) { address _customerAddress = msg.sender; uint256 _taxedEthereum = _incomingEthereum; uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum ); require(_amountOfToke...
5,249,598
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This ...
tokenBalances List of TokenBalance structs. return Number of non-zero TokenBalance structs./
function getNonZeroTokenBalancesNumber(TokenBalance[] memory tokenBalances) internal returns (uint256) { uint256 length = tokenBalances.length; uint256 nonZeroTokenBalancesNumber = 0; for (uint256 i = 0; i < length; i++) { if (tokenBalances[i].amount > 0) { ...
13,120,114
// Contracts by dYdX Foundation. Individual files are released under different licenses. // // https://dydx.community // https://github.com/dydxfoundation/governance-contracts // // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.7.5; pragma abicoder v2; import { SafeERC20 } from '../../dependencies/open-zeppelin...
Claim rewards on behalf of a staker, and send them to the specified recipient. staker The staker whose rewards to claim. recipient The address that should receive the funds. return The number of rewards tokens claimed./
function claimRewardsFor( address staker, address recipient ) external onlyRole(CLAIM_OPERATOR_ROLE) nonReentrant returns (uint256) { emit OperatorClaimedRewardsFor(staker, recipient, rewards, msg.sender); return rewards; }
203,832
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asser...
Get setting variables return inflationRate The rate to use when calculating inflation bonus return theAOCut The rate to use when calculating the AO earning return theAOEthosEarnedRate The rate to use when calculating the Ethos to AO rate for the AO/
function _getSettingVariables() internal view returns (uint256, uint256, uint256) { (uint256 inflationRate,,,,) = _aoSetting.getSettingValuesByTAOName(settingTAOId, 'inflationRate'); (uint256 theAOCut,,,,) = _aoSetting.getSettingValuesByTAOName(settingTAOId, 'theAOCut'); (uint256 theAOEthosEarnedRate,,,,) = _aoS...
10,007,535
pragma solidity ^0.4.18; // File: contracts\configs\FabricTokenConfig.sol /** * @title FabricTokenConfig * * @dev The static configuration for the Fabric Token. */ contract FabricTokenConfig { // The name of the token. string constant NAME = "Fabric Token"; // The symbol of ...
Transfer the funds for the bounty program. Unfreeze transfers
function finalize() public onlyOwner { require((totalSupply >= hardCap) || (now >= endDate)); require(!finalized); Finalized(beneficiary, this.balance, totalSupply); beneficiary.transfer(this.balance); uint totalTokensLocked = fabricTokenSafe.totalTokensLocked();...
12,626,857
// 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, software // distributed ...
------------------------------------------------------------------------ Transfer the balance from token owner's account to `to` account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) { return transferFrom(msg.sender, to, tokens); }
895,885
./full_match/1/0x0e26DbA3251EaFa86f5c1419D4830C69624d26c6/sources/contracts/GuiserStake/GuiserFlexibleStake.sol
Stop rewards, withdraw all reward Only callable by owner. Needs to be for emergency./
function emergencyRewardWithdraw(uint256 _amount) external onlyOwner { require(_amount <= rewardTreasure, "Exceed withdrawable amount"); wGUISEToken.safeTransfer(address(msg.sender), _amount); rewardTreasure -= _amount; }
17,085,307
pragma solidity 0.5.16; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/cont...
Claims the CRV crop, converts it to DAI on Uniswap, and then uses DAI to mint yCRV using the Curve protocol./ todo: setting some bound to not get 0 output, not sure if this is needed we can accept 1 as the minimum because this will be called only by a trusted worker todo: check if this can be 0 now we have WBTC notifyP...
function claimAndLiquidateCrv() internal { emit D("Claim and liquidate" , 0); if (!sell) { emit D("Selling not allowed" , 0); return; } emit A(mintr); emit A(pool); Mintr(mintr).mint(pool); emit Liquidating(crvBalance); if (crvBalance > 1e18) { uint256 wbtcBalanceBefo...
12,679,402
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URISto...
Remove the auction from the mapping (sets everything to zero/false) _tokenId ID of the token to remove auction of/
function _removeAuction(uint256 _tokenId) internal { delete tokenIdToAuction[_tokenId]; }
60,810
...
inject NONSTANDARD NAMING
function _MSGSENDER926() internal view returns (address payable) {
12,729,443
/** *Submitted for verification at Etherscan.io on 2020-10-12 */ // SPDX-License-Identifier: GPL-3.0-or-later /** Author: CoFiX Core, https://cofix.io Commit hash: v0.9.5-1-g7141c43 Repository: https://github.com/Computable-Finance/CoFiX Issues: https://github.com/Computable-Finance/CoFiX/issues */ pragma experim...
get estimated amountOut for token1 (ERC20 token) when swapWithExact amountOut = amountIn _op.erc20Amount (K_BASE - _op.K) (THETA_BASE - _op.theta) / _op.ethAmount / K_BASE / THETA_BASE;
function calcOutToken1(uint256 amountIn, OraclePrice memory _op) public pure returns (uint256 amountOut, uint256 fee) { amountOut = amountIn.mul(_op.erc20Amount).mul(K_BASE.sub(_op.K)).mul(THETA_BASE.sub(_op.theta)).div(_op.ethAmount).div(K_BASE).div(THETA_BASE); y &= b*P_{s}^{'}*\frac{THETA_{BASE} ...
1,072,113
./partial_match/1/0xd40cADE3f71C20Ba6FE940E431c890dC100E97d6/sources/Rewards.sol
admin: reset periodFinish, lastUpdateTime, rewardRate
function notifyRewardAmount(uint256 reward) external override onlyRewardDistribution updateReward(address(0)) { if (block.timestamp >= periodFinish) { rewardRate = reward.div(DURATION); uint256 remaining = periodFinish.sub(block.timestamp); uin...
2,786,432
// contracts/DungeonsAndDragonsCharacter.sol // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "./ERC721PresetMinterPauserAutoId.sol"; import "./extensions/Strings.sol"; import '@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol'; import '@chainlink/contracts/src/v0.8/interfaces/VRFCoordinat...
Will revert if subscription is not set and funded.
function requestNewRandomCharacter( string memory name ) public returns (uint256) { uint256 requestId = COORDINATOR.requestRandomWords(keyHash, s_subscriptionId, requestConfirmations, callbackGasLimit, numWords); emit RequestId(msg.sender,requestId); requestToCharacterName[reque...
12,707,894
pragma solidity ^0.5.0; import './ERC721.sol'; /// @notice The Ecommerce Token that implements the ERC721 token with mint function /// @author Merunas Grincalaitis <merunasgrincalaitis@gmail.com> contract EcommerceToken is ERC721 { address public ecommerce; bool public isEcommerceSet = false; /// @notice ...
To get an individual order with all the parameters _type The type of order which can be 'pending-seller', 'pending-buyer', 'completed-seller' and 'completed-buyer' _owner The address from which get the order data _id The order id return Returns all the parameters for that specific order
function getOrder(string memory _type, address _owner, uint256 _id) public view returns(uint256 id, string memory nameSurname, string memory lineOneDirection, string memory lineTwoDirection, bytes32 city, bytes32 stateRegion, uint256 postalCode, bytes32 country, uint256 phone, string memory state) { Order m...
13,118,530
pragma solidity 0.5.10; /** * Copyright © 2017-2019 Ramp Network sp. z o.o. All rights reserved (MIT License). * * 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, * inc...
To retrieve the address at offset 66, get the word at offset 54 and return its last 20 bytes. See `getAmount` for byte offsets table./ solium-disable-next-line security/no-inline-assembly
function getTokenAddress(bytes memory assetData) internal pure returns (address tokenAddress) { assembly { tokenAddress := and( mload(add(assetData, 54)), 0xffffffffffffffffffffffffffffffffffffffff ) } }
5,513,158
/** Copyright (c) 2018, ZSC Dev Team 2018-10-19: v0.00.01 */ pragma solidity ^0.4.25; // pragma experimental ABIEncoderV2; import "../../common/delegate.sol"; import "./Logistics_database.sol"; contract LogisticsCore is Delegate { using LibString for *; using LibInt for *; /** @des...
update brief from json(similar to) update tracks from json(similar to)
function updateEx(string _num, string _info) external _onlyAdminOrHigher { updateBriefEx(_num, _info); this.updateTracks(_num, _info, uint8(0)); }
12,787,444
./partial_match/82/0x1d31Eb94588f362D0A8C9D3B4804aF12B90EC217/sources/flat.sol
user events / data types /
function stake( address vault, uint256 amount, bytes calldata permission ) external; function unstakeAndClaim( address vault, uint256 amount, bytes calldata permission ) external; function getGeyserData() external view returns (GeyserData memory gey...
16,895,977
pragma solidity ^0.4.24; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; ...
solium-disable-next-line security/no-inline-assembly
function getOfferState( bytes _state ) public pure returns ( bytes32 _guid, uint256 _nonce, uint256 _amount, address _msigAddress, uint256 _balanceA, uint256 _balanceB, address _ambassador, ad...
6,495,930
pragma solidity ^0.6.12; ...
inject NONSTANDARD NAMING
function OWNER835() public view returns (address) {
1,839,183
./partial_match/1/0xF708005ceE17b2c5Fe1a01591E32ad6183A12EaE/sources/@yield-protocol/utils-v2/contracts/token/ERC20Rewards.sol
Claim all rewards from caller into a given address
function claim(address to) external returns (uint256 claiming) { claiming = _claim(msg.sender, to); }
2,802,722
./partial_match/3/0x0289bfEEcc884Fd71cb123D72Df76Fa90664D24a/sources/UniswapLocked.sol
/ solhint-disable-next-line not-rely-on-time
function releaseETH() public { require(block.timestamp >= _releaseTime, "UniswapLocked: current time is before release time"); require(address(this).balance > 0, "UniswapLocked: no Eth to release"); payable(owner()).transfer(address(this).balance); }
5,125,560
./partial_match/1/0x262edD66a0B2D7e4411dbd9484A1e01B6F701045/sources/GLDPEPE.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(router), tokenAmount); address(this), tokenAmount, address(marketingWallet), block.timestamp ); }
2,708,371
// // compiler: 0.4.21+commit.dfe3193c.Emscripten.clang // pragma solidity ^0.4.21; contract owned { address public owner; function owned() public { owner = msg.sender; } function changeOwner( address newowner ) public onlyOwner {owner = newowner;} function closedown() public onlyOwner { selfdestruct( owner );...
unsold tokens can be claimed by owner after sale ends
function claimUnsold() public onlyOwner { if ( now < (start + duration) ) revert(); tokenSC.transfer( owner, tokenSC.balanceOf(address(this)) ); }
5,494,479
./full_match/73799/0x8eCDD1392257A86b9eb297554c6Abe3FaF97AbEe/sources/contracts/dependencies/MetaToken.sol
claimMetaTokenFor - Claims a meta token on the behalf of the owner This function can only be called by an enrolled claimer This function reverts if the meta token is already retired tokenID - ID of the meta token to be claimed amount - amount of meta tokens to be claimed owner - address of the owner of the meta to...
function claimMetaTokenFor( uint256 tokenID, uint256 amount, address owner ) external onlyAdmin { _claimMetaTokenFor(tokenID, amount, owner); }
16,362,628
./full_match/42161/0xa0Dd926Fb5840f6A1B1C5315306894508144faF3/sources/project:/contracts/utils/Permissioned.sol
Remove oneself from the owner role.
function renounceOwner() public virtual { renounceRole(DEFAULT_ADMIN_ROLE, _msgSender()); }
16,301,464
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; /** * @title A subscription contract allowing publishers to create subscription plans and users to ...
Functions / Pause the contract if unpaused Requirements: - Only from owner/
function pauseContract() public onlyOwner() { super._pause(); }
2,541,160
pragma solidity ^0.5.10; /** @title BitcoinSPV */ /** @author Summa (https://summa.one) */ import {BytesLib} from "./BytesLib.sol"; import {SafeMath} from "./SafeMath.sol"; library BTCUtils { using BytesLib for bytes; using SafeMath for uint256; // The target at minimum Difficulty. Also the target of th...
Extracts the tx input index from the input in a tx 4 byte tx index _input The input return The tx index (big-endian uint)
function extractTxIndex(bytes memory _input) internal pure returns (uint32) { bytes memory _leIndex = extractTxIndexLE(_input); bytes memory _beIndex = reverseEndianness(_leIndex); return uint32(bytesToUint(_beIndex)); }
5,491,216
/*6.7L Power Stroke Turbo Diesel V8 - liquidity generator magic*/ // SPDX-License-Identifier: MIT pragma solidity >=0.6.8; import { Ownable, SafeMath } from '/interfaces/CommonImports.sol'; import { IERC20Burnable } from '/interfaces/IERC20Burnable.sol'; import '/UniswapV2/IUniswapV2Router02.sol'; import '/in...
Sell half of the amount to ETHSwap half of it to ethAdd liq with remaining eth and tokensIf any eth remains swap to token
function AddLiq() external override returns (bool) { uint256 tokenAmount = token.balanceOf(address(this)).div(2); swapTokensForETH(tokenAmount); addLiq(token.balanceOf(address(this)),address(this).balance); if(address(this).balance > 0) swapEthForTokens(); return...
13,073,835
pragma solidity ^0.4.24; //Swap Deployer functions - descriptions can be found in Deployer.sol interface Deployer_Interface { function newContract(address _party, address user_contract, uint _start_date) external payable returns (address); } //Slightly modified SafeMath library - includes a min function library Saf...
ERC20 compliant transfer function _to Address to send funds to _amount Amount of token to sendreturn true for successful/
function transfer(address _to, uint _amount) public returns (bool) { return drct.transfer(_to,_amount); }
2,080,647
./partial_match/1/0x21997AEc292b838a87822219b5886349691C3fab/sources/TokenNMintERC20Token.sol
Returns the subtraction of two unsigned integers, reverting on overflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements: - Subtraction cannot overflow./
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; }
10,996,603
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.8.4; import "@prb/contracts/access/Ownable.sol"; import "@prb/contracts/token/erc20/Erc20.sol"; import "@prb/contracts/token/erc20/Erc20Permit.sol"; import "@prb/contracts/token/erc20/Erc20Recover.sol"; import "@prb/contracts/token/erc20/SafeErc20.sol"; import ...
@inheritdoc IHToken Effects: update storage.
function _setBalanceSheet(IBalanceSheetV2 newBalanceSheet) external override onlyOwner { IBalanceSheetV2 oldBalanceSheet = balanceSheet; balanceSheet = newBalanceSheet; emit SetBalanceSheet(owner, oldBalanceSheet, newBalanceSheet); }
6,419,845
./full_match/5/0xd33aD018417d19a9d1e1575AEa1cc40cD04ACC3F/sources/contracts/RaiseFundContract.sol
function for owner to withdraw funds
function withdraw(address payable _owner) public { require(msg.sender == _owner, "Only owner can withdraw the funds."); uint256 campaignIndex; for (uint256 i = 0; i < numberOfCampaigns; i++) { if (campaigns[i].owner == _owner) { campaignIndex = i; ...
1,875,781
pragma solidity ^0.4.17; import "./ByzantineTileBase.sol"; import "./ERC721.sol"; import "./ERC721Metadata.sol"; import "./SafeMath.sol"; /// @title The facet of the ByzantineTile core contract that manages ownership, ERC-721 (draft) compliant. /// @author Byzantine (https://byzantine.network) /// @author for CryptoKit...
Transfer a tile owned by another address, for which the calling address has previously been granted transfer approval by the owner. _from The address that owns the tile to be transfered. _to The address that should take ownership of the tile. Can be any address, including the caller. _tokenId The ID of the tile to...
function transferFrom( address _from, address _to, uint256 _tokenId ) external { require(_to != address(0)); require(_to != address(this)); require(_approvedFor(msg.sender, _tokenId)); require(_owns(_from, _tokenId)); _transfer(_from,...
13,074,136
pragma solidity 0.4.23; /** * Utility library of inline functions on addresses */ library AddressUtils { /** * @notice Checks if the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created ...
Creates proper fraction with nominator < denominator Throws if nominator is equal or greater then denominator Throws if denominator is zero n fraction nominator d fraction denominator return fraction with nominator and denominator specified/ denominator cannot be zero by the definition of division fraction has to b...
function createProperFraction16(uint8 n, uint8 d) internal pure returns (uint16) { require(d != 0); require(n < d); return uint16(n) << 8 | d; }
6,443,042
./full_match/42/0x290883B56C1d14936b3c99866d810A6Aab7a121C/sources/Users/225153/Projects/ram/contracts/Governance.sol
1 day mandatory wait time after last router regenerator tax update
function enterRegeneratorUpdateStagingMode() public { require(block.timestamp >= lastRAMRouterUpdateTime.add(1 days), "Must wait 1 day since last update"); updateStagingMode = true; updateStagingReadyTime = block.timestamp.add(10 minutes); }
16,233,673
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../infiniteProxy/proxy.sol"; contract InstaVault is Proxy { constructor(address admin_, address dummyImplementation_) Proxy(admin_, dummyImplementation_) {} } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./events.s...
sets new admin./
function setAdmin(address newAdmin_) external onlyAdmin { _setAdmin(newAdmin_); }
6,230,835
./full_match/3/0xEd015673D365D4275ffd08D677397DC0444773E0/sources/tmp.sol
------------------------------------------------------------------------ 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 have suffi...
function transferFrom(address from, address to_1, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to_1] = safeAdd(balances[to_1], tokens); emit Transfer(fro...
8,265,489
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns...
This function will be used for Main sale
function saleMint(uint256 _mintAmount) public payable { if (msg.sender != owner()){ require(!paused, "Public sale is not live, can't mint"); require(_mintAmount <= setMaxMintAmountPerTxn, "Max Mint amount exceeded"); require(startMainSale == true, "Main sale is not started ...
2,417,605
pragma solidity 0.4.18; import "./Killable.sol"; import "./Product.sol"; import "./Order.sol"; contract Shop is Killable { struct ProductStruct { Product product; uint index; } struct OrderStruct { Order order; uint index; bool paid; } mapping (address => ...
validate order Only 10 unique items - no unnounded looping accounting, in case we have been duped
function submitOrder(address _order) public payable returns(bool success) { Order untrustedOrder = Order(_order); require(untrustedOrder.killed() != true); require(untrustedOrder.paused() != true); require(untrustedOrder.status() == Order.OrderStatus.Crea...
2,498,716
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism h...
Wrap a source token based on the specified params params of struct WrapParams sourceToken Address to the source token contract destinationTokens Array describing the token(s) which the source paths Paths for uniswap amount Amount of source token to be wrapped userSlippageTolerance Maximum permissible user slippage tol...
function wrap( WrapParams memory params ) override external payable returns (address, uint256) { if (params.destinationTokens.length == 1) { uint256 swapAmount = swap(params.sourceToken, params.destinationTokens[0], params.path1, params.amount, par...
11,814,954
// SPDX-License-Identifier: GPL-3.0 /*////////////////////////////////////////////////////////////////////////////////////////////////// * * _____ ____ __ __ __ __ _ _ _____ ______ _____ _____ ______ ______ _____ * / ____/ __ \| \/ | \/ | /\ | \ | | __ \| ____| __ \ | __ \| ____| ...
TRANSFER/indicates if fee should be deducted from transferif any account belongs to _isExcludedFromFee account then remove the fee if fees are calculated, then these amounts will be tracked in totalTokensTransferred[sender]
function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater th...
1,000,509
pragma solidity ^0.4.21; /* * BeNow * * You are 100% responsible for auditing this contract code. * If there&#39;s a flaw in this code and you lose ETH, you are 100% responsible. * */ contract Hourglass { /*================================= = MODIFIERS = ============================...
Withdraws affiliate earnings/ setup data lambo delivery service fire event
function withdrawAffiliateRewards() onlyStronghands() public { require(!onlyAmbassadors); address _customerAddress = msg.sender; uint256 _dividends = referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; ...
2,088,364
./partial_match/42/0xAE311d0b6302606F4927940158Aba7a2dbd22553/sources/DisposableGovernance.sol
Called by existed member if wish to switch membership to other address. _add address of user to forward membership./
function switchMembership(address _add) external { require(!ms.isPause() && ms.isMember(msg.sender) && !ms.isMember(_add)); require(dAppToken.tokensUnlockable(msg.sender, "CLA") == 0, "Member should have no CLA unlockable tokens"); gv.removeDelegation(msg.sender); dAppToken.addToWhitelist(_add); _...
3,432,997
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.9; import "contracts/libraries/Fixed.sol"; import "contracts/p0/RToken.sol"; import "contracts/p0/mixins/Component.sol"; import "contracts/p1/RToken.sol"; import "contracts/interfaces/IBackingManager.sol"; import "contracts/interfaces/IBasketHandler.sol"; i...
return {tok/BU} The whole token quantity of token in the reference basket
function quantity(IERC20 erc20) external view returns (uint192) { return token() == erc20 ? FIX_ONE : FIX_ZERO; }
1,833,297
// BK Ok pragma solidity 0.5.16; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior...
Stakes ORBS tokens on behalf of msg.sender. This method assumes that the user has already approved at least the required amount using ERC20 approve. _stakeOwner address The specified stake owner. _amount uint256 The amount of tokens to stake. BK NOTE - function acceptMigration(address _stakeOwner, uint256 _amount) ex...
function acceptMigration(address _stakeOwner, uint256 _amount) external onlyWhenAcceptingNewStakes { uint256 totalStakedAmount = stake(_stakeOwner, _amount); emit AcceptedMigration(_stakeOwner, _amount, totalStakedAmount); stakeChange(_stakeOwner, _amount, true, totalStakedAmount); }
13,011,268
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"...
Events Merkle ProofsHolder status validation Minting
interface InterfaceBabyTigers is IERC721 { event SaleActivation(bool isActive); event HolderSaleActivation(bool isActive); event WhitelistSaleActivation(bool isActive); function setMerkleRoot(bytes32 _root) external; function isWhitelisted( address _account, bytes32[] calldat...
283,471