file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// File: @openzeppelin/contracts/utils/math/SafeMath.sol // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity 0.8.11; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers ov...
get the reward for every user _to address that withdraw rewards to
function getReward(address _to) external override { require(msg.sender == address(dinoContract)); uint256 reward = rewards[_to]; if (reward > 0) { rewards[_to] = 0; _mint(_to, reward); emit RewardPaid(_to, reward); } }
523,420
./partial_match/1/0xf05Dc4B57fB161015FDDA8749A8c56C6e3D962Ff/sources/KFICrowdsale.sol
The `escapeHatch()` should only be called as a last resort if a security issue is uncovered or something unexpected happened _token to transfer, use 0x0 for ether Logic for ether
function escapeHatch(address _token, address payable _escapeHatchDestination) external onlyOwner nonReentrant { require(_escapeHatchDestination != address(0x0)); uint256 balance; if (_token == address(0x0)) { balance = address(this).balance; _escapeHatchDestination.transfer(balance); e...
2,797,295
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functi...
Returns whether the random number request has completed. return True if a random number request has completed, false otherwise.
function isRngCompleted() public view returns (bool) { return rng.isRequestComplete(rngRequest.id); }
1,239,832
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract TellorPlayground { // Events event Approval( address indexed owner, address indexed spender, uint256 value ); event NewReport( bytes32 _queryId, uint256 _time, bytes _value, uint256 ...
Transfer tokens from one user to another _recipient The destination address _amount The amount of tokens, including decimals, to transfer return bool If the transfer succeeded/
function transfer(address _recipient, uint256 _amount) public virtual returns (bool) { _transfer(msg.sender, _recipient, _amount); return true; }
12,899,680
/** * SPDX-License-Identifier: UNLICENSED */ pragma solidity =0.6.10; pragma experimental ABIEncoderV2; import {OwnableUpgradeSafe} from "./packages/oz/upgradeability/OwnableUpgradeSafe.sol"; import {ReentrancyGuardUpgradeSafe} from "./packages/oz/upgradeability/ReentrancyGuardUpgradeSafe.sol"; import {Initializabl...
check if an oToken has expired _otoken oToken address return True if the otoken has expired, False if not/
function hasExpired(address _otoken) external view returns (bool) { uint256 otokenExpiryTimestamp = OtokenInterface(_otoken).expiryTimestamp(); return now >= otokenExpiryTimestamp; }
942,804
/** *Submitted for verification at Etherscan.io on 2020-11-05 */ /* website: bns.finance This project is freshly written to change the way ICO is done. BBBBBBBBBBBBBBBBB NNNNNNNN NNNNNNNN SSSSSSSSSSSSSSS DDDDDDDDDDDDD EEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFIIIIIIIIII B:::::::::...
Lock sale detail changes in future
function lockPool(uint256 _pid) external { _checkUpdateAllowed(_pid); poolInfo[_pid].updateLocked = true; }
1,045,273
pragma solidity >=0.4.22 <0.9.0; contract SupplyChain { //Smart Contract owner will be the person who deploys the contract only he can authorize various roles like retailer, Manufacturer,etc address public Owner; //note this constructor will be called when smart contract will be deployed on blockchain ...
To show status to client applicationselse if (MedicineStock[_medicineID].stage == STAGE.RawMaterialSupply) return "Raw Material Supply Stage";
function showStage(uint256 _medicineID) public view returns (string memory) { require(medicineCtr > 0); if (MedicineStock[_medicineID].stage == STAGE.Init) return "Medicine Ordered"; else if (MedicineStock[_medicineID].stage == STAGE.Manufacture) ...
930,258
./partial_match/1/0xe35aC90D3BD1009977c989F3eb0c0d3E9F171817/sources/contracts/extensions/token/erc20/ERC20TokenExtension.sol
Returns the symbol of the token, usually a shorter version of the name./
function symbol() external view virtual returns (string memory) { return bytes32ToString(bytes32(dao.getConfiguration(TokenSymbol))); }
15,956,370
//Address: 0xb56c725467c7eec851b1a4a4222d930932b04e89 //Contract name: E4RowEscrow //Balance: 0.1862646004623971 Ether //Verification Date: 6/15/2017 //Transacion Count: 3958 // CODE STARTS HERE pragma solidity ^0.4.11; // version (LAVA-Q) contract E4RowEscrow { event StatEvent(string msg); event StatEventI(string...
------------------------------------------------------ flush the house fees whenever commanded to. ignore the threshold and the last payout time but this time only reset lastpayouttime upon success------------------------------------------------------
function flushHouseFees() { if (msg.sender != owner) { StatEvent("only owner calls this function"); uint ntmpho = houseFeeHoldover; houseFeeHoldover = 0; if (!tokenPartner.call.gas(tokCallGas)...
12,615,567
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol
Reads the int192 at `cdPtr` in calldata.
function readInt192( CalldataPointer cdPtr ) internal pure returns (int192 value) { assembly { value := calldataload(cdPtr) } }
3,218,364
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.7; import "@rari-capital/solmate/src/tokens/ERC20.sol"; import "@rari-capital/solmate/src/utils/SafeTransferLib.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../../libraries/Babylonian.sol"; import "../../interfaces/IStrategy.sol"; i...
@inheritdoc IStrategy do not use isActive modifier here; allow bentobox to call strategy.exit() multiple times
function exit(uint256 balance) external override onlyBentoBox onlyValidStrategy returns (int256 amountAdded) { uint256 actualBalance = currentSubStrategy.exit(); amountAdded = int256(actualBalance) - int256(balance); exited = true;
5,432,266
./full_match/4/0xa3cA8e18ACF68955B93eCB5e416bC5728a15657B/sources/contracts/KingOfTheHill.sol
This private function is called to update variables. The following variables are updated: - gameBlock is set to zero to report that the game is over and waiting another return. - balance of the last _jackpotOwner and the _owner are updated. - _jackpot is updated with a new seed Seed calculation: the two rew...
function _gameOver(address caller) private { uint256 amount; if (caller == _owner) { amount = 10; amount = 5; amount = 8; } uint256 seed = (_jackpot*amount)/100; _gamersRewards[_jackpotOwner] += _jackpot-(seed*2); _gamersR...
12,463,515
./full_match/1/0x82a7b5842085f434c6584A8c44b6A1C15c25a512/sources/contracts/test/integrations/DelegateCash/TestDelegationRegistry.sol
The global mapping and single source of truth for delegations vault -> vaultVersion -> delegationHash A mapping of wallets to versions (for cheap revocation) A mapping of wallets to delegates to versions (for cheap revocation) A secondary mapping to return onchain enumerability of delegations that a given address c...
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165) returns (bool) { return interfaceId == type(IDelegationRegistry).interfaceId || super.supportsInterface(interfaceId); }
9,659,503
pragma solidity ^0.5.0; import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeMathUInt128.sol"; import "./SafeCast.sol"; import "./Utils.sol"; import "./Storage.sol"; import "./Config.sol"; import "./Events.sol"; import "./Bytes.sol"; import "./Operations.sol"; import "./UpgradeableMaster.sol"; imp...
Priority Queue request
function registerCreatePair(uint16 _tokenAID, address _tokenA, uint16 _tokenBID, address _tokenB, uint16 _tokenPair, address _pair) internal { Operations.CreatePair memory op = Operations.CreatePair({ tokenA : _tokenAID, tokenB : _tokenBID, tokenPair : _tokenPair, ...
1,250,277
pragma solidity ^0.4.24; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) external pure returns(uint); function maxBalance() external pure returns(int); function conflictEndFine() external pure returns(int); function isValidBet(uint8 _gameType, uint _betNum, uint _bet...
Unpause contract. Initial contract is paused and can only be unpaused after activating it./
function unpause() public onlyOwner onlyPaused onlyActivated { paused = false; timePaused = 0; emit LogUnpause(); }
10,632,713
// hevm: flattened sources of contracts/Alchemist.sol pragma solidity ^0.4.24; ////// contracts/openzeppelin/IERC20.sol /* pragma solidity ^0.4.24; */ /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns...
ERC20 interface/
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); fu...
12,575,715
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.7.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * ...
solhint-disable-next-line func-name-mixedcase
interface IAToken is IERC20 { function UNDERLYING_ASSET_ADDRESS() external returns (address); }
13,419,474
./partial_match/1/0xe6F4d9711121e5304b30aC2Aae57E3b085ad3c4d/sources/src/ERC20Pool.sol
@inheritdoc IERC20PoolImmutables
function collateralScale() external pure override returns (uint256) { return _getArgUint256(COLLATERAL_SCALE); }
3,629,716
/** *Submitted for verification at Etherscan.io on 2021-06-10 */ pragma solidity ^0.5.17; // Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol // Adapted to use pragma ^0.5.17 and satisfy our linter rules /** * @title SafeMath * @dev Math operations with safety checks tha...
Tell the token balance of a certain holder _token ERC20 token balance being queried _holder Address of the holder querying the balance of return Amount of tokens the holder owns/
function balanceOf(IERC20 _token, address _holder) external view returns (uint256) { return _balanceOf(_token, _holder); }
6,793,829
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./AloePool.sol"; contract AloePoolCapped is AloePool { using SafeERC20 for IERC20; address public immutable MULTISI...
Deposits liquidity in a range on the Uniswap pool.
function _uniswapEnter(Ticks memory ticks, uint128 liquidity) internal { if (liquidity == 0) return; UNI_POOL.mint(address(this), ticks.lower, ticks.upper, liquidity, ""); }
1,371,958
pragma solidity ^0.4.18; /** * Overflow aware uint math functions. */ library SafeMath { function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c>=a && c>=b); ...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; }
12,686,557
./full_match/1/0xaf4920C0D5C6cCFd297decEa77e5516c6184F2DB/sources/@1inch/solidity-utils/contracts/libraries/ECDSA.sol
@solidity memory-safe-assembly
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal view returns(address signer) { let ptr := mload(0x40) mstore(ptr, hash) mstore(add(ptr, 0x20), v) mstore(add(ptr, 0x40), r) mstore(add(ptr, 0x60), s) if staticcall(gas(), 0...
17,000,946
/** * . * / \ * |.'.| * |'.'| * ,'| |`. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | *...
The maximum node commission rate as a fraction of 1 ether
function getMaximumNodeFee() override external view returns (uint256) { return getSettingUint("network.node.fee.maximum"); }
5,983,039
./partial_match/42220/0x84Bb1795b699Bf7a798C0d63e9Aad4c96B0830f4/sources/contracts/MoolaStakingRewards.sol
XXX: removed notPaused
function stake(uint256 amount) external override nonReentrant updateReward(msg.sender) { require(amount > 0, "Cannot stake 0"); _totalSupply = _totalSupply.add(amount); _balances[msg.sender] = _balances[msg.sender].add(amount); stakingToken.safeTransferFrom(msg.sender, address(this),...
3,497,828
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @artist: Anna Ridler /// @author: manifold.xyz import "@prb/math/contracts/PRBMathSD59x18.sol"; import "./libraries/Trigonometry.sol"; import "./libraries/BokkyPooBahsDateTimeLibrary.sol"; import "./dynamic/DynamicArweaveHash.sol"; import "./extensions/ERC...
Yields the excess beyond the floor of x for positive numbers and the part of the number to the right of the radix point for negative numbers. Based on the odd function definition. https://en.wikipedia.org/wiki/Fractional_part x The signed 59.18-decimal fixed-point number to get the fractional part of. result The fra...
function frac(int256 x) internal pure returns (int256 result) { unchecked { result = x % SCALE; } }
10,297,525
./full_match/122/0xFAE02d404c327A1Eb2fB38eb89C38860a02D70e6/sources/contracts/LiquidStakingPool.sol
Checks if address is a current validator on list _validator the address to be checked/
function isInValidatorList(address _validator) public view returns(bool) { address[] memory validatorList = getValidators(); for (uint256 i = 0; i < validatorList.length; i++) { if(validatorList[i] == _validator) { return true; } } return fal...
16,366,174
./partial_match/1/0x73aEA21988365C9F0943416044608017BBAeaF53/sources/xBond.sol
Transfer tokens from one address to another. from The address you want to send tokens from. to The address you want to transfer to. value The amount of tokens to be transferred./ make sure users cannot double claim if they have already claimed
function transferFrom(address from, address to, uint256 value) public updateAccount(from) updateAccount(to) validRecipient(to) returns (bool) { if (lastUserRebase[from] == lastRebase) lastUserRebase[to] = lastRebase; lastUserPoints[from] = totalDollarPoin...
4,354,642
./full_match/1/0x1Ef92666550De8b1bdD530Ad03a8de14E1fBbaa4/sources/contracts/PawfuryV1.sol
To buy into a presale using ETH amount No of tokens to buy/
function buyWithEth( uint256 amount ) external payable checkSaleState(amount) whenNotPaused nonReentrant returns (bool) { require(amount >= minTokensToBuy, "Amount less"); uint256 usdPrice = calculatePrice(amount); uint256 ethAm...
8,343,459
./partial_match/1/0xa06A604184dc15d3BdDc514a1c327957B7388128/sources/HarryPotterObamaTerraSonic10Inu.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, deadAddress, block.timestamp }
2,686,615
pragma solidity 0.5.8; contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } function owner() public view retu...
Internal function used to prefix hashes to allow for compatibility with signers such as Metamask messageHash Original hash/
function recover(bytes32 messageHash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { bytes memory prefix = "\x19Metacash Signed Message:\n32"; bytes32 prefixedMessageHash = keccak256(abi.encodePacked(prefix, messageHash)); return ecrecover(prefixedMessageHash, v, r, s); ...
6,353,910
./full_match/11155111/0x7f13131E32AaF7CB286310D24B451bC71de5Faf8/sources/contracts/RealEstate.sol
Funtions for reviews
function addReview(uint productId, uint256 rating, string calldata comment, address user) external{ require(rating >=1 && rating <=5, "Rating must be between 1 to 5"); Property storage property=properties[productId]; property.reviewers.push(user); property.reviews.push(comment); ...
3,836,341
/* Copyright 2018 ZeroEx Intl. 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, ...
Pops the last 20 bytes off of a byte array by modifying its length. b Byte array that will be modified. return The 20 byte address that was popped off. Store last 20 bytes. Subtract 20 from byte array length.
function popLast20Bytes(bytes memory b) internal pure returns (address result) { require( b.length >= 20, GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED ); result = readAddress(b, b.length - 20); assembly { let newLen := sub(m...
5,522,727
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOGBYTES2749(bytes27 p0) internal view {
14,087,637
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
Checks if contract is operational return true if contract is operational/
function isOperational() public view returns(bool) { }
1,791,633
/** *Submitted for verification at Etherscan.io on 2020-08-31 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.8; pragma experimental ABIEncoderV2; interface iERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function deci...
TransferTo function
function transferTo(address recipient, uint256 amount) public returns (bool) { __transfer(tx.origin, recipient, amount); return true; }
1,793,918
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; // This is only kept for backward compatability / upgrading import {OwnableUpgradeable} from "../oz/access/OwnableUpgradeable.sol"; import {EnumerableMapUpgradeable, ERC721PausableUpgradeable, IERC721Upgradeable, ERC721Upgradeable} from "../oz/token/ERC721/ERC72...
Returns the current beacon./
function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; }
144,000
/* * Lottery oracle * * Copyright (C) 2017-2019 Hubii AS */ pragma solidity ^0.5.11; import {Resolvable} from "./Resolvable.sol"; import {ResolutionEngine} from "./ResolutionEngine.sol"; /// @title NaiveTotalResolutionEngine /// @author Jens Ivar Jørdre <jensivar@hubii.com> /// @notice A naïve total resolution e...
Augment the verification phase with verification criteria params
function _addVerificationCriteria() internal { verificationPhaseByPhaseNumber[verificationPhaseNumber].uintCriteria.push(nextAmount); }
12,920,258
// Sources flattened with hardhat v2.0.2 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v3.2.0 pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ funct...
internal function pending piggy reward get piggyReward from pool.lastRewardBlock to block.number. different interval different multiplier and piggyPerBlock, sum piggyReward if enableClaimBlock after block.number, return pendingValue + user.pendingReward. else return pendingValue.
function _pending(uint256 _pid, address _user) internal view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accPiggyPerShare = pool.accPiggyPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
1,339,960
./full_match/43113/0x99fCa0B1D9b982B1cbE001e6F059413Be5920D59/sources/Happy/Happy.sol
return current interval (in days) /
function interval() public view returns (uint256) { uint256 _interval = block.timestamp / (1 days); require(_interval > 0, "invalid interval"); return _interval; }
13,177,025
pragma solidity ^0.4.23; library SafeMath{ // Multiples 2 numbers, throws on overflow is detected. function mul(uint256 _x, uint256 _y) internal pure returns (uint256 result){ if(_y == 0){ return 0; } result = _x*_y; assert(_x == result/_y); return result; ...
Transfers `_amount` from `_from` to `_to` with additional data. Only if `approve` has been called before! An empty `bytes` instance will be created and sent to `tokenFallback()` if receiver is a contract./
function transferFrom(address _from, address _to, uint256 _amount) stopOnPause public returns (bool success){ require(_from != 0x0); require(allowance(_from, msg.sender) >= _amount); bytes memory empty; allowed[_from][msg.sender] = allowance(_from, msg.sender).sub(_amount); ...
7,935,639
pragma solidity 0.5.17; library Address { /** * Returns whether 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 until after the constructor finishes. * @param account address to check...
Returns whether the target address is a contract This function will return false if invoked during the constructor of a contract, as the code is not actually created until after the constructor finishes. account address to check return whether the target address is a contract/ According to EIP-1052, 0x0 is the value ...
function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; return (codehash != accountHash && codehash != 0x0); }
7,370,494
./partial_match/42/0x579AbEEE14a52A4CA6707a4590c524Dc149D56a1/sources/CompoundLeverageModule.sol
MANAGER ONLY: Decrease leverage for a given collateral position using an enabled borrow asset that is enabled _setToken Instance of the SetToken _collateralAsset Address of collateral asset (underlying of cToken) _repayAsset Address of asset being repaid _redeemQuantity Quantity of ...
function delever( ISetToken _setToken, address _collateralAsset, address _repayAsset, uint256 _redeemQuantity, uint256 _minRepayQuantity, string memory _tradeAdapterName, bytes memory _tradeData ) external nonReentrant onlyManagerAn...
3,333,983
./full_match/4/0xAF4938ff040cD6F3bfe74051930Dabf9AE5bcDE3/sources/cycloape.sol
see the current state of sale
function saleState() public view returns(State) { return saleState_; }
12,299,683
pragma solidity ^0.4.24; import "./ERC20.sol"; import "./OMG_ERC20.sol"; import "./SafeMath.sol"; /** * @title FeeBurner * @author Piotr Zelazko <pik694@GitHub> * * @dev FeeBurner contract is a part of OmiseGO project and * provides trustless OMG's buyback and burn mechanism. */ contract FeeBurner { ...
Returns flat exchange rate of the given token. _token address of an ERC20 token, or 0 in case of Ethereum return Newest exchange rate of the token in given format (block when the rate was set, rate's nominator, rate's denominator) If given token is not supported, then (0, 0, 0) is returned Token can surely by exchan...
function getExchangeRate(address _token) public view returns (uint, uint, uint) { ExchangeRate memory exchangeRate = exchangeRates[_token]; return (exchangeRate.blockNo, exchangeRate.rate.nominator, exchangeRate.rate.denominator); }
13,080,339
pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // &#39;vevcoin&#39; CROWDSALE token contract // // Deployed to : 0xd1510bE4989d96E9c4d7937b80b33D59FC75C36e // Symbol : vev // Name : vevcoin // Total supply: Gazillion // Decimals : 18 // // Enjoy....
------------------------------------------------------------------------ 50 vev Tokens per 1 ETH ------------------------------------------------------------------------
function () public payable { require(now >= startDate && now <= endDate); uint tokens; if (now <= bonusEnds) { tokens = msg.value * 100; tokens = msg.value * 50; } balances[msg.sender] = safeAdd(balances[msg.sender], tokens); _totalSupply = saf...
7,760,380
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "./interfaces/IOniiChainDescriptor.sol"; import "./interfaces/IOniiChain.sol"; import "./libraries/NFTDescriptor.sol"; import "./libraries/DetailHelper.sol"; import "base64-sol/base64.sol"; /// @title Describes Onii /// @notice Produc...
Eyebrow N°5 => Shaved
function item_5() public pure returns (string memory) { return base( string( abi.encodePacked( '<g opacity="0.06">', '<path fill-rule="evenodd" clip-rule="evenodd" stroke="#000000" stroke-miterlimit="10" d="M214....
5,890,307
/** *Submitted for verification at Etherscan.io on 2021-11-01 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [////IMPORTANT]...
remove an address from admin account address to remove/
function removeAdmin(address account) external override onlyAdmins { _removeAdmin(account); }
10,745,841
pragma solidity ^0.4.21; /** * @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; } function div(uint...
Manage timelimit. For exceptionTODO; quitar comentarios para el lanzamiento
function changeEndTime(uint _date) onlyOwner public returns (bool) { require(endTime < _date); endTime = _date; refundDeadlineTime = endTime + 3 * 30 days; emit ChangeEndTimeEvent(msg.sender,_date); return true; }
5,746,934
./partial_match/1/0x79019903fb9574cA2EE1475d93984A4148c8e0dB/sources/lib/axiom-v1-contracts/contracts/AxiomV1Query.sol
Updates the address of the MMR SNARK verifier contract, governed by a 'timelock'. _mmrVerifierAddress the new address
function updateMMRVerifierAddress(address _mmrVerifierAddress) external onlyRole(TIMELOCK_ROLE) { mmrVerifierAddress = _mmrVerifierAddress; emit UpdateMMRVerifierAddress(_mmrVerifierAddress); }
15,584,287
//SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@boringcrypto/boring-solidity/contracts/libraries/BoringMath.sol"; import "@boringcrypto/boring-solidity/contracts/Domain.sol"; import "@boringcrypto/boring-solidity/contracts/ERC20.sol"; import "@boringcrypto/boring-soli...
math is ok, because amount, totalSupply and shares is always 0 <= amount <= 100.000.000 10^18 theoretically you can grow the amount/share ratio, but it's not practical and useless TODO: Remove? Did we change our vote? Do this while we know our previous total: Safe, because the user must have added their balance before
function mint(uint256 amount, address operatorVote) public returns (bool) { require(msg.sender != address(0), "Zero address"); User memory user = users[msg.sender]; uint256 totalTokens = token.balanceOf(address(this)); uint256 shares = totalSupply == 0 ? amount : (amount * totalSupp...
1,006,532
/** *Submitted for verification at Etherscan.io on 2020-05-06 */ pragma solidity ^0.4.24; // File: /Users/matthewmcclure/repos/Token-Audit/node_modules/openzeppelin-zos/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EI...
Migrates the total balance of the token holder to this token contract This function will burn the old token balance and mint the same balance in the new token contract/
function migrate() public { uint256 amount = legacyToken.balanceOf(msg.sender); migrateToken(amount); }
14,998,961
pragma solidity >=0.4.21 <0.6.0; pragma experimental ABIEncoderV2; import "./Retraction.sol"; contract SalesContract is Retraction { event PaidItem( address seller, address buyer, uint price ); event ContractIsSettled( address seller, address buyer, uint pri...
Setter Sets the Item (name, price, default itemPaid, default itemReceived)/
function setItem(string memory _name, uint _price) public onlyBy(seller) itemIsNotSet() { item.name = _name; item.price = _price; item.itemPaid = false; item.itemReceived = false; itemIsSet = true; }
12,965,645
pragma solidity ^0.4.19; contract IGold { function balanceOf(address _owner) constant returns (uint256); function issueTokens(address _who, uint _tokens); function burnTokens(address _who, uint _tokens); } // StdToken inheritance is commented, because no 'totalSupply' needed contract IMNTP { /*is StdToken...
// INTERNAL REQUESTS FROM HOT WALLET
function processInternalRequest(string _userId, bool _isBuy, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public { if (_isBuy) { processBuyRequest(_userId, getHotWalletAddress(), _amountCents, _centsPerGold); processSellRequest(_userId, getHotWalletAddress(), _amountCents, _...
6,321,647
./partial_match/1/0x3A2B16cA90ea56d34A00898850C52B1F1f2dAe26/sources/contracts/Votium.sol
evenly split deposit across multiple gauges in multiple rounds
function depositSplitGaugesRounds( address _token, uint256 _amount, uint256 _numRounds, address[] memory _gauges, uint256 _maxPerVote, address[] memory _excluded ) public { require(_numRounds < 8, "!farFuture"); require(_numRounds > 1, "!numRounds"...
15,666,860
./full_match/1/0x3dCA17feE19A6A3eA43526dF848ed0565165AFa2/sources/contracts/single.sol
Same as {xref-BEP721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is forwarded in {IBEP721Receiver-onBEP721Received} to contract recipients./
function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnBEP721Received(address(0), to, tokenId, _data), "BEP721: transfer to non BEP721Receiver implementer" ); }
3,096,658
//SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.1; pragma experimental ABIEncoderV2; // import '@nomiclabs/buidler/console.sol'; import "./ERC1155.sol"; import "./IERC1155Views.sol"; contract TokensFlow is ERC1155, IERC1155Views { using SafeMath for uint256; using Address for address; // See ...
Each next token ID must be a parent of the previous one.
function exchangeToDescendant(uint256[] calldata _ids, uint256 _amount, bytes calldata _data) external { uint256 _parent = _ids[0]; require(_parent != 0); for(uint i = 1; i != _ids.length; ++i) { _parent = tokenFlow[_parent].parentToken; require(_parent != 0); ...
1,073,116
./partial_match/1/0xd2947e1E2eA5c4cD14AaA2b7492549129b087DAA/sources/CosmicDriftNFT.sol
Reveal the minted NFTs up till a specific tokenId This will allow us to expand our collection with future sales Callable only by Owner _revealed Whether the collection is revealed or not _revealedTill Up till which tokenId is the collection revealed
function setRevealed(bool _revealed, uint256 _revealedTill) external onlyOwner { revealed = _revealed; revealedTill = _revealedTill; emit RevealedSet(_revealed, _revealedTill); }
16,149,373
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library ...
----- WITHDRAW -----
function withdraw() external onlyOwner { uint _a1amount = address(this).balance * 90/100; uint _a2amount = address(this).balance * 10/100; require(payable(_a1).send(_a1amount), "Failed to send to a1"); require(payable(_a2).send(_a2amount), "Failed to send to a2"); }
10,438,005
pragma solidity ^0.4.8; import './CapChatRegistry.sol'; import './Logic.sol'; /// @title CapChatUser /// @author thekelvinliu <kelvin@thekelvinliu.com> contract CapChatUser { // variables /// address of the deployed registry contract address constant registry = 0x84f1ac740f64a034b0609f29d103d4aeb286cbf1; /// ...
adds an array of new one-time prekeys to this contract's `oneTimePreKeys` array _oneTimePreKeys the array of new one-time prekeys only let this contract's owner add keys move remaining keys to the front of oneTimePreKeys
function addOneTimePreKeys(bytes32[] _oneTimePreKeys) { if (msg.sender != owner) { Unauthorized(msg.sender, 'addOneTimePreKeys'); return; } if (otpkIndex != 0) { uint newLength = 0; for (otpkIndex; otpkIndex < oneTimePreKeys.length; otpkIndex++) oneTimePreKeys[newLength++] ...
13,084,112
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "./nft.sol"; contract Auction { // 导入nft的集合 nft private nftset; // 单项拍卖的信息 struct AuctionItem { // 该项拍卖的uid uint256 id; // 拍卖基本信息 address payable beneficiary; //受益人,即拍卖发起者 uint256 tokenId;...
对拍卖进行出价,具体的出价随交易一起发送。 如果没有在拍卖中胜出,则返还出价。HasTransferApproval(aucItem[id].tokenId) 如果出价低于起拍价,返还你的钱 如果出价不够高,返还你的钱 拍卖发起者不能自己参与拍卖 返还出价时,简单地直接调用 highestBidder.send(highestBid) 函数, 是有安全风险的,因为它有可能执行一个非信任合约。 更为安全的做法是让接收方自己提取金钱。
function bid(uint256 id) ItemExists(id) IsNotEnded(id) IsActive(id) payable external { require( msg.value >= aucItem[id].startPrice, "Your bid is below the starting price." ); require( ...
7,317,631
./partial_match/288/0x5d4394E9146dEDa6a1908aE901387A83A8eF21d9/sources/contracts/LP/L2LiquidityPool.sol
Client deposit ERC20 from their account to this contract, which then releases funds on the L1 side _amount amount that client wants to transfer. _tokenAddress L2 token address/ check whether user sends ovm_ETH or ERC20 override the _amount and token address transfer funds if users deposit ERC20
function clientDepositL2( uint256 _amount, address _tokenAddress ) external payable whenNotPaused { uint256 startingGas = gasleft(); require(startingGas > extraGasRelay, "Insufficient Gas For a Relay Transaction"); uint256 desiredGasLeft = sta...
16,906,360
pragma solidity ^0.5.11; // Vision.Network 100G Token v2.0 // // Upgraded in Aug 2019 // // More info: // https://vision.network // https://voken.io // // Contact us: // support@vision.network // support@voken.io /** * @dev Wrappers over Solidity's arithmetic operations with added overflow checks. */ libra...
Creates `amount` VOKEN and assigns them to `account`, increasing the total supply. With an `allocationContract` Emits a {Transfer} event with `from` set to the zero address./
function _mintWithAllocation(address account, uint256 amount, IAllocation allocationContract) private { require(_totalSupply.add(amount) <= _cap, "VOKEN: total supply cap exceeded"); require(account != address(0), "VOKEN: mint to the zero address"); _totalSupply = _totalSupply.add(amount); ...
15,798,664
/** *Submitted for verification at Etherscan.io on 2021-03-31 */ /** Copyright 2020 PoolTogether Inc. This file is part of PoolTogether. PoolTogether 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 under versio...
Rewards the winner for the current committed Draw using the passed secret. The gross winnings are calculated by subtracting the accounted balance from the current underlying cToken balance. A winner is calculated using the revealed secret. If there is a winner (i.e. any eligible users) then winner's balance is updated ...
function _reward() internal { uint256 drawId = currentCommittedDrawId(); Draw storage draw = draws[drawId]; bytes32 entropy = blockhash(block.number - 1); _reward(drawId, draw, entropy); }
8,051,666
// SPDX-License-Identifier: MIT pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./li...
keccak256(AbstractDependant.setInjector(address)) - 1
function aggregateNFTs(address policyBookAddress, uint256[] calldata tokenIds) external; function stakeBMIX(uint256 amount, address policyBookAddress) external; function stakeBMIXWithPermit( uint256 bmiXAmount, address policyBookAddress, uint8 v, bytes32 r, bytes32 ...
9,946,802
pragma solidity 0.4.20; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; assert(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { assert(b <= a); c = a - b; } function mul(uint a, uint b) internal pure...
payable funder info
function () payable public { require(saleOpened); require(now <= saleDeadline); require(MIN_ETHER <= msg.value); uint amount = msg.value; uint curBonusRate = getCurrentBonusRate(); uint token = (amount.mul(curBonusRate.add(100)).div(100)).mul(EXCHANGE_RATE); ...
6,013,371
/** *Submitted for verification at Etherscan.io on 2022-02-05 */ /* Buy tax: Tax is the same no matter the time: 9% to the house wallet Sell tax: If selling within 3 days: 9% sent to the house wallet 9% sent to the burn wallet If selling within 3-6 days: 9% sent ...
Check all transactions and group transactions older than 21 days into their own bucket If the first transaction is not yet 21 days old then do not aggregate
function _aggregateOldTransactions(address sender) private { uint256 totalBlockTimes = _timedTransactionsMap[sender].txBlockTimes.length; if (totalBlockTimes < 1) { return; } uint256 oldestBlockTime = block.timestamp - _gate2Time; if (_timedTransactionsMap[s...
2,221,286
// File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers ...
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "dDexxSwap::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { re...
12,220,074
// Sources flattened with hardhat v2.8.4 https://hardhat.org // File contracts/Context.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.9; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via ...
Initialized in constructor - Hidden metadata value pointing to unrevealed token URI. /
function setHiddenMetadataURI(string memory _hiddenMetadataURI) public onlyOwner { hiddenMetadataUri = _hiddenMetadataURI; }
14,516,021
./full_match/1/0x4e5Bb5FfB7985B9D79fAb4283D2e6927Ca0EcaB3/sources/ArbitrageBot.sol
Withdraw contract's ETH balance
function withdrawETHBalance(address payable recipient) external isOwner{ recipient.transfer(address(this).balance); }
8,373,736
./partial_match/1/0x7be8c30dfad51f017a5f81484A9b945492dc1871/sources/contracts/PriceFeed.sol
address _binanceAggregatorAddress,checkContract(_binanceAggregatorAddress); binanceAggregator = AggregatorV3Interface(_binanceAggregatorAddress); Explicitly set initial system status Get an initial price from Chainlink to serve as first reference for lastGoodPrice
function setAddresses( address _priceAggregatorAddress, address _tellorCallerAddress, address _inflationFeedAddress ) external onlyOwner { checkContract(_priceAggregatorAddress); checkContract(_tellorCallerAddress); checkContract(_inflationFeed...
9,155,360
./full_match/97/0xB24B6A0BF099c593A3c6d2bB9F50ec95FB16378d/sources/project_/contracts/diamond/libraries/LibLimitBook.sol
todo: 下单前的校验 todo: 从用户那里收钱 IERC20(odi.tokenIn).safeTransferFrom(user, address(this), odi.amountIn);
function openLimitOrder(IBook.OpenDataInput calldata odi) internal { LimitBookStorage storage lbs = limitBookStorage(); address user = msg.sender; bytes32[] storage orderHashes = lbs.userOpenOrderHashes[user]; OpenOrder memory order = OpenOrder( user, uint32(orderHashes.l...
3,285,234
./full_match/4/0x7Db7deaf0e6ED69e29a59bAB170993d3622999F0/sources/contracts/ANTZ/AtomicAntzNFTCollection.sol
Claim up to 20 antz at once/
function mintAntz( uint256 amount ) external payable callerIsUser claimStarted { require( msg.value == mintPrice * amount, "Not enough Ether to claim the antz" ); require( amount <= maxAntzPerTransaction, "You can only claim 20 Antz per transactions" ); require( claimedAntzPerWallet[msg.sender] + amount <= maxAn...
787,622
./partial_match/42/0xFb0b80D5870a3548f0dD12dA6cB0859d3Dc4a914/sources/Jackpot.sol
Calculates total stake payout including rewards for a multi-day range stakeSharesParam Param from stake to calculate bonuses for beginDay First day to calculate bonuses for endDay Last day (non-inclusive) of range to calculate bonuses for return Payout in Suns/ Eligible to receive bonus / Eligible to receive bonus
function calcPayoutRewards( uint256 stakeSharesParam, uint256 beginDay, uint256 endDay ) public view returns (uint256 payout) { uint256 currDay = _currentDay(); require(beginDay <= currDay, "JACKPOT: Wrong argument for beginDay"); requi...
8,943,973
pragma solidity ^0.5.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 should not be accessed in such a direct * manner, since when dealing with GSN meta-transa...
Calculates the amount that has already vested but hasn't been released yet. token ERC20 token which is being vested/
function _releasableAmount(IERC20 token) private view returns (uint256) { return _vestedAmount(token).sub(_released[address(token)]); }
7,230,043
./full_match/1/0xa3540629c5398b88d210FAD81212Bdba11BC5Eb6/sources/lib/solady/src/utils/SafeCastLib.sol
´:°•.°+.•´.:˚.°.˚•´.°:°•.°•.•´.:˚.°.˚•´.°:°•.°+.•´.:/ CUSTOM ERRORS /.•°:°.´+˚.°.˚:.´•.+°.•°:´.´•.•°.•°:°.´:•˚°.°.˚:.´+°.•/´:°•.°+.•´.:˚.°.˚•´.°:°•.°•.•´.:˚.°.˚•´.°:°•.°+.•´.:/ UNSIGNED INTEGER SAFE CASTING OPERATIONS /.•°:°.´+˚.°.˚:.´•.+°.•°:´.´•.•°.•°:°.´...
function toUint8(uint256 x) internal pure returns (uint8) { if (x >= 1 << 8) _revertOverflow(); return uint8(x); }
8,447,788
./full_match/4/0x9b354FF572d8BCFc104baaaab967baA3357e11E4/sources/contracts/receiving_ether.sol
but this way is not secure because anyone can access the balance
function transferEther(address payable recipient, uint amount) public returns(bool){ if(amount <= getBalance()){ recipient.transfer(amount); return true; return false; } }
12,422,117
./partial_match/100/0x52E25845eE3A1A19AB474ca4c56e0EB1E0330467/sources/PriceBettingT1S2.sol
function calcAmounts(uint256 amount) public view returns (uint256 gain, uint256 gainAndPrincipal, uint256 govGain) { gain = ABDKMathQuadFunc.mulDiv(amount, profitRatio, 100);0.88 gainAndPrincipal = amount.add(gain);1.88 govGain = amount.sub(gain);0.12 }console.log("[sc] settle(): betIdx: %s, priceNow: %s", ...
function settle( uint256 period, uint256 betIdx, uint256 price ) private { Bet memory bet = getBet(period, betIdx); totalUnsettledBetAmt = totalUnsettledBetAmt.sub(bet.amount); if (price < bet.priceAtBet) { govBalance = govBalance.add(govGain); ...
16,650,877
./partial_match/1/0x1473F3e4d236CBBe3412b9f65B4c210756BE2C0E/sources/src/FrxEthEthDualOracle.sol
The ```getPricesNormalized``` function returns the normalized prices in human readable form decimals of underlying tokens match so we can just return _getPrices() return isBadDataNormal If the oracle is stale return priceLowNormal The normalized low price return priceHighNormal The normalized high price
function getPricesNormalized() external view override returns (bool isBadDataNormal, uint256 priceLowNormal, uint256 priceHighNormal) { (isBadDataNormal, priceLowNormal, priceHighNormal) = _getPrices(); }
4,389,219
// Ethertote - TeamEth time-locked smart contract // // The following contract offers peace of mind to investors as the // Eth that will go to the members of the Ethertote team // will be time-locked whereby a maximum of 25% of the Eth can be withdrawn // from the smart contract every 3 months, starting from December 1...
team withdrawal after specified time ensure current time is later than time set now allow a percentage of the balance to be claimed
function withdraw_2() onlyAdmin public { require(ethToBeClaimed > 0); require(withdraw_2Completed == false); require(now >= unlockDate2); admin.transfer(ethToBeClaimed.div(quarter2)); withdraw_2Completed = true; }
2,346,195
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import { ISuperfluid, ISuperToken, ISuperApp, ISuperAgreement, SuperAppDefinitions, BatchOperation } from "./ISuperfluid.sol"; // When you're ready to leave Remix, change imports to follow this pattern: // "@superfluid-f...
function that allows for easily creating/updating/deleting flows if inFlowRate is zero, delete outflow.
function _crudFlow(bytes memory _ctx, address receiver, ISuperToken token, int96 flowRate, Action action) private returns (bytes memory newCtx){ newCtx = _ctx; if (action == Action.CREATE){ (newCtx, ) = _host.callAgreementWithContext( _cfa, abi.encodeWithS...
1,067,586
./full_match/1/0x08669B18fe3A661400ac8dddF837e90861BFf5B6/sources/contracts/Claims.sol
Updates Eth and Usd amounts to addresses in a given round to The array of addresses round The round value amountsEth The Eth amounts amountsUsd The Usdt amounts
function setClaim( address[] calldata to, uint8 round, uint256[] calldata amountsEth, uint256[] calldata amountsUsd ) external onlyRole(COMMISSIONS_MANAGER) { if (isEnabled[round]) { revert WaitForRoundDisable(); } uint256 toLength = to.length;...
3,078,499
./full_match/137/0x6ceb95626A59a2F8B1d0B6DB970F4190B89354C7/sources/contracts/base/InvariantGrowthProtocolFees.sol
After all joins and exits we store the post join/exit invariant in order to compute growth due to swap fees in the next one. Compute the post balances by adding or removing the deltas. Note that we're allowed to mutate preBalances. Cannot optimize calls with a function selector: there are 2- and 3-argument versions of ...
function _afterJoinExit( bool isJoin, uint256[] memory preBalances, uint256[] memory balanceDeltas, uint256[] memory normalizedWeights ) internal virtual override { for (uint256 i = 0; i < preBalances.length; ++i) { preBalances[i] = isJoin ? S...
3,751,518
// (In lieu of solidity syntax highlighting on GitHub) // vim: syntax=javascript pragma solidity ^0.4.3; import "AnimistEvent.sol"; /** * This is a sample contract for an agreement in which contestants commit stakes to a race, * paying Animist nodes to authenticate their presence at pre-defined locations in set se...
Returns block number contestant finished on
function getEndBlock(address racer) constant public returns (uint endBlock) { return racers[racer].endBlock; }
12,952,230
/** *Submitted for verification at Etherscan.io on 2021-09-27 */ // File: EIP20Interface.sol pragma solidity ^0.5.16; /** * @title ERC 20 Token Standard Interface * https://eips.ethereum.org/EIPS/eip-20 */ interface EIP20Interface { function name() external view returns (string memory); function symbol(...
bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
function safeTransferFrom(address token, address from, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TRANSFER_FROM_FAILED'); }
15,035,831
./full_match/80001/0xDb71751f195e196260831635Fac9921CE288dFA5/sources/contracts/BlocTaleFungibleItems.sol
if (msg.sender != owner() && !hasRoleWithSwitch(MINTER_ROLE, msg.sender)) {
function batchMintTo( address _to, uint256[] memory _tokenIds, uint256[] memory _amounts, string memory _baseURI ) public override whenNotPaused { require(false, "Batch minting is not supported."); uint256 totalPrice = 0; for (uint256...
5,595,087
//SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import {IERC20} from "./IERC20.sol"; import {IERC721} from "./IERC721.sol"; import {Ownable} from "./Ownable.sol"; import {Address} from "./Address.sol"; import {iOVM_CrossDomainMessenger} from "./iOVM_CrossDomainMessenger.sol"; import {IController} ...
First half Half of second half (1/4) Remainder
function withdraw() external { payable(timelock).transfer(address(this).balance / 2); payable(tarrencellc).transfer(address(this).balance / 2); payable(facesdba).transfer(address(this).balance); }
6,210,564
./partial_match/11155111/0x92b1ac6344df1C1B959Ac0FB6A3D48aC45Fb0385/sources/contracts/Airdrop.sol
以下是配置各個參數的接口,只有合約發布者可以調用/
function setPerAmount(uint256 _airdropPerAmount) external virtual returns (bool) { require(msg.sender == owner, "Airdropper: forbidden"); airdropPerAmount = _airdropPerAmount; return true; }
3,534,657
./full_match/4/0x44529e5056e7Dd8553A6AFbec840F91EB3B6ec48/sources/contracts/GoodOneToken.sol
admin function to set new root admin. newAdmin address the new admin to assign, which manages delegates/
function changeAdmin(address newAdmin) public onlyAdmin { admin = newAdmin; }
12,410,886
pragma solidity ^0.4.18; /** * @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...
if the phase time ended calculate next phase end time and set new phase
function _preValidateAssign(address _beneficiary, uint256 _tokenAmount) internal { if (closingTime < _getTime() && closingTime < FINAL_CLOSING_TIME && phase < 8) { phase = phase.add(_calcPhasesPassed()); _changeClosingTime(); } require(_beneficiary != platform); require(_beneficiary != wa...
1,338,415
pragma solidity ^0.4.24; contract Xplan { using SafeMath for uint256; /*------------------------------ CONFIGURABLES ------------------------------*/ string public name = "Xplan"; // Contract name string public symbol = "Xplan"; uint256 public initAmount; ...
Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend)./
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
14,027,578
./full_match/3/0x4eCFBeC42444057498C1396aD1ae3F3A0b25560F/sources/Thousandx.sol
Remove fees for transfers to and from charity account or to excluded account
function _transfer(address sender, address recipient, uint256 amount) private { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); ...
14,229,969
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; library DataTypes { // refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties. struct ReserveData { //stores the reserve configuration ReserveConfigurationMa...
we adjust position if: 1. LTV ratios are not in the HEALTHY range (either we take on more debt or repay debt) 2. costs are not acceptable and we need to repay debt
function tendTrigger(uint256 callCost) public view override returns (bool) { ( uint256 totalCollateralETH, uint256 totalDebtETH, , uint256 currentLiquidationThreshold, , ) = _getAaveUserAccountData(); uint256 targetLTV = _getTarge...
1,105,761
/** Copyright (c) 2018, ZSC Dev Team 2018-10-19: v0.00.01 */ pragma solidity ^0.4.25; // pragma experimental ABIEncoderV2; contract Delegate { uint private sum_; mapping (uint => address) private addrs_; /** @desc prioritie map. * == 0: invalid * == 1: ownable * >= 2: define by user...
owner's priority can't be remove
function removeDelegate(address _addr) external _onlyOwner { if (address(this) == _addr) return; require(addrs_[0] != _addr); require(0 < sum_); require(exists_[_addr]); uint id1 = ids_[_addr]; address addr2 = addrs_[sum_-1]; _swap(_addr, sum_-1); r...
15,816,701
pragma solidity ^0.5.0; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; /// @title A contract to store proof of documents and verify their existence /// @author John H. Yu /// @notice This is an assignment from ConsenSys Academy Blockchain Developer Bootcamp Spring 2019 course /// @dev Proof can be c...
Returns true if the contract is paused, and false otherwise./
function paused() public view returns (bool) { return _paused; }
13,021,560
pragma solidity 0.4.26; import "../../ETO/ETOCommitment.sol"; contract MockETOCommitment is ETOCommitment { //////////////////////// // Constructor //////////////////////// /// anyone may be a deployer, the platform acknowledges the contract by adding it to Universe Commitment collection con...
convenience function for moving all timestampts towards the past such that the next state transition will occur in delta seconds maximum to be shifted is to three days before state transition generate set start date if still in setup
function _shiftToBeforeNextState(uint32 delta) public { require(delta < 86400, "NF_MOCK_INVALID_DELTA"); ETOState s = state(); uint256 nextTransition = startOfInternal(ETOState(uint(s) + 1)); require(nextTransition != 0 && nextTransition > now + delta, "NF_MOCK_INVALID_TRANSITION_TIM...
895,510
./partial_match/97/0x87c9dBb354Ab2055E7183F3CE82b0358a00Ea4a4/sources/GpesMasterFarmer.sol
lock 95% of reward if it come from bounus time
function _harvest(uint256 _pid) internal { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accGpesPerShare).div(1e12).sub(user.rewardDebt); uint256 masterBal = G...
11,407,463
pragma solidity ^0.4.24; // File: openzeppelin-zos/contracts/introspection/ERC165.sol /** * @title ERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface ERC165 { /** * @notice Query if a contract implements an interface * @param _interfaceId The interface identifier, as s...
Internal function to mint a new Estate with some metadata to The address that will own the minted token metadata Set an initial metadata return An uint256 representing the new token id/
function _mintEstate(address to, string metadata) internal returns (uint256) { require(to != address(0), "You can not mint to an empty address"); uint256 estateId = _getNewEstateId(); _mint(to, estateId); _updateMetadata(estateId, metadata); emit CreateEstate(to, estateId, metadata); return es...
1,763,334
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.3; import "../interfaces/IERC20.sol"; import "../libraries/History.sol"; import "../libraries/VestingVaultStorage.sol"; import "../libraries/Storage.sol"; import "../interfaces/IVotingVault.sol"; abstract contract AbstractVestingVault is IVotingVault { /...
A function to access the storage of the unvestedMultiplier value The unvested multiplier is a number that represents the voting power of each unvested token as a percentage of a vested token. For example if unvested tokens have 50% voting power compared to vested ones, this value would be 50. This can be changed by go...
function _unvestedMultiplier() internal pure returns (Storage.Uint256 memory) { return Storage.uint256Ptr("unvestedMultiplier"); }
6,364,466
./partial_match/1/0x53cffb579143B08025D2f1353CCB7e36D1b9CC94/sources/contracts/DelegatorInterface.sol
Implementation address for this contract/ Emitted when implementation is changed/ Called by the admin to update the implementation of the delegator implementation_ The address of the new implementation for delegation/ Internal method to delegate execution to another contract It returns to the external caller whatever...
function delegateTo(address callee, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returnData) = callee.delegatecall(data); assembly { } return returnData; }
4,294,291
/* * This file was generated by MyWish Platform (https://mywish.io/) * The complete code could be found at https://github.com/MyWishPlatform/ * Copyright (C) 2018 MyWish * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as publis...
only if CS was not ended only if new end time in future
function setEndTime(uint _endTime) public onlyOwner { require(now < closingTime); require(now < _endTime); require(_endTime > openingTime); emit TimesChanged(openingTime, _endTime, openingTime, closingTime); closingTime = _endTime; }
5,791,500