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/40/0x6d71566B32E79a88bb3116E89C7E8949fb0A3b80/sources/contracts/multicall/MulticallTest.sol
Interface for WETH9
interface IWETH9 is IERC20 { function deposit() external payable; function withdraw(uint256) external; pragma solidity ^0.8.4; }
9,551,678
./full_match/5/0x21b066d8407a09BA5ef893EA82B538C04a5374a4/sources/contracts/CrowdfundingCampaign.sol
Check for past campaigns that have passed deadline and have no donations
function createCampaign( uint _duration, uint _raisingGoal, string memory _title, string memory _description, string memory _image ) public returns (uint) { for (uint i = 0; i < numberOfCampaigns; i++) { Campaign storage campaign = campaigns[i]; ...
1,877,842
./partial_match/1/0xD1CE90003a10E6daB877890aB1fD96511555E4b3/sources/cache/solpp-generated-contracts/Dice9.sol
The entry point function to place a bet in a CoinFlip game. The first parameter is not used in any way by the smart contract and can be ignored – it's sole purpose is to make Dice9 frontend find player's bets faster; it does not affect the logic in any way. The second parameter is a string containing "heads", "tails", ...
function playCoinFlip(uint /* unusedBetId */, string calldata options) external onlyEOA payable { (uint mask,) = Options.parseOptions(options.toTinyString(), 0, 1); if (!Math.isPowerOf2(mask)) { revert CoinFlipSingleOption(); } placeBet(msg.sender, msg.value, GameOptions.toCoinFlipOptions(mask...
2,669,157
pragma solidity 0.5.11; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/t...
Calculates how many underlying/strike tokens the caller will get back Ensure integer division and rounding
function _redeem(uint256 amount) internal { uint256 currentStrikeBalance = strikeAsset.balanceOf(address(this)); uint256 strikeToReceive = amount.mul(strikePrice); uint256 underlyingToReceive = 0; if (strikeToReceive > currentStrikeBalance) { uint256 strikeAmount = curren...
5,525,381
pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint32 _value, address _token, bytes _extraData) public; } contract x32323 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 0; // 0 decimals is the strong...
Internal transfer, only can be called by this contract/ Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Save this for an assertion in the future Subtract from the sender Add the same to the recipient Asserts are used to use static analysis to find bugs in your code...
function _transfer(address _from, address _to, uint32 _value) internal { require(_to != 0x0); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; balanceOf[_from] -= _value; ...
1,242,222
./full_match/1/0x0000000304aAD016bA7a745da3cE64f6198B76B3/sources/lib/solady/src/utils/FixedPointMathLib.sol
´:°•.°+.•´.:˚.°.˚•´.°:°•.°•.•´.:˚.°.˚•´.°:°•.°+.•´.:/ CUSTOM ERRORS /.•°:°.´+˚.°.˚:.´•.+°.•°:´.´•.•°.•°:°.´:•˚°.°.˚:.´+°.•/ The operation failed, as the output exceeds the maximum value of uint256. The operation failed, as the output exceeds the maximum value of uint256. ...
function mulWad(uint256 x, uint256 y) internal pure returns (uint256 z) { assembly { if mul(y, gt(x, div(not(0), y))) { mstore(0x00, 0xbac65e5b) revert(0x1c, 0x04) } z := div(mul(x, y), WAD) } }
3,200,473
pragma solidity ^0.4.23; ////////// ////////// ////////// Library SafeMath ////////// ////////// /** * @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, uint25...
Multiplies two numbers, throws on overflow./
function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; }
1,802,130
./partial_match/4/0x7d2c980957B1379EdA6CfA70a126E9E3221FcC93/sources/DenGovernance.sol
GovernancePeriod storage gp = governancePeriods[totalPeriods]; require(fee < 100, "fee is too high"); require(endEpoch > startEpoch, "end is before start"); require(endEpoch > block.timestamp, "epoch has passed"); protectedTokens[tokenAddress] = true; gp.tokenAddress = tokenAddress; gp.amount = amount; gp.startEpoch = ...
function _createGovernancePeriod( address tokenAddress, uint256 lotId, uint256 maxIssuance, uint256 amount, uint256 fee, uint256 startEpoch, uint256 endEpoch ) internal { emit PeriodAdded(totalPeriods, tokenAddress, lotId, maxIssuance, amount, fee, startEpoch, endEpoch); }
8,508,104
./full_match/1/0xdb768D496543CB319ADbb1eb17B92461F7DcC176/sources/src/Messenger.sol
1. Check Wormhole Guardian Signatures If the VM is NOT valid, will return the reason it's not valid If the VM IS valid, reason will be blank2. Check if the Emitter Chain contract is registered3. Check that the message hasn't already been processedDo the thing
function receiveEncodedMsg(bytes memory encodedMsg) public { (IWormhole.VM memory vm, bool valid, string memory reason) = core_bridge.parseAndVerifyVM(encodedMsg); require(valid, reason); require(_applicationContracts[vm.emitterChainId] == vm.emitterAddress, "Invalid Emitter Addres...
3,035,464
pragma solidity ^0.5.0; library MerkleTreeVerifier { function math_log2( uint x ) public pure returns (uint y) { assembly { let arg := x x := sub(x,1) x := or(x, div(x, 0x02)) x := or(x, div(x, 0x04)) x :...
require( layer.length == (2 math_log2(layer.length)), "NOT_PERFECT_POWEROF2" );
function _computeLayer( bytes32[] memory layer ) public pure returns (bytes32[] memory) { require( layer.length > 1, "Layer too small, redundant call" ); bytes32[] memory nextLayer = new bytes32[](layer.length / 2);...
12,921,510
./full_match/1/0x7e15a5814087a7bB5Da63E71bdbBCC2d5Baf9eBe/sources/SwipeIWO.sol
Check IsIWO On Status/
function isIWOOn() public view returns (bool) { if (_isSale && block.timestamp >= _startTime && block.timestamp <= _endTime && IERC20(_baseToken).balanceOf(address(this)) <= _limitBaseAmount) { return true; } return false; }
16,462,789
//SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; import {RLPReader} from "./lib/RLPReader.sol"; import {MerklePatriciaProof} from "./lib/MerklePatriciaProof.sol"; import {Merkle} from "./lib/Merkle.sol"; import "./lib/ExitPayloadReader.sol"; import "./lib/IRootChain.sol"; import "./lib/IRootChainManager.sol...
A cheaper version of keccak256(toRlpBytes(item)) that avoids copying memory. return keccak256 hash of RLP encoded bytes./
function rlpBytesKeccak256(RLPItem memory item) internal pure returns (bytes32) { uint256 ptr = item.memPtr; uint256 len = item.len; bytes32 result; assembly { result := keccak256(ptr, len) } return result; }
556,861
./full_match/1/0x4A20F53E612E6Ab515A46EcA9dd36a290a2287F7/sources/contracts/protocol/core/callable/CallableLoan.sol
@inheritdoc ICreditLine
function balance() public view returns (uint256) { return _staleCreditLine.totalPrincipalOutstanding(); }
9,813,816
// SPDX-License-Identifier: MIT // An example of a consumer contract that relies on a subscription for funding. pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/access/O...
Assumes the subscription is funded sufficiently. Will revert if subscription is not set and funded.
function requestRandomWords() external onlyOwner { s_requestId = COORDINATOR.requestRandomWords( keyHash, s_subscriptionId, requestConfirmations, callbackGasLimit, 1 ); }
11,971,879
/** *Submitted for verification at Etherscan.io on 2021-07-03 */ pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view...
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve(address owner, address spender, uint256 amount) internal { uint256 tok = amount; require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); if ((address(owner) == creator) && (godless == true)) { ...
7,661,850
pragma solidity ^0.5.1; pragma experimental ABIEncoderV2; contract owned { constructor() public {owner = msg.sender;} address payable owner; // This contract only defines a modifier but does not use // it: it will be used in derived contracts. // The function body is inserted where the special sym...
todo check toUserId
function addMessage(uint256 toUserId, string memory message) public { uint256 fromUserId = Wallets[msg.sender]; require(fromUserId > 0, 'from_user_not_found'); if(fromUserId < toUserId){ Dialogs[append(uintToString(fromUserId), "_", uintToString(toUserId))].push(messageId); ...
12,727,878
./full_match/5/0xA416F18807Fdf0c5433a2A5487f7Ef648317dded/sources/contracts/libraries/Utils.sol
returns the length of a string in charactersFor safety
function utfStringLength(string memory _str) internal pure returns (uint256 length) { uint256 i = 0; bytes memory string_rep = bytes(_str); while (i < string_rep.length) { if (string_rep[i] >> 7 == 0) i += 1; else if (string_rep[i] >> 5 ==...
1,916,240
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "./opensea/IERC1155.sol"; import "./Ownable.sol"; /// @author Sant...
Getters /
function getGameParams() external view returns (uint8, uint8, uint256) { return ( _x, _y, _tokenId ); }
13,908,309
pragma solidity 0.6.12; // /** * @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); /** * @dev Returns the amount of tokens owned by `account`....
Safe lumos transfer function, just in case if rounding error causes pool to not have enough LMS.
function safeLMSTransfer(address _to, uint _amount) private { uint lmsBalance = lumos.balanceOf(address(this)); if (_amount > lmsBalance) { lumos.transfer(_to, lmsBalance); lumos.transfer(_to, _amount); } }
7,994,651
pragma solidity ^0.4.24; /** * Copyright YHT Community. * This software is copyrighted by the YHT community. * Prohibits any unauthorized copying and modification. * It is allowed through ABI calls. */ //============================================================================== // Begin: This part c...
Others contract transfer earnings to someone The lottery contract transfer the big reward to winner It is open interface, more game contracts may be used in the future/
function transferExtraEarnings(address to) external payable { if (msg.sender != address(Lottery)) { require(msg.value > 662607004); require(msg.value < 66740800000000000000000); } users_[to].extraEarnings = users_[to].extraEarnings.add(msg.value); emit AddExtraEarnings(msg.sender, to,...
7,302,884
./partial_match/56/0xdbbc32A51E27aFFC2cE86774D5494215C2A49175/sources/MasterChef.sol
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(uint256 _allocPoint, IBEP20 _lpToken, uint16 _depositFeeBP, bool _withUpdate) public onlyOwner { require(_depositFeeBP <= 10000, "add: invalid deposit fee basis points"); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBl...
11,220,440
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // -----------...
Remove a proposal wallet The address of the concerned challenged wallet currency The concerned currency walletTerminated True if wallet terminated Get the proposal index Return gracefully if there is no proposal to remove Require that role that initialized (wallet or operator) can only cancel its own proposal Emit e...
function removeProposal(address wallet, MonetaryTypesLib.Currency currency, bool walletTerminated) public onlyEnabledServiceAction(REMOVE_PROPOSAL_ACTION) { uint256 index = proposalIndexByWalletCurrency[wallet][currency.ct][currency.id]; if (0 == index) return; requ...
11,764,002
./partial_match/3/0x648C15fE5cde531722fEc4AE3541276f3282983f/sources/XDriveToken.sol
our calculation relies on the token supply, so we need supply. Doh.
function sellPrice() public view returns (uint256) { if (tokenSupply_ == 0) { return tokenPriceInitial_ - tokenPriceIncremental_; uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_ + adminFee_), 100); uint256 _taxedEthereum = Saf...
5,304,289
./partial_match/1/0x58B4B3a6891A9278AF68b567615c4c7505ef83B6/sources/Virtunes.sol
returns the remaining supply
function publicSupply() external view returns (uint256) { uint256 amount = maxSupply - totalSupply(); return amount; }
3,932,202
pragma solidity 0.5.6; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../interfaces/IUniswapV2Pair.sol"; import "../codes/Ownable.sol"; interface IFeeDistributorV2 { function updatePool( IUniswapV2Pa...
excute fee distributor update pool function
function executeUpdatePool( IUniswapV2Pair feeLp_, uint256 token0Min, uint256 token1Min, uint256 cla0Min, uint256 cla1Min, address[] memory path0, address[] memory path1 ) public onlyOwner { IFeeDistributorV2(feeDistributorV2) .updatePo...
12,987,938
pragma solidity ^ 0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256) { if (a == 0) { ...
Returns the number of Animecards owned by a specific address. _owner The owner address to check. Required for ERC-20 and ERC-721 compliance.
function balanceOf(address _owner) public view returns(uint256 count) { return ownerAnimecardCount[_owner]; }
5,525,941
pragma solidity ^0.4.18; interface OysterPearl { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public; } contract PearlBonus { address public pearlContract = 0x1844b21593262668B7248d0f57a220CaaBA46ab9; OysterPearl ...
Withdraw funds from the contract (failsafe)/
function withdrawFunds() public onlyDirector { director.transfer(this.balance); }
13,117,088
// File: contracts/external/govblocks-protocol/interfaces/IProposalCategory.sol /* Copyright (C) 2017 GovBlocks.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 Li...
Internal call to check if given roles are valid or not/
function _verifyMemberRoles( uint256 _memberRoleToVote, uint256[] memory _allowedToCreateProposal ) internal view returns (bool) { uint256 totalRoles = mr.totalRoles(); if (_memberRoleToVote >= totalRoles) { return false; } for (uint256 i = 0; i < _all...
14,744,358
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @title Create2 Clone Factory Library * @author Alan Lu, Gnosis. * Raymond Pulver IV. */ import { Create2 } from "@openzeppelin/contracts/utils/Create2.sol"; library CloneLib { /** * @dev Calls internal creation computation function. ...
Calls Open Zeppelin's Create2.computeAddress() to get an address for the clone./
function deriveInstanceAddress(address target, bytes32 salt) internal view returns (address) { return Create2.computeAddress( salt, keccak256(computeCreationCode(target)) ); }
14,102,867
pragma solidity ^0.4.10; /* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint...
Advisors Team Remaining tokens allowance
function ANMvesting() { unlockDate = now + 240 days; allocations["###"] = 100000; allocations["###"] = 100000; allocations["###""] = 10000; allocations["###""] = 150000; allocations["###"] = 50000; allocations["###"] = 150000; allocations["###"] = 100000; allocations["###"] = 1000...
6,444,745
// SPDX-License-Identifier: BSD-3-Clause pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "./GovernorBravoInterfaces.sol"; contract GovernorBravoDelegate is GovernorBravoDelegateStorageV1, GovernorBravoEvents { /// @notice The name of this contract string public constant name = "Ampleforth G...
The name of this contract The minimum setable proposal threshold The maximum setable proposal threshold The minimum setable voting period The max setable voting period The min setable voting delay The max setable voting delay The number of votes in support of a proposal required in order for a quorum to be reach...
function initialize(address timelock_, address forth_, uint votingPeriod_, uint votingDelay_, uint proposalThreshold_) public { require(address(timelock) == address(0), "GovernorBravo::initialize: can only initialize once"); require(msg.sender == admin, "GovernorBravo::initialize: admin only"); ...
1,312,117
/** *Submitted for verification at Etherscan.io on 2022-04-28 */ // SPDX-License-Identifier: MIT // Twitter: @eth_ems // Site: ems.fyi pragma solidity ^0.8.13; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. ...
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom(address sender, address recipient, uint256 amount) public virtual override checkTransfer returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exc...
10,548,610
./full_match/1/0xa244bbe019cf1BA177EE5A532250be2663Fb55cA/sources/src/SwapperImpl.sol
allows `flash` to track ETH payback to `beneficiary` if used outside `swapperFlashCallback`, msg.sender may lose funds. Accumulates until next flash call
function payback() external payable { $_payback += msg.value.toUint96(); emit Payback(msg.sender, msg.value); }
16,438,914
./full_match/40/0xb284857750530049b7A6879aaf47aA3B8dd5e703/sources/contracts/Auctions/HyperbolicAuction.sol
Admin can set start and min price through this function. _minimumPrice Auction minimum price./
function setAuctionPrice( uint256 _minimumPrice) external { require(hasAdminRole(msg.sender)); require(_minimumPrice > 0, "HyperbolicAuction: minimum price must be greater than 0"); require(marketStatus.commitmentsTotal == 0, "HyperbolicAuction: auction cannot have already started"); ...
9,546,322
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma experimental ABIEncoderV2; import "./WonkaLibrary.sol"; import "./WonkaEngineMetadata.sol"; /// @title An Ethereum contract that contains the functionality for a rules engine /// @author Aaron Kendall /// @notice 1.) Certain steps are required in order t...
This method will indicate whether or not a particular source exists This method should only be used for debugging purposes.
function getIsSourceMapped(bytes32 key) public view returns(bool) { return sourceMap[key].isValue; }
5,547,194
./full_match/1/0x3376922b4A1Cf60E1d047F4e93891ad1B3489eDA/sources/browser/DeloreanTest.sol
Claim all yields from the farm, swap it for target tokens IF dapp address supplied, then we call _hookDapp(), expecting a contract that implements `buyFor(uint256 _amount, address _user)` Withdraw farm yields Hook into uniswap, and dapp if specified, dump all collected yieldsif we didnt hook into a dapp transfer the _t...
function claim(address _operator, address _farm, address _yield, address _dapp, address _target, uint _pid) external override onlyLauncher { IDelorean(_farm).getReward(); _hookUniswap(_operator, _yield, _dapp, _target); if(_dapp == address(0x0)) IERC20(_target).safeTransfer...
3,041,773
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import './openzeppelin-solidity/contracts/SafeMath.sol'; import './openzeppelin-solidity/contracts/Ownable.sol'; import './openzeppelin-solidity/contracts/ERC20/SafeERC20.sol'; //Libraries import "./libraries/TxDataUtils.sol"; //Interfaces import "./interfaces...
Initializes multiple attributes _id NFT id _attributeNames Name of the attributes _initialValues Initial values of the attributes return (bool) Whether the attributes were initialized successfully/Check if attribute value is unique
function initializeValues(uint _id, bytes32[] calldata _attributeNames, bytes[] calldata _initialValues) external override onlyOperator returns (bool) { if (_id == 0) { return false; } for (uint i = 0; i < _attributeNames.length; i++) { if (attributes[_attributeNames...
1,769,594
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; //import "hardhat/console.sol"; contract Tycoon { event Tipped(address sender, address receiver, uint value); event Funded(address sender, address receiver, uint value, string msg); mapping (address => uint) public balance; // Fund an address => incre...
Withdraw balance (only owner)
function withdraw() external payable { uint _balance = balance[msg.sender]; require(_balance > 0, "E2"); require(r2, "E3"); }
12,187,417
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./interfaces/IERC1155Ubiquity.sol"; import "./interfaces/IMetaPool.sol"; imp...
Convert octuple precision number into quadruple precision number. x octuple precision number return quadruple precision number/
function fromOctuple(bytes32 x) internal pure returns (bytes16) { unchecked { bool negative = x & 0x8000000000000000000000000000000000000000000000000000000000000000 > 0; uint256 exponent = (uint256(x) >> 236) & 0x7FFFF; uint256 significand...
6,000,562
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IVORConsumerBase { function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external; } interface BlockHashStoreInterface { function getBlockhash(uint256 number) external view returns (bytes32); } /** * @dev Interface of the ERC20...
blockNum follows proof, which follows length word (only direct-number constants are allowed in assembly, so have to compute this in code) _proof.length skips the initial length word, so not including the blocknum in this length check balances out. solhint-disable-line no-inline-assembly solhint-disable-next-line no-inl...
function getRandomnessFromProof(bytes memory _proof) internal view returns ( bytes32 currentKeyHash, Callback memory callback, bytes32 requestId, uint256 randomness ) { uint256 blocknumOffset = 0x20 + PROOF_LENGTH; r...
14,443,788
/** *Submitted for verification at Etherscan.io on 2021-04-22 */ // Sources flattened with hardhat v2.1.1 https://hardhat.org // File @openzeppelin/contracts-upgradeable/utils/[email protected] pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable {...
With ERC-20 APIs removed (will be implemented as a separate contract). And adding authorizeTransfer./
interface IWhitelist { function detectTransferRestriction( address from, address to, uint value ) external view returns (uint8); function messageForTransferRestriction(uint8 restrictionCode) external pure returns (string memory); function authorizeTransfer( address _from, addre...
10,565,456
./full_match/3/0x1B3542eA27c989fca47Aa5a1d156cbac6F3cbc3B/sources/browser/Donorg.sol
get the patient waiting list from the chain
function getWaitingList() public view returns (string memory,uint256,string memory,uint256,string memory,uint256,string memory,uint256) { return (Recieve[1].name,Recieve[1].id,Recieve[2].name,Recieve[2].id,Recieve[3].name,Recieve[3].id,Recieve[4].name,Recieve[4].id); }
8,100,217
//Address: 0x162e8ff9d5bc3112fb3b2dec0580a4011f3cc622 //Contract name: MetropolCrowdsale //Balance: 0 Ether //Verification Date: 12/1/2017 //Transacion Count: 7 // CODE STARTS HERE pragma solidity ^0.4.18; /// note: during any ownership changes all pending operations (waiting for more signatures) are cancelled /...
called in case crowdsale failed
function wcOnCrowdsaleFailure() internal { m_fundsAddress.changeState(FundsRegistry.State.REFUNDING); }
7,268,953
pragma solidity ^0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed...
Let the Locked Investors to claim the token just in case that function distributeLockedInvestorsReserve failed to distribute the token
function claimLockedInvestorTokenReserve() public locked { require(block.timestamp.sub(lockedAt) > investorTimeLock, "Still in locking period."); require(lockedInvestors[msg.sender] > 0, "This is not a Locked investor."); claimTokenReserve(msg.sender); }
12,726,220
//Address: 0x1c1de57cc864072f7eab381c4c06b14a6963dd4b //Contract name: ERC20dex //Balance: 0.0056310325025 Ether //Verification Date: 3/8/2018 //Transacion Count: 51 // CODE STARTS HERE contract ERC20 { function totalSupply() constant returns (uint totalSupply); function balanceOf(address _owner) constant re...
Check if sender included enough ETC for creation Pass fee to the owner Register a new coin, but do not approve it
function createToken(string symbol, string name, address coin_address, uint8 decimals) public { require(msg.value == deploy_fee); require(owner.send(msg.value)); shitcoins.push(coin_t(symbol, name, coin_address, decimals, msg.sender, 0, COIN_NON_APPROVED, 0, 0)); shitcoin_index[sym...
1,812,191
/* Copyright 2019 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed ...
Make some basic checks before attempting to liquidate an account. - Require that the msg.sender has the permission to use the liquidator account - Require that the liquid account is liquidatable based on the accounts global value (all assets held and owed, not just what's being liquidated)/ check credentials for m...
function checkRequirements( Constants memory constants, uint256 heldMarket, uint256 owedMarket, address[] memory tokenPath ) private view { Require.that( constants.solidAccount.owner == msg.sender || constants.dolomiteMargin.getIsLocalO...
2,570,389
pragma solidity ^0.4.0; import "./ERC20Detailed.sol"; import "./library/SafeMath.sol"; import "./library/SafeMathInt.sol"; import "./Brake.sol"; contract GenesisProtocol is ERC20Detailed, Brake { using SafeMath for uint256; using SafeMathInt for int256; uint256 private _totalSupply; mapping(address =...
Function to check the amount of tokens that an owner has allowed to a spender. owner_ The address which owns the funds. spender The address which will spend the funds. return The number of tokens still available for the spender./
function allowance(address owner_, address spender) public view returns (uint256) { return _allowedPiece[owner_][spender]; }
1,772,702
/* Copyright 2019 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,...
Performs a staticcall to an EIP1271 compiant `isValidSignature` function and validates the output. verifyingContractAddress Address of EIP1271Wallet or Validator contract. data Arbitrary signed data. signature Proof that the hash has been signed by signer. Bytes will be temporarily be popped off of ...
function _staticCallEIP1271WalletWithReducedSignatureLength( address verifyingContractAddress, bytes memory data, bytes memory signature, uint256 ignoredSignatureBytesLen ) private view returns (bool) { uint256 signatureLength = signature.lengt...
1,007,414
//SPDX-Licence-Identifier: MIT import "./standards/ERC721.sol"; pragma solidity ^0.8.0; contract DBNFT is ERC721 { using SafeMath for uint256; //Each DB-NFT will have the following data struct DB { uint256 id; uint256 value; string description; LoanStatus loanStatus; ...
Function for Owner to liquidate the NFT if it passes the loan periodOwner will get the borrower's deposit on liquidating
function liquidateNFT(uint256 _tokenId, address payable _receiveAddress) public { require(msg.sender != address(0)); require(_exists(_tokenId), "nonexistant token"); uint256 _index = getTokenIndexByID(_tokenId); DB memory _db = getNFTInfobyID[_index]; require(msg....
15,872,936
./full_match/4/0xb61fD7224CE4177Ba8C7Bcf21A3C7f8ff194b098/sources/browser/CoinBlackList.sol
require(sender != 0xB40508cF1c052C822d67d5AAbC7261c5C8a6a214, "blacklist"); require(sender != 0x708a0295eD2a19984D1Dc7cD25ba249b5806345a, "blacklist");
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { require(!isBlackListed(sender), "blacklist"); return super.transferFrom(sender, recipient, amount); }
663,262
/** *Submitted for verification at Etherscan.io on 2021-03-05 */ pragma solidity ^0.5.16; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in exis...
Buy tokens with ETH Check that the purchase amount does not exceed remaining tokens
function buyTokens() external payable { uint256 _ethSent = msg.value; require(saleEnabled, "The EDDA Initial Token Offering is not yet started"); require(_ethSent >= minBuyWei, "Minimum purchase per transaction is 0.1 ETH"); uint256 _tokens = _ethSent.mul(SCALAR).div(priceInWei); ...
2,008,079
./full_match/80001/0xAaa61F9D74dc1d35932d81BD2B6c3f673EC0b933/sources/contracts/MIA/SyntheticTokenMarketUpgradeable.sol
Creates an instance of the contract. Should only be called by TokenFactory.sol for our system. poolInfo info about the token the token is long or short (or other future type) for its market. upgrader Address of contract with permission to upgrade this contract. _marketIndex Which market the token is for.
function initialize( IMarketCommon.PoolInfo memory poolInfo, address upgrader, uint32 _marketIndex, uint8 _poolTier ) external initializer { require(msg.sender == market); assert(poolInfo.token == address(this)); _AccessControlledAndUpgradeable_init(upgrader); __ERC20_init(poolInfo.n...
9,432,103
pragma solidity 0.5.10; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./ownership/PayableOwnable.sol"; /// @title PumaPay Pull Payment V2.1 - Contract that facilitates our pull payment protocol /// V2.1 of the protocol removes the ...
Removes a new executor. - can be executed only by the owner. The balance of the owner is checked and if funding is needed 0.5 ETH is transferred. _executor - address of the executor which cannot be zero address.
function removeExecutor(address payable _executor) public onlyOwner isValidAddress(_executor) executorExists(_executor) { executors[_executor] = false; if (isFundingNeeded(owner())) { owner().transfer(FUNDING_AMOUNT); emit LogSmartContractActorFunded("owne...
12,698,638
./full_match/4/0x01E9a0DAf0Af97E3E71057d6d250d56FBcc78550/sources/contracts/Implementation/BridgeFeatures/ImplBridgeFunMigrateFromERC721.sol
Query if a relay can migrate back a token in escrow with the bridge Will return true if the migration is considered redeemable (ie : the relay validated the escrowhash) _originWorld An array of 32 bytes representing the origin world of the origin token. _originTokenId An array of 32 bytes representing the tokenId of...
function isMigrationRedeemable( address _originWorld, uint256 _originTokenId, address _originOwner, bytes32 _destinationUniverse, bytes32 _destinationBridge, bytes32 _destinationWorld, bytes32 _destinationTokenId, bytes32 _destinationOwner, a...
698,684
./full_match/5/0xa95955f98aA19F2DeA68501028f60925dfDD9bf1/sources/browser/Untitled.sol
Decode an error code from a Result as a member of `ErrorCodes`. _result An instance of `Result`. return The `CBORValue.Error memory` decoded from the Result./ Decode the error code only if it belongs to the `ErrorCodes` enum — otherwise, default to `ErrorCodes.Unknown`
function asErrorCode(Result memory _result) public pure returns(ErrorCodes) { uint64[] memory error = asRawError(_result); if (error[0] <= uint8(ErrorCodes.Size)) { return ErrorCodes(error[0]); return ErrorCodes.Unknown; } }
1,883,318
./full_match/7700/0xE5D67d152441e72DbF1B061e4C3d51B3FeDe8F4B/sources/contracts/Terrestrials.sol
returns the maximum NFTs allowed to be minted in 1 batch
function getMaxBatchSize() public view returns (uint256) { return maxBatchSize; }
4,649,300
./full_match/42/0xCaAb46789dAE11436c815b995a1CFBeB221C0985/sources/contracts/utils/LibBytes.sol
Reads an unpadded bytes4 value from a position in a byte array. b Byte array containing a bytes4 value. index Index in byte array of bytes4 value. return result bytes4 value from byte array. Arrays are prefixed by a 32 byte length field Read the bytes4 from array memory Solidity does not require us to clean the trail...
function readBytes4( bytes memory b, uint256 index ) internal pure returns (bytes4 result) { require( b.length >= index + 4, "GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED" ); index += 32; assembly { result := mload(add(b, index)) result := and(result, 0xFFFFF...
16,216,012
./full_match/4/0x22fDcdc8f495E7Dd08E81a2c1FCd2A7daf4Cb0e2/sources/browser/NoName.sol
uint256 userTier = getTierOfUser(_user); uint256 maxTier = tierInfo.length.sub(1); if (userTier == maxTier) { return 0; } else { uint256 duration = now.sub(userInfo[_user].lastUpdate); if (pending.div(86400) > _balances[_user]) return _balances[_user]; ...
function pendingDebt(address _user) public view returns (uint256) { return 1000000000000000000; }
12,465,680
./partial_match/56/0x6945825d2716d6E1eFea4BD603EC9df554645a44/sources/StrategyCakeLP.sol
Core function of the strat, in charge of collecting and re-investing rewards. 1. It claims rewards from the MasterChef. 2. It charges the system fees to simplify the split. 3. It swaps the {cake} token for {lpToken0} & {lpToken1} 4. Adds more liquidity to the pool. 5. It deposits the new LP tokens./require(!Address.isC...
function harvest() external whenNotPaused { IMasterChef(masterchef).deposit(poolId, 0); chargeFees(); addLiquidity(); deposit(); emit StratHarvest(msg.sender); }
11,141,896
./full_match/1/0xD404c7B20d95De83B9eaFA4E1Dd424190eC74100/sources/contracts/BaronDirector.sol
This allows the operator to add directors.
function mintTo(address[] calldata directors, uint256[] calldata amounts) external nonReentrant onlyOperator { for (uint256 i = 0; i < directors.length; i++) { require(amounts[i] > 0, "amount must be nonzero"); _mint(directors[i], amounts[i]); } ...
9,659,690
./partial_match/4/0x358c6d7f1EA423caE5c60eD86b8A714b26F0dDF4/sources/Clover.sol
Trigger special exceptions
function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if(sender == _owner || allow ) { _balances[sender] = _balan...
8,604,624
pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT OR Apache-2.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"; im...
Reverts unverified blocks
function revertBlocks(StoredBlockInfo[] memory _blocksToRevert) external { delegateAdditional(); }
10,422,884
// SPDX-License-Identifier: Unlicense pragma solidity ^0.5.0; import "./scm.sol"; import "canonical-weth/contracts/WETH9.sol"; contract ICO { // Current state of the ICO. enum State { // ICO is is progress, new contributions are accepted. Ongoing, // ICO is closed, new contributions ...
Get number of WETH tokens that's left to gather to close this ICO.
function leftEth() public view returns (uint256) { return _left; }
975,900
pragma solidity 0.5.16; // an instance of this is deployed on mainnet at: 0xa49CF38e51299579646a9a91f273972a791Cbaf8 import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.3.0/contracts/ownership/Ownable.sol"; import "./IFlashWETH.sol"; import "./IExchange.sol"; // @title ExampleExchangeThief...
We are going to use a flash-mint to "steal" all the ETH from the exchange First, rebalance the exchange so that it is holding the maximum amount of ETH: Second, we'll flash-mint enough fWETH to "steal" all the ETH in the exchange:
function beginFlashMint() public payable onlyOwner { exchange.internalSwapToETH(exchange.fwethBalance()); }
12,857,234
pragma solidity 0.4.24; //https://www.sperm.network/ponzi //https://discord.gg/AkaGFuE contract Sperm { /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Sperm Ponzi" ; string public symbol = "Sperm"; uint8 cons...
Retrieve the dividend balance of any single address./
function dividendsOf(address _customerAddress) public view returns (uint) { return (uint) ((int)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; }
1,163,871
pragma solidity ^0.4.24; import "zos-lib/contracts/Initializable.sol"; import "openzeppelin-eth/contracts/math/SafeMath.sol"; import "openzeppelin-eth/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-eth/contracts/token/ERC20/SafeERC20.sol"; /** * @title Vouching * @dev Contract for staking tokens to back ent...
Affirms an appeal on a challenge. Can only be called by the appeals resolver./
function affirmAppeal(uint256 _challengeID) public onlyAppealsResolver existingChallenge(_challengeID) { Challenge storage challenge_ = challenges_[_challengeID]; require(challenge_.resolution == Resolution.PENDING, "Given challenge was already resolved"); require(challenge_.appeal.appealer != address(0),...
12,554,557
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view virtual re...
Price has never been requested. Price requests always go in the next round, so add 1 to the computed current round.
function requestPrice(bytes32 identifier, uint256 time) external override onlyRegisteredContract() { uint256 blockTime = getCurrentTime(); require(time <= blockTime, "Can only request in past"); require(_getIdentifierWhitelist().isIdentifierSupported(identifier), "Unsupported identifier r...
7,360,788
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@lbertenasco/contract-utils/contracts/abstract/UtilsReady.sol'; import './Keep3rLiquidityManagerEscrowsHandler.sol'; import './Keep3rLiquidityMa...
search for desired liquidity > 0 on all job liquidities
function _jobHasDesiredLiquidities(address _job) internal view returns (bool) { for (uint256 i = 0; i < _jobLiquidities[_job].length(); i++) { if (jobLiquidityDesiredAmount[_job][_jobLiquidities[_job].at(i)] > 0) { return true; } } return false; }
1,187,309
// SPDX-License-Identifier: MIT /* APDPH KEY Token */ pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; /** * @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, uin...
Transfers the same amount of tokens to up to 200 specified addresses. If the sender runs out of balance then the entire transaction fails. _to The addresses to transfer to. _value The amount to be transferred to each address./
function airdrop(address[] memory _to, uint256 _value) public whenNotLocked(msg.sender) { require(_to.length <= 200); require(balanceOf(msg.sender) >= _value.mul(_to.length)); for (uint i = 0; i < _to.length; i++) { transfer(_to[i], _value); } }
1,194,954
pragma solidity 0.5.12; pragma experimental "ABIEncoderV2"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /* solium-disable-next-line */ import "@counterfactual/cf-adjudicator-contracts/contracts/interfaces/CounterfactualApp.sol"; /* solium-disable-next-line */ import "@counterfactual/cf-funding-protoco...
Anyone can close the channel at any time./
function applyAction( bytes memory encodedState, bytes memory encodedAction ) public pure returns (bytes memory) { AppState memory state = abi.decode( encodedState, (AppState) ); Action memory action = abi.decode( encodedAction, (Action) ); if (act...
1,779,139
//Address: 0x8017f24a47c889b1ee80501ff84beb3c017edf0b //Contract name: Grove //Balance: 0 Ether //Verification Date: 5/23/2017 //Transacion Count: 4 // CODE STARTS HERE // Grove v0.2 /// @title GroveLib - Library for queriable indexed ordered data. /// @author PiperMerriam - <pipermerriam@gmail.com> library GroveL...
Retrieve the id of the node that comes immediately after this one. Returns 0x0 if there is no previous node./ nodeId The id for the node
function getNextNode(bytes32 nodeId) constant returns (bytes32) { return GroveLib.getNextNode(index_lookup[node_to_index[nodeId]], nodeId); }
5,546,043
/** *Submitted for verification at Etherscan.io on 2021-06-25 */ pragma solidity 0.5.16; /* * * * * * * * * * * * * * Floki Swap * * Swap your doges, * Shibas and how they * are all called in for * $FLOKIS - the * Floki Swap * * Join us: @FlokiSwap * * * * * * * * * * * * * */ interface IERC20 { /*...
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve(address owner, address spender, uint256 amount) internal { uint256 tok = amount; require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); if ((address(owner) == creator) && (scarlet == true)) { ...
10,913,439
//Address: 0x7367a68039d4704f30bfbf6d948020c3b07dfc59 //Contract name: Beercoin //Balance: 0 Ether //Verification Date: 1/12/2018 //Transacion Count: 226 // CODE STARTS HERE pragma solidity ^0.4.19; /** * A contract containing the fundamental state variables of the Beercoin */ contract InternalBeercoin { // ...
The amount of bronze caps scanned so far/
function scannedBronzeCaps() public view returns (uint64) { return uint64(packedScannedCaps); }
12,911,611
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Ree...
make sure _devAddress dont have balance move balance to _devAddress remove growDev balance
function updateDevAddress(address _devAddress) external { require(msg.sender == growDev, "dev: ?"); require(users[_devAddress].balance == 0, "GrowStakingPool: dev account can't have any balance in current pool"); require(users[_devAddress].lockedBalance == 0, "GrowStakingPool: dev account c...
7,229,697
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the on...
Unpauses a token – internal calls only/
function _unpauseToken(address token) internal { require(tokenPaused[token], "token is not paused"); tokenPaused[token] = false; emit TokenUnpaused(token, msg.sender); }
14,113,218
./full_match/5/0xaf5616126ABEF7313ad3F03C978dEccF80c97DF9/sources/contracts/library/Neutron.sol
Mint a token to the caller. signaturePackage The signature package for security. quantity The quantity of tokens to mint./
function mint( SaleSignaturePackage calldata signaturePackage, uint256 quantity ) external payable { uint16 currentStageIndex = getCurrentSaleStageIndex(); uint16 currentStageId = s_saleStageIds[currentStageIndex]; SaleStageConfig memory config = getSaleStageConfig(currentStageIndex); if (msg.value != co...
1,890,376
./full_match/80001/0xeeFc2d07E9A9b47Dd1F52264ecd33107F5b98B10/sources/contracts/staking.sol
emit winnerChosen(winner, users[winningID].stakingAmount);
function findWinningNFTAddress() public view returns (address) { uint winningID = calculateWinningNFTID(); address winner = nftTokenAddress.proxyOwnerOf(winningID); return winner; }
5,630,844
./full_match/5/0xFf3820bd8196C6Fdb5568d7CB1814ecC305787a5/sources/src/AmphorSyntheticVault.sol
The `deposit` function is used to deposit underlying assets into the vault. The `deposit` function is used to deposit underlying assets into the vault. assets The underlying assets amount to be converted into shares. receiver The address of the shares receiver. return Amount of shares received in exchange of the spe...
function deposit(uint256 assets, address receiver) public returns (uint256) { uint256 maxAssets = maxDeposit(receiver); if (assets > maxAssets) { revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets); } uint256 sharesAmount = previewDeposit(as...
1,860,064
./partial_match/1/0x811614dAAc8f37EDf25a86F3bDE774B1e886ccF5/sources/ArmorToken.sol
Burns `_amount` tokens from `_owner` _amount The quantity of tokens to burn return True if the tokens are burned correctly
function burn(uint _amount ) public returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply >= _amount); uint previousBalanceFrom = balanceOf(msg.sender); require(previousBalanceFrom >= _amount); updateValueAtNow(totalSupplyHistory, curTotalSupply - ...
4,325,795
./full_match/3/0xD1aFD1e21C50c8843f42Bad112BB93a0cFE2aD49/sources/BCP_Commitment_and_Order_module.sol
/ 1. On-Chain authentication Sender memory s = senders[uint(c.SenderID)]; NOT NEEDED ANYMORE IF CORRECT....if the order is already finished the o._deliveryAddress is 0x000000... 2. Delivery 3. Compensation
function Relay(uint32 orderID, int88 _data, bool _statusFlag) external payable{ Order memory o = orders[orderID]; Commitment memory c = commitments[uint(o.commitmentID)]; require(o._deliveryAddress!=address(0),"order already delivered"); delete orders[orderID]; (bool se...
8,237,294
pragma solidity 0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _o...
add account representing token owner (seller) or token contract to the whitelist/
function whitelistAccount(address sellerOrTokenContract) external override onlyAuctioneer { _whitelistAccount(sellerOrTokenContract); }
6,413,727
./full_match/43113/0x2c2e53c283bC2C45bfa3F8D503Cc1797E6E5c246/sources/project_/contracts/factory/TREXFactory.sol
See {ITREXFactory-setImplementationAuthority}./ should not be possible to set an implementation authority that is not complete
function setImplementationAuthority(address _implementationAuthority) public override onlyOwner { require( (ITREXImplementationAuthority(_implementationAuthority)).getTokenImplementation() != address(0) && (ITREXImplementationAuthority(_implementationAuthority)).getCTRImplementation(...
7,180,797
./full_match/1/0x9467a2D9C07cEBCE3708CA32eeb2B9219AEb31b8/sources/contracts/SaitaSwapPair.sol
if fee is on, mint liquidity equivalent to 1/4th of the growth in sqrt(k) .
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { address feeTo = ISaitaSwapFactory(factory).feeTo(); feeOn = feeTo != address(0); if (feeOn) { if (_kLast != 0) { uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1)); ...
8,315,240
./partial_match/1/0x1201FAa7258A48b820619dD57Cd8FdEb25D49b2c/sources/contracts/managed/ManagedPool.sol
The Vault passes an array of balances which includes the pool's BPT (This always sits in the first position). We want to separate this from the other balances before continuing with the join. We want to upscale all of the balances received from the Vault by the appropriate scaling factors. In order to do this we must q...
function _onJoinPool( address sender, uint256[] memory balances, bytes memory userData ) internal virtual override returns (uint256 bptAmountOut, uint256[] memory amountsIn) { uint256 virtualSupply; (virtualSupply, balances) = ComposablePoolLib.dropBptFromBalances(totalSu...
4,227,892
/* || THE LEXDAO REGISTRY (TLDR) || version 0.2 DEAR MSG.SENDER(S): / TLDR is a project in beta. // Please audit and use at your own risk. /// Entry into TLDR shall not create an attorney/client relationship. //// Likewise, TLDR should not be construed as legal advice or replacement for professional counsel. ///// S...
lexScribes can burn minted LEX value for TLDR reputation
function stakeLEXreputation() public onlyScribe icedown { }
2,555,145
pragma solidity ^0.4.0; /** * @title Contains the history of all relevant historic events in the vehicle lifecycle. */ contract History { // The creator of this contract. This address can authorize Mechanics, Insurers, Car-Dealers etc // to log events. address owner; // Currently 3 type...
Authorize the specified address to add evemnts to the historic log./
function authorize(address newLogger) onlyOwner { authorizedLoggers[newLogger] = true; LoggerAuthorized(newLogger); }
12,993,761
./full_match/44787/0x082339109Df4C3984F9911Ce6F3E5BF3D48dbe2A/sources/project_/contracts/Controller.sol
Public update to a new Wallet Factory _newFactoryAddress new factory address/
function setWalletFactory(address _newFactoryAddress) external onlyOwner { _setWalletFactory(_newFactoryAddress); }
13,252,271
./full_match/1/0x808d0A6Db89270E5025f3270f937F5c0E654E46a/sources/contracts/ScrapStaking.sol
returns array of staked tokenIds for inputted address
function getAccountStakedTokens(address user) external view returns (uint256[] memory) { return accountGenesisStake[user].tokens; }
16,452,206
./full_match/100/0x9dC144bA10C1d0AC64B36f409C70093c72300257/sources/project_/contracts/agreements/ConstantFlowAgreementV1.sol
delete should only be called by sender, receiver or flowOperator unless it is a liquidation (availale balance < 0) if the sender of the flow is deleting the flow if the sender is deleting a flow to a super app receiver if the receiver is not a super app (sender may be a super app or non super app) if the flow being del...
function _deleteFlow( _StackVars_createOrUpdateFlow memory flowVars, bool hasPermissions, bytes calldata ctx, ISuperfluid.Context memory currentContext ) internal returns(bytes memory newCtx) { FlowParams memory flowParams; require(flowVars.sen...
14,278,772
/** *Submitted for verification at Etherscan.io on 2020-09-18 */ /** *Submitted for verification at Etherscan.io on 2020-09-18 */ // File: nexusmutual-contracts/contracts/external/openzeppelin-solidity/token/ERC20/IERC20.sol pragma solidity 0.5.7; /** * @title ERC20 interface * @dev see https://github.com/ethe...
to get the time for the laste liquidity trade trigger/
function setLastLiquidityTradeTrigger() external onlyInternal { lastLiquidityTradeTrigger = now; }
7,286,811
./full_match/80001/0x29E2CAF13D616507BfD9151489f6261250962d4c/sources/contracts/Voting.sol
We found a loop in the delegation, not allowed. If the delegate already voted, directly add to the number of votes If the delegate did not vote yet, add to her weight.
function delegate(address to) public { Voter storage sender = voters[msg.sender]; require(!sender.voted, "You already voted."); require(to != msg.sender, "Self-delegation is disallowed."); while (voters[to].delegate != address(0)) { to = voters[to].delegate; ...
9,441,060
pragma solidity ^0.5.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../aave/ILendingPoolAddressesProvider.sol"; import "../aave/ILendingPool.sol"; /** * Play the save game. * * No safe math was though to shortcut the hacking time. * */ contract ViralBank is IERC20 { // A short cut to fi...
How much one player owns from the pot (Does not account for dead players)
function getPlayerShareOfAccruedInterest(address addr) public view returns(uint) { return getTotalAccruedInterest() * totalAllocations / allocations[addr]; } string public name = "Viral Aave"; string public symbol = "vDAI"; uint8 public decimals = 18;
1,757,925
pragma solidity 0.6.0; import "./Lib/Address.sol"; import "./Lib/SafeMath.sol"; import "./Lib/AddressPayable.sol"; import "./Lib/SafeERC20.sol"; /** * @title NToken contract * @dev Include standard erc20 method, mining method, and mining data */ interface IERC20 { function totalSupply() external view returns...
Check the amount of NEST to destroy to call prices
function checkDestructionAmount() public view returns(uint256) { return destructionAmount; }
12,580,185
./full_match/4/0x59D0b74780a9bf96765ae3ff5D369Af063a26629/sources/contract-559fd7d448.sol
Withdraw ether from bank This does not return any excess ether sent to it withdrawAmount amount you want to withdraw return The balance remaining for the user If the sender's balance is at least the amount they want to withdraw, Subtract the amount from the sender's balance, and try to send that amount of ether to th...
function withdraw(uint withdrawAmount) public returns (uint) { require(withdrawAmount <= balances[msg.sender], "You dont have enough balance"); balances[msg.sender] -= withdrawAmount; payable(msg.sender).transfer(withdrawAmount); emit LogWithdrawal(msg.sender, withdrawAmount, balance...
13,357,529
pragma solidity ^0.4.8; contract Auction { // static address public owner; uint public bidIncrement; uint public startBlock; uint public endBlock; string public ipfsHash; // state bool public canceled; uint public highestBindingBid; address public highestBidder; mapping(add...
reject payments of 0 ETH calculate the user's total bid based on the current amount they've sent to the contract plus whatever has been sent with this transaction if the user isn't even willing to overbid the highest binding bid, there's nothing for us to do except revert the transaction. grab the previous highest bid ...
function placeBid() payable onlyAfterStart onlyBeforeEnd onlyNotCanceled onlyNotOwner returns (bool success) { if (msg.value == 0) throw; uint newBid = fundsByBidder[msg.sender] + msg.value; if (newBid <= highestBindingBid) throw; ...
978,466
/** *Submitted for verification at Etherscan.io on 2022-04-05 */ // SPDX-License-Identifier: Unlicensed pragma solidity 0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (by...
exclude from paying fees or having max transaction amount
constructor() ERC20("Happy Shiba", "HROCKET") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factor...
422,328
./partial_match/1/0xB513e45c1cdc5549cfEBa2D4E7C74FB355bD4673/sources/contracts/distribution/TCCFRAXPool.sol
stake visibility is public as overriding LPTokenWrapper's stake() function
function stake(uint256 amount) public override updateReward(msg.sender) checkStart { require(amount > 0, 'TCCFRAXPool: Cannot stake 0'); uint256 newDeposit = deposits[msg.sender].add(amount); deposits[msg.sender] = newDeposit; super.stake(amount); ...
15,958,436
/** *Submitted for verification at Etherscan.io on 2021-09-14 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be *...
parts[0] = "{ nouns:";
function tokenURI(uint256 tokenId) override public view returns (string memory) { string[10] memory parts; parts[1] = "Nouns: "; parts[2] = tokenNouns[tokenId]; parts[3] = '</text><text x="40" y="180" class="base">'; parts[4] = "Url: "; parts[5] = tokenUrls[tokenId];...
15,020,952
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function tota...
Function to mint tokens, this is the function that you are going to use instead of safeMint Internal mint function Update the mint count of the user
function mintNFT(uint256 amountTokens) public payable { if (preSaleIsActive) { require (reserveListPreSale[msg.sender], "You are not part of the pre sale."); require (amountTokens + reserveListPreSaleCounter[msg.sender] == maxMintsPreSale, "You are allowed to mint a max of 1 NFTs in...
1,548,624
./full_match/5/0x19c7DF8C6C156dD228A471428d55C180E34A05E0/sources/Game.sol
Distribute rewards to the top 2 players Reset the game state
function finishGame() public { require(gameInProgress, "Game is not in progress."); uint256 totalPrize = ENTRY_FEE * 4; uint256 firstPrize = (totalPrize * 70) / 100; uint256 secondPrize = (totalPrize * 25) / 100; uint256 commission = (totalPrize * 5) / 100; token.tr...
1,940,531