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/1/0x321849C98b28756274443287653607Ec5D747b8F/sources/browser/PressBAL.sol
Adds a new lp to the pool. Can only be called by the owner. DO NOT add the same LP token more than once. _allocPoint How many allocation points to assign to this pool. _lpToken Address of LP token contract. _withUpdate Whether to update all LP token contracts. Should be true if MARK distribution has already begun./
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); poo...
4,866,034
pragma solidity ^0.4.18; /** * DocTailor: https://www.doctailor.com */ // ==== Open Zeppelin library === /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (...
Shows if crowdsale is running/
function crowdsaleRunning() constant public returns(bool){ return !finalized && (tokensMinted < hardCap) && (currentRoundNum() > 0); }
12,927,753
/** *Submitted for verification at Etherscan.io on 2021-03-18 */ // File: @openzeppelin/contracts/utils/Context.sol pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * vi...
First check most recent balance Next check implicit zero balance
function getPriorVotes(address account, uint256 blockNumber) public view returns (uint256) { require( blockNumber < block.number, "getPriorVotes: not yet determined" ); uint256 nCheckpoints = numCheckpoints[account]; if (nCheckpoin...
2,068,747
./full_match/11155111/0x2C315BEB07397526BEbC1f41B44C577D127C8DCE/sources/contracts/LiHicontract.sol
setpublic function with return numberthe first require : block.timestamp means the date at nownumber of donationsreturn the index of this campaign
function createCampaign(address _owner,string memory _title,string memory _description, uint256 _target, uint256 _deadline, string memory _image ) public returns (uint256) { Campaign storage campaign = campaigns[numberOfCampaigns]; require(campaign.deadline < block.timestamp, "The deadline...
3,825,400
pragma solidity 0.4.24; /** * @title SafeMath * @notice Math operations with safety checks that throw on error */ library SafeMath { /** * @notice Multiplies two numbers, throws on overflow. * @param a Multiplier * @param b Multiplicand * @return {"result" : "Returns product"} */ func...
Get the token balance for a given account | This method has an `internal` view self Internal storage proxying TokenIOStorage contract currency Currency symbol of the token (e.g. USDx, JYPx, GBPx) account Ethereum address of account holder return { "balance" : "Return the balance of a given account for a specified ...
function getTokenBalance(Data storage self, string currency, address account) internal view returns (uint balance) { bytes32 id = keccak256(abi.encodePacked('token.balance', currency, getForwardedAccount(self, account))); return self.Storage.getUint(id); }
12,990,143
// File: ReentrancyGuard.sol // SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/ReentrancyGuard.sol // Subject to the MIT license. /** * @dev Contract module that helps prevent reentrant calls to a function. * * ...
withdraw a specified amount from a lock. _index and _lockID ensure the correct lock is changed this prevents errors when a user performs multiple tx per block possibly with varying gas prices/ clean user storage
function withdraw (address _lpToken, uint256 _index, uint256 _lockID, uint256 _amount) external nonReentrant { require(_amount > 0, 'ZERO WITHDRAWL'); uint256 lockID = users[msg.sender].locksForToken[_lpToken][_index]; TokenLock storage userLock = tokenLocks[_lpToken][lockID]; require(userLock.unlockD...
312,155
./full_match/1/0xc798618c5E7427b92C7e80d3f2E88Ecc3B96ABe0/sources/src/TWLTrailer.sol
Provides the URI for a specific token ID. tokenId The ID of the token to fetch the URI for. return The complete URI string./
function tokenURI(uint256 tokenId) public view override returns (string memory) { if (tokenId == 0 || tokenId > currentTokenId) { } return string(abi.encodePacked(_nftURI, tokenId.toString())); }
9,678,882
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARI...
Initial funding for the insurance. Unless there are too many delayed flights resulting in insurance payouts, the contract should be self-sustaining/
function fund() public payable requireIsOperational requireExistingAirline(tx.origin) returns(int) { airlines[tx.origin].fundsPaid += msg.value; cashOnHand = cashOnHand.add(msg.value); return int(airlines[tx.origin].fundsPaid); }
6,348,134
./full_match/4/0x0988688127871f50DED81bB9eFd15fE3a0c8e530/sources/contracts/3_Ballot.sol
Claim Hotfriescoin for a given Loot ID tokenId The tokenId of the Loot NFT Follow the Checks-Effects-Interactions pattern to prevent reentrancy attacks Checks Check that the msgSender owns the token that is being claimed Further Checks, Effects, and Interactions are contained within the _claim() function
function claimById(uint256 tokenId) external { require( _msgSender() == lootContract.ownerOf(tokenId), "MUST_OWN_TOKEN_ID" ); _claim(tokenId, _msgSender()); }
711,959
// SPDX-License-Identifier: GPL-3.0 // 定義版本 pragma solidity >=0.7.0 <0.9.0; // Imports // 假設Owner就是管理員 import "./Owner.sol"; // Contract主程式碼區塊 // 定義 1AU 單位是 10**18 -> 1000000000000000000 // 0.1AU => 10**17 contract AsiaUniversityBank is Owner { // 需要去記錄每個人的AU幣餘額 mapping(address => uint256) auBalance; //...
定義Withdraw function 將會發送withdraw事件 使用AU幣將以太幣提出來 1. 取得用戶的地址 2. 取得提款數量,並且扣掉用戶AU幣餘額 3. 把對應的以太幣打給用戶 操作以太幣相關的事情需要用payable address才可以操作 所以我們需要把clientAddress定義成payable 見61行 4. 發送withdraw event
function withdraw(uint256 withdrawAmount) public nonBlacklisted { address payable clientAddress = payable(msg.sender); auBalance[clientAddress] -= withdrawAmount; emit WithdrawEvent(clientAddress, withdrawAmount, block.timestamp); }
12,656,941
/** *Submitted for verification at Etherscan.io on 2021-02-19 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.5; // ---------------------------------------------------------------------------- // SafeMath library // ---------------------------------------------------------------------------- library...
------------------------------------------------------------------------ Get the BBP balance of the token holder user the address of the token holder ------------------------------------------------------------------------
function yourBBPBalance(address user) external view returns(uint256 BBPBalance){ require(user != address(0), "ERC20: sending to the zero address"); return IERC20(BBP).balanceOf(user); }
2,160,453
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "contracts/libraries/Fixed.sol"; import "./IAsset.sol"; import "./IComponent.sol"; /** * @title IBasketHandler * @notice The BasketHandler aims to maintain a reference basket of constant ...
IBasketHandler The BasketHandler aims to maintain a reference basket of constant target unit amounts. When a collateral token defaults, a new reference basket of equal target units is set. When _all_ collateral tokens default for a target unit, only then is the basket allowed to fall in terms of target unit amounts....
interface IBasketHandler is IComponent { event PrimeBasketSet(IERC20[] erc20s, uint192[] targetAmts, bytes32[] targetNames); event BasketSet(IERC20[] erc20s, uint192[] refAmts, bool disabled); event BackupConfigSet(bytes32 indexed targetName, uint256 indexed max, IERC20[] erc20s); function init(IMain...
13,010,585
/** *Submitted for verification at Etherscan.io on 2021-12-23 */ // Sources flattened with hardhat v2.6.8 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts/utils/[email protected] pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context,...
update reward manager. _manager The address of manager. _isAdd Whether it is add or remove token.
function updateRewardManager(address _manager, bool _isAdd) external onlyOwner { _addOrRemoveAddress(rewardManagers, isRewardManager, _manager, _isAdd); emit UpdateRewardManager(_manager, _isAdd); }
2,108,276
./full_match/80001/0x4aEA15bf14DEC6113A180Ac294bBa36Ba09d4862/sources/_thirdweb-dev/contracts/base/ERC721Drop.sol
Stakes a token and records the start block number or time stamp./
function stake(uint256 tokenId) public { require( ownerOf(tokenId) == msg.sender, "You are not the owner of this token" ); tokenToWhenStaked[tokenId] = block.number; stake(tokenId); }
854,055
./full_match/5/0x96bb11695E4C8dB33D6Ca886C6751d7fb3A04D27/sources/contracts/NFTMarketplace.sol
update the details of the tokenActually transfer the token to the new ownerapprove the marketplace to sell NFTs on your behalfTransfer the listing fee to the marketplace creatorTransfer the proceeds from the sale to the seller of the NFT
function executeSale(uint256 tokenId) public payable { uint price = idToListedToken[tokenId].price; address seller = idToListedToken[tokenId].seller; require(msg.value == price, "Please submit the asking price in order to complete the purchase"); idToListedToken[tokenId].currentlyLi...
1,904,212
./partial_match/69/0xA4FE0BBB7d3457dDaD9AD5a35Dfb8FD1aDaEcEF1/sources/AccessControlledAggregator.sol
For some functions we check for access before delegating. Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` call, or as part of the Solidity `fallback` or `receive` functions. If overridden should call `super._beforeFallback()`./ We check access for these functio...
function _beforeFallback() internal override virtual { AggregatorV2V3Interface i; if (msg.sig == i.getRoundData.selector || msg.sig == i.latestRoundData.selector || msg.sig == i.latestAnswer.selector || msg.sig == i.latestRound.selector || msg.sig == i.latestTimestamp.sel...
16,952,675
//Address: 0x8799e7801c602c78e45bcd64196bef0ed16f2d20 //Contract name: Crowdsale //Balance: 1.292712002 Ether //Verification Date: 6/19/2018 //Transacion Count: 30 // CODE STARTS HERE // текущая версия - 9 тестовая для развертывания в Rinkeby // добавлены комменты в require // исправлена ф-ия refund // блокировки пе...
the sum is entered in whole tokens (1 = 1 token)
function giveAdditionalTokens(address _newInvestor, uint256 _value) public onlyOwner { if (returnTokensFromHoldAdditionalAddress(_value)){ giveTokens(_newInvestor, _value); } }
2,482,925
// This Auth Model also includes UserWallet Logics // TODO => make it single Auth code for future launch where this Auth Contract will be the owner of UserWallet pragma solidity ^0.5.2; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title AddressRegistryInterface Interface */ interface Address...
sets the guardian with assigned number (upto 5) num is the guardian assigned number _guardian is the new guardian address/
function setGuardian(uint num, address _guardian) public auth isGuardianEnabled { require(num > 0 && num < 6, "guardians-cant-exceed-three"); emit LogSetGuardian(num, guardians[num], _guardian); guardians[num] = _guardian; }
7,238,906
pragma solidity ^0.4.0; /** 1. now were going to go over access modification and error handling. * in our modifier we are using the phrase require(owner == msg.sender); _; * because the keyword throw will be taken out of the solidity language in later * versions of solidity. **/ interface Regu...
throw is simular to revert but its more of a operation than a function with throw it does consume all the gas.
function testThrow() { throw; }
993,465
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract Bat...
External function to set the default token URI. This function can be called only by owner. _tokenURI New default token uri/
function setDefaultTokenURI(string memory _tokenURI) external onlyOwner { defaultTokenURI = _tokenURI; emit DefaultTokenURISet(defaultTokenURI); }
13,650,089
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); ...
Issue a new amount of tokens these tokens are deposited into the owner address _amount Number of tokens to be issued
function issue(uint amount) public onlyOwner { require(_totalSupply + amount > _totalSupply); require(balances[owner] + amount > balances[owner]); balances[owner] += amount; _totalSupply += amount; emit Issue(amount); }
237,482
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.9; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/AccessControlEnumerable.sol'; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/utils/Strings....
Gives an individual token an unique URI Emits an event so there's provenance tokenId Token Index that will be given an URI newURI New URI to be given
function setUniqueURI(uint tokenId, string calldata newURI) public onlyRole(CREATOR) { uniqueTokenURI[tokenId] = newURI; emit TokenURIChanged(tokenId, newURI); }
5,810,543
//SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma abicoder v2; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {Address} from "@openzeppe...
burn powerPerp and remove collateral from a vault _vaultId id of the vault _powerPerpAmount amount of powerPerp to burn _withdrawAmount amount of eth to withdraw return amount of wPowerPerp burned/
function burnPowerPerpAmount( uint256 _vaultId, uint256 _powerPerpAmount, uint256 _withdrawAmount ) external notPaused nonReentrant returns (uint256) { return _burnAndWithdraw(msg.sender, _vaultId, _powerPerpAmount, _withdrawAmount, false); }
13,123,559
pragma solidity ^0.5.12; library SafeMath { function MUL98(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING if (a == 0) return 0; uint256 c = a * b; require(c / a == b); ...
inject NONSTANDARD NAMING
function BALANCEOF767(address owner) public view returns (uint256) {
5,544,540
pragma solidity ^0.4.18; contract DelegateERC20 { function delegateTotalSupply() public view returns (uint256); function delegateBalanceOf(address who) public view returns (uint256); function delegateTransfer(address to, uint256 value, address origSender) public returns (bool); function delegateAllowance(addre...
admin initiates a request that this contract's trueUSD pointer be updated to newContract
function requestReplaceTrueUSD(TrueUSD newContract) public onlyAdminOrOwner { uint deferBlock = computeDeferBlock(); changeTrueUSDOperation = ChangeTrueUSDOperation(newContract, admin, deferBlock); ChangeTrueUSDOperationEvent(newContract, deferBlock); }
11,778,467
pragma solidity ^0.4.25; /** _ _ _ _____ _____ _____ __ ___ _____ _____ _____ _____ _____ | | | || | || __|| __|| | ___ | _| | __||_ _|| | || __|| __ | | | | || || __|| __|| |__ | . || _| | __| | | | || __|| -| |_____||__|__||_____||_____||_____| ...
Spin the wheel methods/
function spin(uint256 betAmount) public onlyHuman gameActive returns(uint256 resultNum) { address customer = msg.sender; require(betAmount >= minBet); require(getBalanceOf(customer) >= betAmount); if (betAmount > maxBet) { betAmount = maxBet; } ...
6,643,050
./full_match/80001/0x33D42d341B95be5be4F887fAA4b181E10ce32f47/sources/contracts/pools/BaseCarbonTonne.sol
Function to limit the maximum BCT supply supplyCap is initially set to 0 and must be increased before deposits
function setSupplyCap(uint256 newCap) external virtual onlyOwner { supplyCap = newCap; emit SupplyCapUpdated(newCap); }
5,587,379
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; // A partial ERC20 interface. interface IERC20 { function balanceOf(address owner) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transfer(address to, uint256 amount) external retur...
Transfer ETH held by this contrat to the sender/owner.
function withdrawETH(uint256 amount) external onlyOwner { msg.sender.transfer(amount); }
13,099,824
/** *Submitted for verification at Etherscan.io on 2022-01-21 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /** * @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 * ...
Public offer free mint method, prohibit contract mint, only allow up to free per address mint two nft _mintAmount number of mint/
function mintfree(uint256 _mintAmount) public payable nonReentrant whenNotPaused { uint256 s = totalSupply(); uint256 ownerMintedCount = addressMintedBalance[msg.sender]; require(tx.origin == msg.sender, "Only EOA"); require(_mintAmount > 0, "Cant mint 0"); require(_mintAmoun...
15,132,835
/** *Submitted for verification at Etherscan.io on 2021-04-18 */ pragma solidity 0.6.6; /* * @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. * @author Stefan George - <[email protected]> */ contract MultiSigWallet { /* * Events */ event Confirm...
Allows an owner to batch confirm transactions. transactionIdArray Transaction ID array.
function batchConfirmTransaction(uint[] memory transactionIdArray) public { for(uint i = 0; i < transactionIdArray.length; i++ ) { confirmTransaction(transactionIdArray[i]); } }
7,941,300
//SPDX-License-Identifier: MIT License pragma solidity ^0.8.0; contract AccessControl { address public owner; uint16 public totalStaff = 0; mapping(address => bool) public staff; modifier onlyOwner() { require(msg.sender == owner, 'You are not the owner'); _; } ...
Mint a new token for an owner. badge type should have been defined previously, this is a link to the metadata uri.
function mintToken( address owner, uint16 badgeType ) public onlyStaff { BadgeTypes[totalTokens] = badgeType; _mint(owner, totalTokens); totalTokens = totalTokens + 1; }
1,079,358
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...
Rejects an appeal on a challenge. Can only be called by the appeals resolver./
function dismissAppeal(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,558
./full_match/97/0x5b0e4cc107Fd3B637454038767630F39B79B1d31/sources/contracts/ZamzamDAO.sol
Refund tokens to a donor Refunds the unused tokens of a Zamzam project `projectId` back to the msg.sender projectId The ID of the project whose tokens will be refunded return Returns true if refund of tokens of project was successful/
function refundDonor(uint256 projectId) external nonReentrant returns (bool) { Project storage project = projects[projectId]; require(project.refundsAllowed, "ZamzamDAO: Refunds not allowed"); require((project.totalRaised - project.totalSpent) > 0, "ZamzamDAO: Insufficient funds"); uint256 totalFund...
3,265,695
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
requireIsOperational require(funded[msg.sender]==true,"Not funded flights cant vote"); require(votemap[msg.sender]!=Voter,"Airline already voted");uint256 counter1=votes[Voter];votemap[msg.sender]=Voter;
function giveVotes ( address Voter, bool vote ) external { votes[Voter]=vote; }
6,367,257
./full_match/1/0x03b1458fE995c6760Da16a574c17494D1ED88FA1/sources/contracts/Buccaneers_flattened.sol
Owner can close minting period./
function closeMint() external onlyOwner { mintOpen = false; }
17,055,575
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IMintableERC20.sol"; import "./NftStakeVaultV2.sol"; /** @title SamuraiSagaStakeVaultV2 */ contract SamuraiSagaStakeVaultV2 is NftStakeVaultV2 { event BatchStake(address indexed account, uint256 poolId, uint256[] tokenIds); event B...
Allow a user to [re]stake a token in a new pool without unstaking it first./
function restake(uint256 newPoolId, uint256 tokenId) external nonReentrant { require(_deposits[tokenId].owner == _msgSender(), "Stake: Not owner of token"); address account = _msgSender(); uint256 rewards = _restake(newPoolId, tokenId); _sendAndUpdateRewards(account, rewards); ...
12,209,492
./partial_match/3/0x0faE7276b29737Fc53414fC4757BC45Ea64ae7d1/sources/PolkaBeam.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
5,281,577
/** * Copyright 2017-2021, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; import "./LoanTokenSettingsLowerAdmin.sol"; import "./interfaces/ProtocolLike.sol"; import "./interfaces/FeedsLike.sol"; import "../../modules/...
Public wrapper for internal call. borrowAmount The amount of tokens to borrow. return The next borrow interest rate. /
function nextBorrowInterestRate(uint256 borrowAmount) public view returns (uint256) { return _nextBorrowInterestRate(borrowAmount); }
13,047,654
./full_match/97/0xE7bE05433Fbd1b59d58cEEE3037D0D0baa358898/sources/contracts/EscrowStack.sol
Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator. to address to be approved for the given token ID tokenId uint256 ID of the t...
function approve(address to, uint256 tokenId) public { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( msg.sender == owner, "ERC721: approve caller is not owner nor approved for all" ); _tokenAppr...
3,289,785
pragma solidity 0.5.16; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./IStakingContract.sol"; import "./IStakeChangeNotifier.sol"; contract StakingContract is IStakingContract, IMigratableStakingContract { using SafeMath for uint256; struct Stake { uint256 amount; uint256 coo...
Returns the time that the cooldown period ends (or ended) and the amount of tokens to be released. _stakeOwner address The address to check. return cooldownAmount uint256 The total tokens in cooldown. return cooldownEndTime uint256 The time when the cooldown period ends (in seconds).
function getUnstakeStatus(address _stakeOwner) external view returns (uint256 cooldownAmount, uint256 cooldownEndTime) { Stake memory stakeData = stakes[_stakeOwner]; cooldownAmount = stakeData.cooldownAmount; cooldownEndTime = stakeData.cooldownEndTime; }
1,815,891
//Address: 0x9200f1be36761dab295673279afb09d4f2b2531c //Contract name: ExtendedQuantstampSale //Balance: 0 Ether //Verification Date: 11/10/2017 //Transacion Count: 4 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMa...
Returns the current time. Useful to abstract calls to "now" for tests./
function currentTime() public constant returns (uint _currentTime) { return now; }
2,529,866
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // import '../Apple-swap-lib/SafeMath.sol'; import '../Apple-swap-lib/IBEP20.sol'; import '../Apple-swap-lib/BEP20.sol'; interface IWBNB { function deposit() external payable; function transfer(address to, uint256 value) external returns (bool); func...
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = balances[address(this)]; if (lpSupply == 0) { pool.lastRewardBlock = block.number; r...
13,062,411
/* 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 ...
Returns true if the order's limitFee is negative./
function isNegativeLimitFee( Order memory order ) private pure returns (bool) { return (order.flags & IS_NEGATIVE_FEE_FLAG) != bytes32(0); }
15,827,433
// Diode Contracts // Copyright 2021 Diode // Licensed under the Diode License, Version 1.0 pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "./IBNS.sol"; /** * BNS Blockchain Name System */ contract BNS is IBNS { address public _reserved; mapping(bytes32 => BNSEntry) public names; struct Rev...
Registers `_name` and assigns it to a single `_destination` address. _name the name to be created. _destination the single destination to be assigned./
function Register(string calldata _name, address _destination) external override { register(_name, _destination); }
6,427,355
/** *Submitted for verification at Etherscan.io on 2021-11-20 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.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 progr...
called on transfers
function updateReward(address _from, address _to) external { require(canBurn[msg.sender]); uint256 time = min(block.timestamp, END); uint256 timerFrom = lastUpdate[_from]; if (timerFrom > 0) rewards[_from] += comicbook.userBalance(_from).mul(BASE_RATE.mul((time.sub(timer...
5,975,831
./full_match/5/0xA5f37E3c8B7E7a8c64B4dc71ff068FdD25703db8/sources/project_/contracts/Deep42.sol
For increasing or decreasing the max supply ba character type
function setMaxSupply(uint16 _characterType, uint16 _maxSupply) public onlyOwner { require( characterTypeExists(_characterType), "Character type does not exist!" ); characterDataLimitsByCharacterTypes[_characterType] .maxSupply = _maxS...
1,885,563
pragma solidity 0.4.24; pragma experimental "v0.5.0"; /* Copyright 2018 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/LICENS...
Burn an invalid token. Callable by anyone. Used to burn unecessary tokens for clarity and to free up storage. Throws if the position is not yet closed. positionId Unique ID of the position/
function burnClosedToken( bytes32 positionId ) external nonReentrant { burnClosedTokenInternal(positionId); }
7,913,278
./partial_match/1/0xB720f409d43b490F6aeE1D9048797B8C19A3Ac06/sources/contracts/BrewlabsAggregationRouter.sol
Find the market price between gas-asset(native) and token-out and express gas price in token-out Leave result in nWei to preserve precision for assets with low decimal places
function getGasPriceInExitTkn(uint256 _gasPrice, address _tokenOut) internal view returns (uint256 price) { FormattedOffer memory gasQuery = findBestPath(1e18, WNATIVE, _tokenOut, 2); if (gasQuery.path.length != 0) { price = (gasQuery.amounts[gasQuery.amounts.length - 1] * _gasPrice) / 1...
4,474,628
./partial_match/1/0x8A36855426a79c92Bd098FB2F5D0089c38FA1658/sources/BedtimeGasslessV2.sol
Required interface of an ERC721 compliant contract./
interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function ba...
2,626,999
// ███████╗░█████╗░██████╗░██████╗░███████╗██████╗░░░░███████╗██╗ // ╚════██║██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗░░░██╔════╝██║ // ░░███╔═╝███████║██████╔╝██████╔╝█████╗░░██████╔╝░░░█████╗░░██║ // ██╔══╝░░██╔══██║██╔═══╝░██╔═══╝░██╔══╝░░██╔══██╗░░░██╔══╝░░██║ // ███████╗██║░░██║██║░░░░░██║░░░░░███████╗██║░░██║██╗██...
token to weth (via uniswapV2) weth to wbtc (via balancer) enter curve with wbtc
function ZapInWithERC20( address _toWhomToIssue, address _IncomingTokenAddress, address _curvePoolExchangeAddress, uint256 _IncomingTokenQty, uint256 _minPoolTokens ) internal stopInEmergency returns (uint256 crvTokensBought) { require(_IncomingTokenQty > 0, "Err:...
5,751,783
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "../utils/OwnablePausable.sol"; import "...
Buyback stable token. amount Amount of payment token./
function buy(uint256 amount) external whenNotPaused { uint256 productAmount = amount.div(10**(decimals.sub(product.decimals()))); require(productAmount > 0, "BuybackDepositaryBalanceView::buy: invalid product amount"); require(productAmount <= product.balanceOf(address(this)), "BuybackDeposi...
12,661,536
pragma solidity >=0.4.25; import "./SafeMath.sol"; contract AbstractExcaliburDLL { function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address exchange) public returns(bool) { } function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address e...
Order(tokenGet, amountGet, tokenGive, amountGive, exchange, msg.sender, hash);
function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address exchange) public exIsConnected returns(bool) { bytes32 hash = keccak256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, exchange)); orders[exchange][msg.sender][hash] = true; retur...
12,872,704
pragma solidity ^0.4.11; import "../RocketPoolToken.sol"; import "../base/SalesAgent.sol"; import "../base/Owned.sol"; import "../lib/SafeMath.sol"; /// @title The main Rocket Pool Token (RPL) presale contract /// @author David Rugendyke - http://www.rocketpool.net /**************************************************...
Constructor Sale Agent Init _tokenContractAddress The main token contract address Set the main token address
function RocketPoolPresale(address _tokenContractAddress) { tokenContractAddress = _tokenContractAddress; }
12,813,843
/** *Submitted for verification at Etherscan.io on 2021-10-05 */ /** *Submitted for verification at Etherscan.io on 2021-10-05 */ /** *Submitted for verification at Etherscan.io on 2021-10-05 */ // Sources flattened with hardhat v2.6.4 https://hardhat.org // File contracts/Interfaces/IBorrowerOperations.sol p...
trigger bamm (p)lqty claim duplicate harvest logic
function getUnclaimedLqty(address user, BAMM bamm, ERC20 token) public returns(uint) { bamm.withdraw(0); if(bamm.total() == 0) return 0; uint crop = sub(token.balanceOf(address(bamm)), bamm.stock()); uint share = add(bamm.share(), rdiv(crop, bamm.total())); uint last = bam...
10,519,884
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.11; pragma experimental ABIEncoderV2; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ ...
Update the gauge_relative_weight
function sync_gauge_weight(bool force_update) public { if (force_update || (block.timestamp > last_gauge_time_total)){ last_gauge_relative_weight = gauge_controller.gauge_relative_weight_write(address(this), block.timestamp); last_gauge_time_total = gauge_controller.time_total(); ...
1,017,162
// SPDX-License-Identifier: MIT pragma solidity =0.8.11; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openze...
Withdraw stake tokens and collect rewards./
function unStake() external whenNotPaused nonReentrant { require(stakeHolders[_msgSender()].inStake, "Not in stake"); _harvestAll(_msgSender()); uint256 stakedBal = stakeHolders[_msgSender()].stakedBal; uint256 balance = _unStakeBal(_msgSender()); uint256 balanceDiff = staked...
12,585,587
//! The simple registry contract. //! //! Copyright 2016 Gavin Wood, Parity Technologies Ltd. //! //! 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/license...
OwnerRegistry views
function getOwner(bytes32 _name) external view whenEntryRaw(_name) returns (address) { return entries[_name].owner; }
928,851
./full_match/1/0x9958bDD69bc3c70A285431dd9FBA5cC76585724d/sources/contracts/auctions/SettleNFTAuction.sol
solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32) { return _domainSeparator(); } bytes32 private constant CREATE_SIGNATURE_HASH = keccak256("CreateAuction(address nft,uint256 tokenId,address auction,address token,uint256 endTime,uint256 minimumBid,uint256 nonce,uint256 deadline)"); ...
4,832,694
./partial_match/7700/0xfDf5Ed2D354e05cF292808CF94Bd5c972D842D09/sources/contracts/lens/CrocQuery.sol
Queries and returns the surplus collateral of a virtual token owner The address of the owner of the surplus collateral tracker The address of the virtual token tracker salt The virtual token salt for the query return The total amount of surplus collateral held by this owner in this token. 0 if none. /
function queryVirtual (address owner, address tracker, uint256 salt) public view returns (uint128 surplus) { address token = PoolSpecs.virtualizeAddress(tracker, salt); surplus = querySurplus(owner, token); }
3,506,680
./full_match/80001/0xbdfd80D02849d73d732DA28FD52186Edb8c587BC/sources/contracts/Episodes.sol
Verifique se o usuário possui o token do episódio Verifique se o usuário possui pelo menos 10 tokens do contrato Cards com IDs diferentes
function burnToEarn(uint256 _tokenId) external { require(balanceOf[msg.sender][_tokenId] > 0, "You do not own this Episode"); uint256 differentIds = 0; for (uint i=0; i<E1C1Requirements[_tokenId].length; i++) { if (cards.balanceOf(msg.sender, E1C1Requirements[_tokenId][i]) > 0) { di...
5,566,703
./partial_match/1/0xBB5A7481BEE7b1F058E006FC717379EE0B54d25d/sources/src/Jackpot.sol
Start the new game./
function start() public onlyOwner { if (players[game].length > 0) { pickTheWinner(); bonuspool[game + 1] = bonuspool[game]; } startGame(); }
4,125,358
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import {IERC20} from 'openzeppelin-contracts/token/ERC20/IERC20.sol'; import {SafeERC20} from 'openzeppelin-contracts/token/ERC20/SafeERC20.sol'; import {MerkleProof} from "openzeppelin-contracts/cryptography/MerkleProof.sol"; import {Pausable} from "openzeppelin...
If none claimable for token or none specifed to claim, skip this token If none claimable, don't attempt to claim
function _tryClaim( address account, address token, uint256 cumulativeClaimable ) internal returns (bool claimAttempted) { if (cumulativeClaimable == 0) { return false; } uint256 claimedBefore = _getClaimed(account, token); uint256 toClaim = c...
6,845,924
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/@keep-network/ecdsa/contracts/libraries/EcdsaDkg.sol
Checks if DKG result is valid for the current DKG. result DKG result. return True if the result is valid. If the result is invalid it returns false and an error message.
function isResultValid(Data storage self, Result calldata result) internal view returns (bool, string memory) { require(self.startBlock > 0, "DKG has not been started"); return self.dkgValidator.validate(result, self.seed, self.startBlock); }
4,856,790
/* *Submitted for verification at polygonscan.com on 2022-04-13 */ // SPDX-License-Identifier: MIT /* ███╗░░░███╗███████╗████████╗░█████╗░███╗░░██╗░█████╗░██╗░█████╗░ ████╗░████║██╔════╝╚══██╔══╝██╔══██╗████╗░██║██╔══██╗██║██╔══██╗ ██╔████╔██║█████╗░░░░░██║░░░███████║██╔██╗██║██║░░██║██║███████║ ██║╚██╔╝██║██╔══╝░░...
Gets one or more distinct pseudorandom numbers _in the range [1,_max] based on a seed provided by the function caller. WARNING: This is not suitable for use as a truly random number generator - it is only suitable as a method to morph a seed generated outside the blockchain to a number or set ...
function _getDistinctPseudoRandomNumbers(uint _seed, uint _quantity, uint _max) internal { require(_quantity < _max, "Cannot return more pseudorandoms than exist in the range. Please ensure _quantity < _max."); uint N = _max; uint M = _quantity; uint _in; uint _i...
7,238,630
// SPDX-License-Identifier: MIT // File: contracts/Signer.sol pragma solidity ^0.8.3; /* Signature Verification How to Sign and Verify # Signing 1. Create message to sign 2. Hash the message 3. Sign the hash (off chain, keep your private key secret) # Verify 1. Recreate hash from the original message 2. Recover si...
Withdraws balance from the contract to the owner (sender). amount - the amount to withdraw, much be <= contract balance and dev allotment./
function withdrawOwner(uint256 amount) external onlyOwner { require(address(this).balance >= amount + developerAllotment(), "Invalid amt"); require(success, "Trans failed"); emit Withdraw(msg.sender, amount); }
1,233,932
pragma solidity 0.6.2; // import "./BiToken.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract TimeLockedWallet { address relayer; address tokenAddress; address public architect; address payable public owner; uint256 public unlockDate; uint256 public createdAt; mo...
callable by owner only, after specified time, only for Tokens implementing ERC20now send all the token balance
function withdrawTokens() external onlyOwner { require(now >= unlockDate,"TimeLock:Can't withdraw before releasing time"); uint256 tokenBalance = IERC20(tokenAddress).balanceOf(address(this)); IERC20(tokenAddress).transfer(owner, tokenBalance); WithdrewTokens(tokenAddress, _msgSender...
5,525,170
pragma solidity 0.5.17; contract Timelock { using SafeMath for uint256; /// @notice An event emitted when the timelock admin changes event NewAdmin(address indexed newAdmin); /// @notice An event emitted when a new admin is staged in the timelock event NewPendingAdmin(address indexed newPend...
timelock not enforced prior to updating the admin. This should occur on deployment.
function executeTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call mu...
7,332,366
// Copyright 2021 Cartesi Pte. Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 ...
get this contract balance first we have spare tokens we can stake check if there is anything already maturing, to avoid reset the maturation clock nothing is maturing, we can stake the balance, preserving the liquidity some is already releasing let's check timestamp to see if we can withdrawn it there it is, let's grab...
function amounts() public view override returns ( uint256 stake, uint256 unstake, uint256 withdraw ) { uint256 balance = ctsi.balanceOf(address(this)); if (balance > requiredLiquidity) { uint256 maturing = s...
910,725
// SPDX-License-Identifier: MIT pragma solidity >=0.4.25 <0.7.0; import '@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/math/MathUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol'; import '@openzeppelin/con...
makePayout function runs once per day and takes all the AXN earned as interest and puts it into payout array for the daycall updateShareRate once a day as sharerate increases based on the daily Payout amount
function makePayout() public { require(now >= nextPayoutCall, 'Staking: Wrong payout time'); uint256 payout = _getPayout(); payouts.push( ); nextPayoutCall = nextPayoutCall.add(stepTimestamp); updateShareRate(payout); emit MakePayout(payout, sharesTotalSu...
1,400,717
./partial_match/4/0x9b4aCeB68B760b035826a270ebD02DB391Ce0e65/sources/Agreement.sol
Tell whether an action can be challenged _action Action instance return True if the action can be challenged, false otherwise/
function _canChallenge(Action storage _action) internal view returns (bool) { return _canProceed(_action) && _action.disputable.canChallenge(_action.disputableActionId); }
8,724,951
pragma solidity ^0.4.17; import '../token/ERC20Token.sol'; /// @title Dutch auction contract - distribution of a fixed number of tokens using an auction. /// The contract code is inspired by the Gnosis auction contract. Main difference is that the /// auction ends if a fixed number of tokens was sold. contract DutchA...
Calculates the token price (WEI / RDN) at the current timestamp during the auction; elapsed time = 0 before auction starts. Based on the provided parameters, the price does not change in the first `price_constant^(1/price_exponent)` seconds due to rounding. Rounding in `decay_rate` also produces values that increase in...
function calcTokenPrice() constant private returns (uint) { uint elapsed; if (stage == Stages.AuctionStarted) { elapsed = now - start_time; } uint decay_rate = elapsed ** price_exponent / price_constant; return price_start * (1 + elapsed) / (1 + elapsed + decay_r...
2,497,319
./partial_match/1/0x336A24FC03c93101D4e31160c27EeaEdc34BE01d/sources/XLand.sol
Transfer tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 the amount of tokens to be transferred/
function transferFrom( address from, address to, uint256 value ) public returns (bool) { require(value <= _balances[from],"balance not enough!!"); require(value <= _allowed[from][msg.sender],"allow not enough"); require(to != address(0),"target address can't be empty(0)"); _ba...
4,295,601
./partial_match/1/0x441761326490cACF7aF299725B6292597EE822c2/sources/UNFI.sol
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) { _transfer(msg.sender, to, value); return true; }
2,615,350
./partial_match/42/0xB62684aD8e5998793Fd79bD0b8A99441be570e2b/sources/CyclopsBank.sol
returns contract tokens balance/
function getContractTokensBalance(address token_address) external view returns (uint256) { UniversalToken token = UniversalToken(token_address); return token.balanceOf(_own_address); }
3,372,206
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018 Crossbar.io Technologies GmbH and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy ...
As a data provider, request a new payment channel to get paid by the market maker. Given sufficient security amount (deposited by the data provider when joining the marker) to cover the request amount, the market maker will open a payment (state) channel to allow the market maker buying data keys in microtransactions, ...
function requestPayingChannel (bytes16 marketId, address recipient, address delegate, uint256 amount, uint32 timeout) public { require(markets[marketId].owner != address(0), "NO_SUCH_MARKET"); require(markets[marketId].maker != address(0), "NO_ACTIVE_MARKET_MAKER"); require(uint8(...
2,513,807
// SPDX-License-Identifier: AGPL-3.0-or-later\ pragma solidity 0.7.5; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are as...
Function that lets user unstake OHM/DAI LP in system
function unstakeLP() external returns ( bool ) { updatePool(); User storage user = userDetails[msg.sender]; require(user._LPDeposited > 0, "User has no stake"); uint256 _pendingRewards = user._LPDeposited.mul(accOHMPerShare).div(1e18).sub(user._rewardDebt); uint25...
1,180,805
./full_match/11155111/0x8727c9a10DF1bb213E1e28b650345b9cCAe438Ae/sources/contracts/CrowdFunding.sol
Update the donor's vote
function vote(uint256 _campaignId, uint voteValue) public { Campaign storage campaign = campaigns[_campaignId]; int index = -1; for (uint i = 0; i < campaign.donators.length; i++) { if (msg.sender == campaign.donators[i]) { index = int(i); break; ...
3,822,461
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; contract crowdfunding{ enum Category{ DESIGNANDTECH, FILM, ARTS, GAMES } enum RefundPolicy{ REFUNDABLE, NONREFUNDABLE } // Structure of each project in our dApp struct Project{ ...
Returns the project at the given index
function getProject(uint256 _index) external view validIndex(_index) returns(Project memory project) { return projects[_index]; }
7,275,651
./full_match/5/0x0F265cA07bBdF16700ae7E1C7e1efD04f6e22718/sources/_connext/smart-contracts/contracts/shared/libraries/TypedMemView.sol
Parse an unsigned integer from LE bytes. memView The view _index The index _bytes The bytes return result - The unsigned integer/
function indexLEUint( bytes29 memView, uint256 _index, uint8 _bytes ) internal pure returns (uint256 result) { return reverseUint256(uint256(index(memView, _index, _bytes))); }
11,604,222
pragma solidity ^0.4.0; import './SafeMath.sol'; /** * Here is an example of upgradable contract, consisting of three parts: * - Data contract keeps the resources (data) and is controlled by the Handler contract; * - Handler contract (implements Handler interface) defines operations and provides services. This...
Getter of proposalPeriod. exception UninitializationException uninitialized contract. exception GetterPermissionException msg.sender is not permitted to call the getter. return this.proposalPeriod./
function getProposalPeriod () public view ready allowedAddress returns(uint256) { return proposalPeriod; }
932,757
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Escrow { enum State { AWAITING_PAYMENT, AWAITING_DELIVERY, COMPLETE } struct Bounty { State state; address payable contributor; address payable payer; uint256 value; Levels contributorLevel; } enum Levels { ...
value is subtracted here in case contributor initial percentage changes afterwards
function deposit(bytes32 bountyHash) external payable onlyPayer(bountyHash) { require( _bounties[bountyHash].state == State.AWAITING_PAYMENT, "BOUNTY_ALREADY_PAYED_FOR" ); require(msg.value == _bounties[bountyHash].value, "WRONG_BOUNTY_VALUE"); _bounties[bountyHash].state = State.AWAITIN...
938,241
//Address: 0x40ae4acd08e65714b093bf2495fd7941aedfa231 //Contract name: SmartzToken //Balance: 0 Ether //Verification Date: 3/29/2018 //Transacion Count: 13 // CODE STARTS HERE pragma solidity ^0.4.18; interface IApprovalRecipient { /** * @notice Signals that token holder approved spending of tokens and som...
Standard transferFrom overridden to have a chance to thaw sender's tokens. _from address the address which you want to send tokens from _to address the address which you want to transfer to _value uint256 the amount of tokens to be transferred return true iff operation was successfully completed/
function transferFrom(address _from, address _to, uint256 _value) public payloadSizeIs(3 * 32) returns (bool) { thawSomeTokens(_from, _value); return super.transferFrom(_from, _to, _value); }
12,924,196
./full_match/1/0x99f763326419f5055149B6045355a7a201c2a9e1/sources/FinanceClaim/src/FinanceClaim.sol
Deposit ERC-20 funds in the pool that will later be claimable by a user Only triggerable by FinOps poolIndex Index of the pool in FixedSwap contract amount Amount to deposit in the pool
function depositFunds(uint256 poolIndex, uint256 amount) external onlyFinOps isValidPoolIndex(poolIndex) { if (amount == 0) { revert ClaimErrors.FinanceClaim__ZeroDepositFunds(); } if (pools[poolIndex].reward == address(0)) { revert ClaimErrors.FinanceClaim__RewardNot...
17,006,896
./partial_match/1/0x45A353132143f475B355620aD9d7413D0222Ea04/sources/APP.sol
Allows `_spender` to spend no more than `_value` tokens in your behalf _spender The address authorized to spend _value the max amount they can spend
function approve(address _spender, uint256 _value) returns (bool success) { allowance[msg.sender][_spender] = _value; return true; }
4,335,935
/** *Submitted for verification at Etherscan.io on 2022-01-11 */ /** *Submitted for verification at Etherscan.io on 2022-01-11 */ /** *Submitted for verification at BscScan.com on 2021-01-11 */ // SPDX-License-Identifier: Unlicensed // Created by Mezorn LLC pragma solidity ^0.8.0; /** * @dev Interface of the ...
Replacement for Solidity's `transfer`: sends `amount` wei to `recipient`, forwarding all available gas and reverting on errors. of certain opcodes, possibly making contracts go over the 2300 gas limit imposed by `transfer`, making them unable to receive funds via `transfer`. {sendValue} removes this limitation. IMPORTA...
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance!"); require(success, "Address: unable to send value, recipient may have reverted"); }
15,026,865
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import '../interfaces/IERC20.sol'; import '../interfaces/IERC721.sol'; import '../interfaces/IERC721Metadata.sol'; import '../interfaces/IERC721Receiver.sol'; import '../Dependencies/Base64.sol'; /** @title Voting Escrow @author Curve Finance @notice Votes have...
Record global data to checkpoint
function checkpoint() external { _checkpoint(0, LockedBalance(0, 0), LockedBalance(0, 0)); }
900,058
pragma solidity ^0.8.0; import "@c-layer/common/contracts/operable/Operable.sol"; import "@c-layer/common/contracts/lifecycle/Pausable.sol"; import "../interface/ITokensale.sol"; /** * @title BaseTokensale * @dev Base Tokensale contract * * @author Cyril Lapinte - <cyril.lapinte@openfiz.com> * SPDX-License-Iden...
refund unspentETH/
function refundUnspentETH() public override returns (bool) { refundUnspentETHInternal(payable(msg.sender)); return true; }
2,531,952
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; contract UserModule { /** * @dev User function to supply. * @param token_ address of token. * @param amount_ amount to supply. * @param to_ address to send vTokens to. * @return vtokenAmount_ amount of vTokens sent to the `to_` a...
base token revenue stored in the vault/
function revenue() public view returns (uint256) {}
6,644,133
pragma solidity ^0.4.24; import "../ERC20/IERC20.sol"; import "../crowdsale/ICrowdsale.sol"; import "./IPresale.sol"; import "../access/roles/ManagerRole.sol"; import "../access/roles/RecoverRole.sol"; import "../math/SafeMath.sol"; /** * @title Presale module contract * */ contract Presale is IPresale, ManagerRol...
Subtract presale tokens to accounts (only contract Manger and only at Presale Stage) presaleAccounts The accounts to subtract presale token balances from values The amount of tokens to subtract from each account/
function subPresaleBalance(address[] presaleAccounts, uint256[] values) external onlyManager atStage(Stages.Presale) returns (bool) { require(presaleAccounts.length == values.length, "presaleAccounts and values must have one-to-one relationship"); for (uint32 i = 0; i < presaleAccounts.leng...
14,034,853
pragma solidity >=0.4.22 <0.8.0; contract Election { // Model a candidate struct Candidate{ uint id; string name; uint voteCount; } // Store a candidate //Fetch Candidate mapping(address => bool) public voters; mapping(uint => Candidate) public candidates; function vote(uint _candidateId) public { //reco...
record that voter has voted require that the voter hasn't voted before require a valid candidate update candiadte voteCount
function vote(uint _candidateId) public { require (!voters[msg.sender]); require (_candidateId > 0 && _candidateId <= candidatesCount); voters[msg.sender] = true; candidates[_candidateId].voteCount ++; }
5,346,096
./partial_match/1/0x75Cae30025A514b7AE069917E132Cc99762A0e16/sources/contracts/XSD/Pools/CollateralPool.sol
Combined into one function due to 24KiB contract memory limit
function setPoolParameters(uint256 new_redemption_delay, bool _mint_paused, bool _redeem_paused, bool _buyback_paused) external onlyByOwner { redemption_delay = new_redemption_delay; mint_paused = _mint_paused; redeem_paused = _redeem_paused; buyback_paused = _buyback_paused; ...
16,093,037
// SPDX-License-Identifier: MIT pragma solidity 0.7.3; import "@openzeppelin/contracts-upgradeable-0.7.2/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable-0.7.2/utils/ReentrancyGuardUpgradeable.sol"; import "./ISuperRareAuctionHouse.sol"; import "../SuperRareBazaarBase.sol"; /// @author kolo...
Checks the user has the correct amount and transfers to the marketplace. If the currency used is eth (zero address) the msg value is checked. If eth isnt used and eth is sent we revert the txn. We need to check this contracts balance before and after the transfer to ensure no fee. _currencyAddress Currency address ...
function _checkAmountAndTransfer(address _currencyAddress, uint256 _amount) internal { if (_currencyAddress == address(0)) { require(msg.value == _amount, "not enough eth sent"); return; } require(msg.value == 0, "msg.value should be 0 when not using eth"...
9,838,466
./partial_match/42/0xD8ADbda80801278Bd1Bf8C1107DDF035f81a8F64/sources/Unwind.sol
Multiplies x and y, assuming they are both fixed point with 27 digits.
function nonces(address user) external view returns (uint256); function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) external; } pragma solidity ^0.6.10; } pragma solidity ^0.6.10; } pragma solidity ^0.6.10; } ...
3,381,281
pragma solidity ^0.5.13; import "./SKUFactory.sol"; /** * @title StockRoom * @notice Main contract for reference data side of the In-game Pro Shop System */ contract StockRoom is SKUFactory { /** * @notice Set the address of the FiatContract contract */ function setFiatContractAddress(address _...
confirm this is a StockRoom contract
function isStockRoom() external pure returns (bool) { return true; }
13,086,386
./partial_match/1/0x8fa702D65542596aC1AD3C5454C622C13e53085E/sources/Moona_Lisa_Print_Original.sol
Transfers `tokenId` from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event./ The neste...
function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); ( ...
2,771,313
pragma solidity 0.4.21; library SafeMath { function mul(uint a, uint b) internal pure returns(uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function sub(uint a, uint b) internal pure returns(uint) { assert(b <= a); return a - b; } fu...
transfer tokens from given address to another address _from {address} from whom tokens are transferred _to {address} to whom tokens are transferred _value {uint} amount of tokens to transfer return {bool} true if successful
function transferFrom(address _from, address _to, uint256 _value) public returns(bool success) { require(_to != address(0)); emit Transfer(_from, _to, _value); return true; }
268,617
pragma ton-solidity >= 0.38.2; /// @title LiquiSOR\SORDebot /// @author laugan /// @notice Debot for customer and liquidity provider interations. pragma AbiHeader expire; pragma AbiHeader time; pragma AbiHeader pubkey; //================================================================================ // import "../....
Define DeBot version and title here.
function getVersion() public override returns (string name, uint24 semver) { (name, semver) = ("SORDebot", _version(0, 1, 0)); }
13,056,457
./partial_match/3/0x3fBeB3B90fb7e03b4F6C2a6D345C06Da8e667279/sources/ETRToken.sol
get ICO bonus percent by time(week)./
function getBounusPercent() private view returns (uint256) { uint8[5] memory bonusPercents = [200, 100, 50, 25, 0]; uint256 currentDay = now; uint256 delta = currentDay.sub(startDate); uint256 weekIndex = delta.div(3600 * 24 * 7); uint256 bonus = 0; if (weekIndex < 4...
5,095,299
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.5.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 ...
Generate the leaf node (just the hash of tokenID concatenated with the account address)
function _leaf(address account) internal pure returns (bytes32) { return keccak256(abi.encodePacked(account)); }
32,648
pragma solidity 0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer...
Deregisteres a settlement layer, clearing the details. _settlementID The unique 64-bit settlement identifier.
function deregisterSettlement(uint64 _settlementID) external onlyOwner { require(settlementDetails[_settlementID].registered, "not registered"); delete settlementDetails[_settlementID]; emit LogSettlementDeregistered(_settlementID); }
1,044,454