file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// File: contracts/vaults/IStrategy.sol ...
inject NONSTANDARD NAMING
function EARNED23() external view returns (uint256) {
1,825,162
./full_match/1/0x500a7eAB8ae0fC36Bf586A8F5149d2885A3b40a3/sources/browser/Pool.sol
Deposit LP tokens to StakingContract for TIGER allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accTigerPerShare).div(1e12).sub(user.reward...
9,613,297
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "zos-lib/contracts/Initializable.sol"; import "openzeppelin-eth/contracts/token/ERC721/ERC721Metadata.sol"; import "openzeppelin-eth/contracts/token/ERC721/ERC721.sol"; import "openzeppelin-eth/contracts/token/ERC721/ERC721Enumerable.sol"; import "contra...
Mints a token after validating the given merkle proof and comparing it to the anchor registry's stored hash/doc ID. _to address The recipient of the minted token _tokenId uint256 The ID for the minted token _anchorId bytes32 The ID of the document as identified by the set up anchorRegistry. _merkleRoot bytes32 The ...
function _mintAnchor( address _to, uint256 _tokenId, uint256 _anchorId, bytes32 _merkleRoot, string memory _tokenURI, string[] memory _values, bytes32[] memory _salts, bytes32[][] memory _proofs ) internal { require( _isValidAnchor(_anchorId, _merkleRoot), "docum...
1,752,633
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol"; /* Basically this is supposed to be a smart contract that self-regulates masterchef Inflation is pre-determined with this contract... It can also be mo...
TO-DO PREVENT CALLING OF MOST FUNCTIONS WHEN GRAND FIBONNACENING IS ACTIVE!!! (freeze funciton..perhaps should be during several things)
function InitiateSetMinDeposit(int depositingTokens, int number) { if(number < minimum) { reject "immutable minimum 1000tokens" } if(depositingTokens > maximumVoteTokens) { "preventing tyranny, maximum 0.05% of tokens" } if (number < costToVote) { } if (depositingTokens != costToVote) { reject "costs to vote" ...
1,047,255
./full_match/42/0xC04Add9DfD7bbAd3c43DCCEB90BB32A8b40b4FAF/sources/TokitRegistry.sol
Sets an owner and registrar addresses/
function initialize() public initializer { OwnableUpgradeable.__Ownable_init(); setRegistrar(_msgSender(), true); }
16,293,394
./partial_match/3/0xB19f572FA4cd7ad20845Cd25015CA1CE1B717aef/sources/DeCashUpgrade.sol
Storage get methods
function getAddress( bytes32 _key) internal view returns (address) { return decashStorage.getAddress( _key); }
5,221,915
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { ...
change owner to 0x0 to lock this function
function initializeCrowdsale(address crowdsaleContractAddress, uint256 tokensAmount) onlyOwner public { transfer((address)(0x0), tokensAmount); allowance[(address)(0x0)][crowdsaleContractAddress] = tokensAmount; crowdsale = BasicCrowdsale(crowdsaleContractAddress); isTokenTransferab...
6,420,525
./full_match/3/0x824Ba42295Eb43fAF560417A85fA28Fbe435275F/sources/browser/Contract_Code_Min.sol
get the user address of the corresponding user invite code Authorization Required code user invite Code return address/
function getCodeMapping(address code) public view returns (address addr) { addr = _getCodeMapping(code); return addr; }
8,108,452
pragma solidity ^0.4.18; /* * Author: Dziugas Butkus * Description: Lets users donate to charities. Funds are transfered directly to charity's address. * Owner creates donation events, duration and goals in ether. */ contract Donations { address public owner; // Contract owner's ...
sendDonation() send donation directly to organization's address/require(msg.sender != owner);
function sendDonation() public payable returns(bool success) { require(state == State.Active); require(msg.value > 0); uint amount = msg.value; if (balanceOf[msg.sender] <= amount) { organizationAddress.transfer(amount); raisedAmount += amount; DonateEve...
2,480,833
/* Copyright 2022 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Returns the absolute value of int256 `a` as a uint256/
function abs(int256 a) internal pure returns (uint) { return a >= 0 ? a.toUint256() : a.mul(-1).toUint256(); }
1,613,486
./partial_match/1/0xA02Ff43513c55009541b26491E616c3f3CFA3b06/sources/JETYFIPool.sol
stake visibility is public as overriding LPTokenWrapper's stake() function
function stake(uint256 amount, address staker) public override updateReward(staker) checkStart onlyHelper { require(amount > 0, "PoolStake: Cannot stake 0"); uint256 newDeposit = deposits[staker].add(amount); require( newDeposit <= 2500...
4,200,176
pragma solidity 0.6.1; pragma experimental ABIEncoderV2; contract productContract { Product[] public supplyChain; //stores all of the products created. mapping(string => Transaction) public transactionDetail; // uses the trackingID as the key to view current custodian and their address. mapping(strin...
The addProduct will create a new product only if they are the manufacturer. Sold and Recall values are set to false and containerID is "" when a product is created.
function addProduct(string memory _productName, string memory _health, string memory _misc, string memory _trackingID, string memory _lastScannedAt) public onlyManufacturer{ uint256 _timestamp = block.timestamp; bool _sold = false; bool _recalled = false; string memory _con...
950,904
./full_match/1/0x2270D7733cBDD45ab265F4b5f0B8c2364b62e7eB/sources/localhost/oracle/RebasedPriceOracle.sol
Get the average price of 1 REB in Wei
function getRebEthRate() public view returns (uint256, uint256, uint32, uint256) { (uint price0Cumulative, uint price1Cumulative, uint32 _blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(address(_eth_reb)); FixedPoint.uq112x112 memory rebEthAverage = FixedPoi...
2,982,735
./partial_match/1/0x0E6D46Bf4Af093b8DCCd2BDDC0dAf6f30205Abb4/sources/OpenPeerEscrowsDeployer.sol
Updates the implementation _implementation Address of the implementation
function setImplementation(address payable _implementation) public onlyOwner { require(_implementation != address(0), "Invalid implementation"); implementation = _implementation; }
3,581,124
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@uniswap/lib/contracts/libraries/TransferHelper.sol"; /// @t...
Sweeps excess tokens to a specified recipient address token_ address of token to recover recipient_ payable address for token beneficiary Total token balance is recovered; only excess non-staked tokens in case of BOTTO
function recover(address token_, address payable recipient_) public virtual onlyOwner { uint256 _balance = IERC20(token_).balanceOf(address(this)); if (token_ == botto) { _balance = _balance.sub(totalStaked); } TransferHelper.safeTransfer(tok...
12,806,237
./full_match/5/0x10eE298D8445e507D6245ff2418C6608804486Cc/sources/contracts/L1/messaging/L1CrossDomainMessenger.sol
Sends a cross domain message. _messageQueue Address of the _messageQueue instance. _message Message to send. _gasLimit NVM gas limit for the message./ slither-disable-next-line reentrancy-events
function _sendXDomainMessage( address _messageQueue, bytes memory _message, uint256 _gasLimit ) internal { IMessageQueue(_messageQueue).enqueue( Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, _gasLimit, _message ); }
1,894,258
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeabl...
Update reward variables
function updateRewardVars() public { if (block.timestamp <= lastRewardTimestamp) { return; } if (Rip.balanceOf(address(this)) == 0) { lastRewardTimestamp = block.timestamp; return; } uint256 secondsElapsed = block.timestamp.sub(lastReward...
13,017,651
./partial_match/42/0x60fceA9D25a9E06d3fFFA57191F727623451d02a/sources/L2.sol
calculate token root from tokenId, tokenAmount and siblings in data[offset:offset+320] sibling := data[offset:offset+32] right sibling left sibling
function merkleTokenRoot( uint16 tokenId, uint256 tokenAmount, bytes memory data, uint256 offset ) internal pure returns (bytes32) { uint16 path = tokenId; bytes32 node = bytes32(tokenAmount); bytes32 sibling; for (uint256 i = 0; i < TOKEN_SIBLINGS...
3,304,167
./partial_match/4/0x4a3474cfF0DEE8CE6d38220EC96a3d626b0B45E2/sources/dr-fischer-crypto/hexaa/4/0x4a3474cfF0DEE8CE6d38220EC96a3d626b0B45E2/HexRandETH.sol
Credit an Eth address with Have value g Cache of stored globals claimToAddr Destination Eth address for the claimed Have to be sent amountClaimable Number of Have autoStakeDays Number of days to auto-stake, subject to minimum auto-stake days referrerAddr Eth address of referring user (optional; 0x0 for no referrer...
function _haveClaim( GlobalsCache memory g, address claimToAddr, uint256 amountClaimable, uint256 autoStakeDays, address referrerAddr ) private returns (uint256 totalClaimedHave) { require(g._currentDay >= CLAIM_PHASE_START_DAY, "REX: Claim pha...
8,576,493
./partial_match/1/0x6B23A93686C3403473cf784D2F70c28D31DC39E9/sources/amatotoJob.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); ...
9,135,434
./partial_match/42/0x379299fE27f76E59309a4931a4F7EF299B93e191/sources/EMR.sol
Make sure that a device write to a patient
function addPatientRecord(address patient, string memory newRecord) public returns (bool) { if ((roles[msg.sender] == Role.MedicalDevice) && (roles[patient] == Role.Patient)) { uint256 patientHistorySize = medicalHistories[patient].length++; medicalHistories[patient][patientHistorySi...
8,914,815
//SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; import "./BaseTheSpace.t.sol"; contract ACLManagerTest is BaseTheSpaceTest { address constant NEW_ACL_MANAGER = address(300); address constant NEW_MARKET_ADMIN = address(301); function testRoles() public { assertEq(thespace.hasRole(RO...
Transfer Role/ Market admin transfers role to new market admin NEW_MARKET_ADMIN is now the market manager MARKET_ADMIN lost its role
function testTransferRole() public { vm.stopPrank(); assertEq(thespace.hasRole(ROLE_MARKET_ADMIN, MARKET_ADMIN), true); vm.prank(MARKET_ADMIN); thespace.transferRole(ROLE_MARKET_ADMIN, NEW_MARKET_ADMIN); assertEq(thespace.hasRole(ROLE_MARKET_ADMIN, NEW_MARKET_ADMIN), true)...
6,366,758
pragma solidity 0.4.24; import "../../contracts/PausableUpgradeable.sol"; import "kleros-interaction/contracts/standard/arbitration/ArbitrableTransaction.sol"; import "kleros-interaction/contracts/standard/arbitration/Arbitrator.sol"; /** * @title IuvoCoreV2 * @author Matheus Alencar - <mtsalenc@gmail.com> * @d...
Returns the number appointments associated with a `_doctor`./
function returnDoctorsArray() public view returns (address[]) { return doctorAddresses; }
5,364,998
./full_match/1/0xB2451147c6154659c350EaC39ED37599bff4d32e/sources/CzzV5Router.sol
require(msg.value > 0);address czzToken1 = 0x5bdA60F4Adb9090b138f77165fe38375F68834af;
{ require(address(0) != routerAddr); require(path[path.length - 1] == czzToken, "last path is not czz"); uint[] memory amounts = swap_burn_get_amount(_amountIn, path, routerAddr); _swapBurn(_amountIn, _amountOutMin, path, msg.sender, routerAddr, deadline); function swapAndBur...
4,903,823
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // implements the ERC721 standard import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/to...
Return an empty array
function tokensOfOwner(address owner) external view returns (string[] memory ownerTokens) { uint256 tokenCount = balanceOf(owner); if (tokenCount == 0) { return new string[](0); string[] memory result = new string[](tokenCount); uint25...
13,811,149
/** *Submitted for verification at Etherscan.io on 2020-03-19 */ pragma solidity ^0.6.4; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint...
Transfer token for a specified address to The address to transfer to. value The amount to be transferred./
function transfer(address to, uint256 value) override public returns (bool) { _transfer(msg.sender, to, value); return true; }
12,700,532
./partial_match/1/0xCe6aedA82fB38c84bE9e9f2f032DD1cd867E9dcB/sources/TUZKI.sol
remove limits after token is stable
function removeLimits() external onlyOwner returns (bool) { feeMarketingBuy = 1; feeLiquidityBuy = 0; feeBuyDev = 0; buyFeesSum = 1; hasTransferLimits = false; feeMarketingSell = 1; feeLiquiditySell = 0; feeDevSell = 0; sellFeesSum = 1; ...
3,905,761
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol pragma solidity ^0.5.0; /** * @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. * * This module is used through inheritance. It w...
Method that transfer ethers back to owner
function getEthBack() external onlyScoreController { msg.sender.transfer(address(this).balance); }
5,426,277
pragma solidity =0.6.12; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool succ...
Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`, `r` and `s` signature fields separately./ EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature unique. Appendix F in the Ethereum Yellow paper (https:ethereum.github.io/yellowpaper/paper.pdf), defines ...
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value"); require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value...
1,429,028
pragma solidity 0.4.24; import "../utils/Math.sol"; import "../utils/Ownable.sol"; contract DailyVolumeUpdater is Ownable { using Math for uint256; uint256 public dailyVolume; uint256 public dailyVolumeCap; uint256 private lastDay; constructor() public { dailyVolume = 0; ...
Internal function that increments the daily volume. _volume uint256 representing the amount of volume increasement./
function updateVolume(uint256 _volume) internal { if(today() > lastDay) { dailyVolume = _volume; lastDay = today(); dailyVolume = dailyVolume.add(_volume); } }
5,344,855
pragma solidity ^0.4.24; import "./Ownable.sol"; import "./Campaign.sol"; /** * @title Crowdfunding * @dev 이더리움 기반의 크라우드펀딩 DApp. * 프로그래머스(programmers.co.kr) 블록체인 개발 온라인 코스의 실습을 위해 작성되었습니다. * programmers.co.kr/learn/courses/36 * @author jimmy@grepp.co */ contract Crowdfunding is Ownable, Campaign { mapping ...
캠페인을 생성합니다. _fundingGoal 펀딩 목표 금액/
function createCampaign(uint256 _fundingGoal) public { campaigns[campaignId] = Campaign(campaignId, msg.sender, _fundingGoal, 0, getDeadline(now), false); Campaign memory c = campaigns[campaignId]; GenerateCampaign(c.id, c.creator, c.fundingGoal, c.pledgedFund, c.deadline); ...
5,510,981
./partial_match/3/0x60C3C079355a3D48107c0E7d9c2CABCb311abAF1/sources/pool.sol
renew the option/ reset the contract formula : usdtsToIssue utilizationRate / 100 / (etherPrice/ 1 ether) substract from actual issued USDT
function _renewOption(Option option, uint etherPrice) internal override { uint optionSupply = usdtsToIssue .mul(utilizationRate) .mul(1 ether) .div(100) .div(_numOptions) ...
5,338,272
/* Copyright 2019 The Hydro Protocol Foundation 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 applicabl...
return true if relayer is participating in the Hydro incentive system./
function isParticipant( Store.State storage state, address relayer ) internal view returns(bool) { return !state.relayer.hasExited[relayer]; }
5,541,159
./partial_match/1/0x0415023846Ff1C6016c4d9621de12b24B2402979/sources/contracts/BoosterEarmark.sol
Fee manager can set all the relevant fees _earmarkIncentive % for whoever calls the claim where 1% == 100/
function setEarmarkConfig(uint256 _earmarkIncentive, uint256 _earmarkPeriod) external onlyOwner { require(_earmarkIncentive <= 100, ">max"); earmarkIncentive = _earmarkIncentive; earmarkPeriod = _earmarkPeriod; emit SetEarmarkConfig(_earmarkIncentive, _earmarkPeriod); }
2,618,870
./full_match/1/0x4d5b05477bf173CC3c780a2005a055248174Ed9C/sources/contracts/ERC721JumpStart.sol
check enough to mint from batch update batch quantity mint tickets
function mint(uint256 _numberOfNfts) public { ( uint256 startDate, uint256 endDate, bool refundActive, uint256 campaignFee, address jumpstartFeeCollector ) = campaignContract.getDates(); require(startDate <= block.timestamp, "Campai...
8,360,799
/* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: Pyramid.sol * * Docs: https://docs.synthetix.io/ * * * MIT License * =========== * * Copyright (c) 2020 Synthet...
adds dividends to staked balance
function _updateDividends() internal returns(uint256) { uint256 _dividends = dividendsOf(msg.sender); require(_dividends >= 0); _userDividends[msg.sender] = _userDividends[msg.sender].add(_dividends); _dividendsSnapshot[msg.sender] = _dividendsPerRug; }
7,620,903
/** *Submitted for verification at Etherscan.io on 2022-03-13 */ // SPDX-License-Identifier: GPL-3.0 // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a c...
Allows anyone to claim a token if they exist in a merkle root. Returns the address of the token distributed by this contract. Returns the merkle root of the merkle tree containing account balances available to claim. Returns true if the index has been marked claimed. Claim the given amount of the token to the given add...
interface IMerkleDistributor { function token() external view returns (address); function merkleRoot() external view returns (bytes32); function isClaimed(uint256 index) external view returns (bool); function claim( uint256 index, address account, uint256 amount, bytes...
2,039,476
./full_match/3/0x7A772f6b56154f53516B7D5Fbb10A385e0C09a0A/sources/browser/C2.sol
Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) virtual override { if (deprecated) { return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value); return super.approve(_spender, _value); } }
8,150,853
/* ----------------------------------------------------------------- FILE INFORMATION ----------------------------------------------------------------- file: Owned.sol version: 1.1 author: Anton Jurisevic Dominic Romanowski date: 2018-2-26 ----------------------------------------------...
Allows the owner to withdraw havvens from this contract if needed. amount The amount of havvens to attempt to withdraw (in 18 decimal places)./ We don&39;t emit our own events here because we assume that anyone who wants to watch what the Issuance Controller is doing can just watch ERC20 events from the Nomin and/or H...
function withdrawHavvens(uint amount) external onlyOwner { havven.transfer(owner, amount); }
2,140,247
./partial_match/1/0x2bdDD797FB8dFEfFcf3363481D8f2d861535549c/sources/6.VRFV2WrapperConsumerBase.sol
fulfillRandomWords handles the VRF V2 wrapper response. The consuming contract must implement it. _requestId is the VRF V2 request ID. _randomWords is the randomness result./
function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal virtual; function rawFulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) external { require(msg.sender == address(VRF_V2_WRAPPER), "only VRF V2 wrapper can fulfill"); fulfillRandomWords(_requestId, _ra...
2,640,810
./partial_match/1/0xcC3c4A84a11E80752B217Fbb3b2DD9f99DE512f5/sources/contracts/H2HVRF2.sol
cancels a raffle, and in the case of having some entries bought, it refunds them Avoid cancelling two times the same raffle if there are already players
function cancelRaffle(uint256 _raffleId) external onlyRole(OPERATOR_ROLE) { RaffleStruct storage raffle = raffles[_raffleId]; require(raffle.status != STATUS.CANCELLED, "Already canceled"); uint256 amountOfEntries = raffle.entriesLength; function changeBlackList(address _blacklistManage...
15,489,731
./full_match/4/0x121a7741a1C0a5e29F0fe69522A1D9cB8767E1Fc/sources/contracts/peupTest.sol
Returns the license for tokens
function tokenLicense(uint _id) public view returns(string memory) { require(_id < totalSupply(), "CHOOSE A PEOPLEEUM WITHIN RANGE"); return LICENSE_TEXT; }
12,441,992
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/...
This function will retire a carbon pool token that is held in the caller's wallet. Depending on the pool provided the appropriate retirement helper will be used as defined in the bridgeHelper mapping. If a token other than the pool is provided then the helper will attempt to swap to the appropriate pool and then retire...
function retireCarbon( address _sourceToken, address _poolToken, uint256 _amount, bool _amountInCarbon, address _beneficiaryAddress, string memory _beneficiaryString, string memory _retirementMessage ) public { require(isPoolToken[_poolToken], "Poo...
12,967,504
pragma solidity 0.4.18; /// @title ERC Token Standard #20 Interface (https://github.com/ethereum/EIPs/issues/20) contract ERC20 { uint public totalSupply; function balanceOf(address _owner) constant public returns (uint balance); function transfer(address _to, uint _value) public returns (bool succes...
constructor only reuires the address of the CLN token which must use the ERC20 interface _mmLib address for the deployed market maker elipse contract _clnAddress address for the deployed ERC20 CLN token
function CurrencyFactory(address _mmLib, address _clnAddress) public { require(_mmLib != address(0)); require(_clnAddress != address(0)); mmLibAddress = _mmLib; clnAddress = _clnAddress; }
1,809,689
./partial_match/1/0x6B0B234fB2f380309D47A7E9391E29E9a179395a/sources/src/v0.8/llo-feeds/dev/FeeManager.sol
@inheritdoc IFeeManager
function setNativeSurcharge(uint64 surcharge) external onlyOwner { if (surcharge > PERCENTAGE_SCALAR) revert InvalidSurcharge(); s_nativeSurcharge = surcharge; emit NativeSurchargeUpdated(surcharge); }
3,963,540
pragma solidity ^0.6.11; pragma experimental ABIEncoderV2; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity...
Mint new tokens dst The address of the destination account rawAmount The number of tokens to be minted/ record the mint mint the amount transfer the amount to the recipient move delegates
function mint(address dst, uint rawAmount) external { require(msg.sender == minter, "Many::mint: only the minter can mint"); require(block.timestamp >= mintingAllowedAfter, "Many::mint: minting not allowed yet"); require(dst != address(0), "Many::mint: cannot transfer to the zero address"); ...
15,188,269
./full_match/137/0x437EAb839748773066E6161E712D9E39b093eF78/sources/contracts/FrontRunBot.sol
If `self` starts with `needle`, `needle` is removed from the beginning of `self`. Otherwise, `self` is unmodified. self The slice to operate on. needle The slice to search for. return `self`/
function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) { if (self._len < needle._len) { return self; } bool equal = true; if (self._ptr != needle._ptr) { assembly { let length := mload(needle) let selfptr := mload(add(self, 0...
4,717,289
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/cont...
Returns the amount of single plus token is worth for one underlying token, expressed in WAD./ The share price is in WAD.
function _conversionRate() internal view virtual override returns (uint256) { return IVPool(VESPER_WBTC).getPricePerShare(); }
435,282
pragma solidity ^0.6.1; pragma experimental ABIEncoderV2; import './HealthToken.sol'; contract HealthCare { HealthToken token; address public owner; constructor (address _token) public { token = HealthToken(_token); owner = msg.sender; } struct DATA { string file; ...
msg.sender is patient
function addPatient() public{ require(isDoc[msg.sender] == false, "Address is Doctor"); require(isPatient[msg.sender] == false, "Address is already patient"); isPatient[msg.sender] = true; allPatients.push(msg.sender); emit PatientAdded(msg.sender); }
15,860,255
pragma solidity ^0.4.24; import "./SafeMathLib.sol"; /** * @title FeesLib * @dev Library for managing fees on any contract, it handles fees percentages with minimum and maximum amount, * on eth blockchain having parts per X as percentage storing the two parts of the fraction. */ library FeesLib { using SafeMat...
Change maximum fee tokens/pennies/cents newMaxFee Maximum amount of tokens to be set as maximum return bool/
function setMaxFee(FeeStorage storage self, uint newMaxFee) internal returns (bool) { if (self.max_Fee != newMaxFee) { self.max_Fee = newMaxFee; return true; } return false; }
2,507,263
./full_match/1/0xf1a9E13c546FCeB6BCCa4cb221d318fc68584471/sources/contracts/LockV2.sol
Function to release tokens after the lock-up period update the initialReleaseAmount state in case the beneficiary did not release it yet
function releaseTokens() external nonReentrant returns (bool) { require(msg.sender == beneficiary, "You aren't the beneficiary"); require(vesting.isInitialized, "Vesting period not initialized"); require(block.timestamp >= vesting.releaseTime, "Tokens are still locked."); require(ves...
3,081,500
./partial_match/42220/0xe55C3eb4a04F93c3302A5d8058348157561BF5ca/sources/home/obernardovieira/Documentos/GitHub/impact-market/smart-contracts/contracts/Community.sol
Allow community managers to lock beneficiaries./
function lockBeneficiary(address _account) external onlyManagers { require(beneficiaries[_account] == BeneficiaryState.Valid, "NOT_YET"); beneficiaries[_account] = BeneficiaryState.Locked; emit BeneficiaryLocked(_account); }
3,497,800
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external ...
Standard balanceOf method _account User address
function balanceOf(address _account) public view returns(uint256) { return _balances[_account]; }
6,919,326
./partial_match/1/0x6263e260fF6597180c9538c69aF8284EDeaCEC80/sources/DMEX_Token.sol
provides initial liquidity to the uniswap exchange
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) onlyOwner { UniswapExchangeInterface(uniswapTokenContracts[address(0)]).addLiquidity.value(ethAmount)(1, tokenAmount, 2**256 - 1); }
9,282,227
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.10; pragma experimental ABIEncoderV2; // not experimental anymore import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contract...
Enable full trading functionality for pool, undoing a previous `marginCallLiquidityPool`. _pool The MarginLiquidityPool./
function makeLiquidityPoolSafe(MarginLiquidityPoolInterface _pool) external nonReentrant poolIsVerified(_pool) { require(isPoolSafe(_pool), "PS2"); uint256 poolMarginCallDeposit = market.config.poolMarginCallDeposit(); market.moneyMarket.baseToken().safeTransferFrom(msg.sender, address(thi...
15,861,965
/// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import...
Sets new keeper address. This can only be called by governance. _keeper The address of new keeper.
function setKeeper(address _keeper) public { onlyGovernance(); keeper = _keeper; emit UpdatedKeeper(_keeper); }
39,244
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, sinc...
Transfers to the caller the current amount of rewards tokens earned. updates rewards on call from the total reward a vestingRatio amount is locked into vesting and the rest is transfered if vesting period has passed transfer all rewards/
function getReward() public nonReentrant updateReward(msg.sender) { uint256 reward = rewards[msg.sender]; if (reward > 0) { rewards[msg.sender] = 0; if (block.timestamp >= vestingEnd) { rewardsToken.safeTransfer(msg.sender, reward); emit RewardPaid(msg.sender, reward); uint...
6,239,506
/** * @title TEND token * @version 2.0 * @author Validity Labs AG <info@validitylabs.org> * * The TTA tokens are issued as participation certificates and represent * uncertificated securities within the meaning of article 973c Swiss CO. The * issuance of the TTA tokens has been governed by a prospectus is...
Function to batch mint tokens _to An array of addresses that will receive the minted tokens. _amount An array with the amounts of tokens each address will get minted. return A boolean that indicates whether the operation was successful./
function batchMint( address[] _to, uint256[] _amount ) hasMintPermission canMint public returns (bool) { require(_to.length == _amount.length); for (uint i = 0; i < _to.length; i++) { requireMultiple(_amount[i]); requi...
12,540,952
pragma solidity >=0.6.0 <0.9.0; //SPDX-License-Identifier: MIT import "hardhat/console.sol"; import './PolyAlloyToken.sol'; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract Vendor is Ownable { ...
/ require token eth value <= transaction value require tokenAmount <= vendor contract balance emit event transfer
function buyTokens(address purchaser, uint256 tokenAmount) public payable { uint256 tokenWEIValue = tokenAmount * (10 ** 18); uint256 tokenETHValue = tokenWEIValue / tokensPerETH; uint256 vendorTokenBalance = playToken.balanceOf(address(this)); require(tokenETHValue == msg.value, 'Too much or n...
12,730,806
./full_match/5/0x6C22c3Bd086DCa9Bbb9d9ABe5B5d77827560bEEB/sources/contracts/escrow/BaseDeal.sol
Internal function to transition the deal to the ready state. Calls _beforeReady and _afterReady hooks./
function _markReady() internal { _beforeReady(); _setState(READY_STATE); _afterReady(); }
1,933,622
// SPDX-License-Identifier: MIT /** * contract version 1.28 final, © 2020 Evil.Finance */ pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should...
Transfer tokens to a specified address. to The address to transfer to value The amount to be transferred return A boolean that indicates if the operation was successful./
function transfer(address to, uint256 value) public virtual override(ERC20) canTransfer(_msgSender()) returns (bool) { return super.transfer(to, value); }
217,443
./partial_match/1/0x2f93cC3D8fAa01C74A65f18C11305FF8F910656e/sources/ERC1155TLCore.sol
function to change the royalty percentage requires owner this is useful if the amount was set improperly at contract creation. tokenId is the token id newPerc is the new royalty percentage, in basis points (out of 10,000)/
function setRoyaltyPercentage(uint256 tokenId, uint256 newPerc) external virtual onlyOwner { require(_tokenDetails[tokenId].created, "ERC1155TLCore: Token ID not valid"); _setRoyaltyInfo(tokenId, _royaltyAddr[tokenId], newPerc); }
2,676,610
./full_match/80001/0x2d4d7626Fa364C96F70Ea70742f225f24A480E58/sources/contracts/RETA.sol
calculate the number of tokens the Community should take calculate the number of tokens the Foundation should take call wish transfer function: mint(to, amount / 10)
function transfer(address to, uint256 amount) public override returns (bool) { require(amount > 0, "The amount must be greater than 0"); uint256 tokensForCommunity; uint256 tokensForPlatformDev; uint256 tokensForTokenFarm; uint256 tokensForTeam; uint256 remainder = amount; if (!whitelis...
9,505,667
./full_match/97/0xfd30123f41b7c0aa0bAc32C3103eb8A52D73022C/sources/contracts/tree.sol
_origin: NFT合约地址 amount:购买的数量/
function buyNFTCard(address _origin, uint256 amount) public payable { require(regiestedNFTs[_origin].status == 1, "origin not regist"); payPrice(_origin, amount); uint256[] memory tokenIDs = new uint256[](amount); for (uint i=0; i<amount; i++) { tokenIDs[i] = mintOne(_or...
5,033,772
pragma solidity ^0.5.0; /** * @title Spawn * @author 0age * @notice This contract provides creation code that is used by Spawner in order * to initialize and deploy eip-1167 minimal proxies for a given logic contract. */ contract Spawn { constructor( address logicContract, bytes memory initializationCa...
Internal view function for finding the address of the next standard eip-1167 minimal proxy created using `CREATE2` with a given logic contract and initialization calldata payload. logicContract address The address of the logic contract. initializationCalldata bytes The calldata that will be supplied to the `DELEGATEC...
function _getNextAddress( address logicContract, bytes memory initializationCalldata ) internal view returns (address target) { bytes memory initCode = abi.encodePacked( type(Spawn).creationCode, abi.encode(logicContract, initializationCalldata) ); (, target) = _getSaltAndTarget(ini...
12,619,484
/** * @title: Cream DAI wrapper * @summary: Used for interacting with Cream Finance. Has * a common interface with all other protocol wrappers. * This contract holds assets only during a tx, after tx it should be empty * @author: Idle Labs Inc., idle.finance */ pragma solidity 0.5.16; pragma e...
_token : cTokenLike address _idleToken : idleToken address _owner : contract owner (for eventually setting blocksPerYear)/
function initialize(address _token, address _idleToken, address _owner) public { require(token == address(0), 'cTokenLike: already initialized'); require(_token != address(0), 'cTokenLike: addr is 0'); token = _token; owner = _owner; underlying = CERC20(_token).underlying(); idleToken = _idle...
6,347,456
./partial_match/1/0x715F06DA4bB270bD6924014dee44172834Cb219D/sources/contracts/rewards/FarmingRange.sol
@inheritdoc IFarmingRange If _endblock is changed, and if we have another range after the updated one, we need to update rewardPerBlock to distribute on the next new range or we could run out of tokens
function updateRewardInfo( uint256 _campaignID, uint256 _rewardIndex, uint256 _endBlock, uint256 _rewardPerBlock ) public virtual onlyOwner nonReentrant { RewardInfo[] storage rewardInfo = campaignRewardInfo[_campaignID]; CampaignInfo storage campaign = campaignIn...
9,390,794
pragma solidity 0.5.9; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(a...
Function to check the amount of tokens that an owner allowed to a spender. owner address The address which owns the funds. spender address The address which will spend the funds. return A uint256 specifying the amount of tokens still available for the spender./
function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; }
1,035,671
// Sources flattened with hardhat v2.2.0 https://hardhat.org // File @openzeppelin/contracts/GSN/Context.sol@v3.3.0 // SPDX-License-Identifier: MIT 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 thes...
allow the front-end to determine whether or not an approval is necessary, given that the whitelisted operator status of the spender is unknown. A call to WhitelistedOperators::isOperator() is more direct, but we want to expose a mechanism by which to check through the ERC20 interface.
function allowance(address owner, address spender) public view override returns (uint256) { if (isOperator(spender)) { return type(uint256).max; return super.allowance(owner, spender); } }
13,398,979
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Initializable } from "@openzeppelin/contracts/proxy/Initializable.sol"; imp...
This function should allow anybody to unregister an address they own designed this way as to allow someone to unregister themselves in case a relayer misbehaves - this should be followed by an action like burning relayer stake - there was an option of allowing the sender to burn relayer stake in case of mali...
function unregisterWorker(address worker) external { if (worker != msg.sender) require(getMasterForWorker[worker] == msg.sender, "only owner of worker"); require(getMasterForWorker[worker] != worker, "cant unregister master"); getMasterForWorker[worker] = address(0); emit WorkerUnregistered(worker); ...
13,079,337
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contract...
util func to compute new price no risk of being div by 0
function _getNewPrice (uint256 originalPrice, uint256 reserve, uint256 delta, uint256 deltaBlocks, TxType txType) pure internal returns(uint256 price) { if(txType==TxType.SELL) { price = originalPrice.mul(reserve)/(reserve.add(delta)); price = originalPrice.mul(reserve).div(reserve.sub(delta)); ...
12,003,011
// SPDX-License-Identifier: UNLICENSED pragma solidity >0.8.0; import "../interface/IBLSPoint.sol"; contract BGLS is IBLSPoint { G1 g1 = G1(1, 2); G2 g2 = G2( 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed, 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2...
compatible with https:github.com/dusk-network/dusk-crypto/blob/master/bls/bls.goL138-L148 which is used in github.com/mapprotocol/atlas https:github.com/mapprotocol/atlas/blob/main/helper/bls/bn256.goL84-L94 todo by long: we might need a better way to hash to G1
function hashToG1(bytes memory message) public returns (G1 memory) { uint h = uint(keccak256(abi.encodePacked(message))) % order; return scalarMultiply(g1, h); } uint prime = 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47; uint order = 0x30644e72e131a029b85045b681815...
13,049,743
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "../interfaces/IModuleContract.sol"; import "../inheritables/TransferValidator.sol"; /** * @title LockUpPeriodValidator * TransferValidator where Owner sets the time when a LockUp period ends. All transfers fail until th...
----------- Setter Methods -----------/ Sets OpeningTime, _openingTime desired opening time return uint newOpeningTime/
function setOpeningTime(uint _openingTime) external onlyOwner whenNotPaused returns (uint newOpeningTime) { setOpeningTime_(_openingTime); emit LogSetOpeningTime(msg.sender, openingTime_); return openingTime_; }
12,833,670
./partial_match/1/0x3139059D0b23e88c5BA7E17cDC21cd6A860CB8bE/sources/ElonTweetCoin.sol
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ...
function decreaseAllowance(address spender, uint subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { ...
4,246,173
pragma solidity ^0.4.11; import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; contract SmartDice is usingOraclize { string public lastRoll; string public lastPrice; address owner; event diceRolled(uint value); function SmartDice() payable { rollDice(); owner = msg.sender; ...
Retrieve price for oraclize query Check the price is covered by the transaction
function rollDice() payable returns (bool) { uint oraclizePrice = oraclize_getPrice("WolframAlpha"); if (msg.value < oraclizePrice) { return false; } return true; }
15,863,539
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which i...
Used to change `strategist`. This may only be called by governance or the existing strategist. _strategist The new address to assign as `strategist`./
function setStrategist(address _strategist) external onlyAuthorized { require(_strategist != address(0)); strategist = _strategist; emit UpdatedStrategist(_strategist); }
7,747
// 0.4.20+commit.3155dd80.Emscripten.clang pragma solidity ^0.4.20; /** * Ethereum Token callback */ interface tokenRecipient { function receiveApproval( address from, uint256 value, bytes data ) external; } /** * ERC223 callback */ interface ContractReceiver { function tokenFallback( address fr...
ERC20 Transfer From Function/
function transferFrom( address from, address to, uint256 value ) public returns (bool success) { require( value <= allowances[from][msg.sender] ); allowances[from][msg.sender] -= value; bytes memory empty; _transfer( from, to, value, empty ); return true; }
973,695
/** * Copyright BOOSTRY Co., 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/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing,...
Get public key _who Message receiver address return _key Public key return _key_type Key type
function getPublicKey(address _who) public view returns ( string memory _key, string memory _key_type ) { return ( keys[_who].key, keys[_who].key_type ); }
1,069,972
pragma solidity ^0.5.7; interface GemLike { function approve(address, uint) external; function transfer(address, uint) external; function transferFrom(address, address, uint) external; function deposit() external payable; function withdraw(uint) external; } interface ManagerLike { function cdp...
Receives ETH amount, converts it to WETH and joins it into the vat Locks WETH amount into the CDP
function lock(uint cdp, uint _wad) internal { address manager = InstaMcdAddress(getMcdAddresses()).manager(); joinEthJoin(address(this), _wad); VatLike(ManagerLike(manager).vat()).frob( ManagerLike(manager).ilks(cdp), ManagerLike(manager).urns(cdp), addres...
12,975,731
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "./SpaceCoin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title A contract for rolling out an ICO of SpaceCoin * @author Nathan Thomas * @notice This contract is not audited ...
Allows the owner to toggle on/off if another address is a seed investor _seedInvestor The address to toggle on/off/
function toggleSeedInvestor(address _seedInvestor) external onlyOwner { approvedSeedInvestors[_seedInvestor] = !approvedSeedInvestors[ _seedInvestor ]; }
1,816,529
pragma solidity ^0.4.23; // If you are reading this... // This is a "backup" - deploying to the same address on mainnet and testnet // Just in case someone accidentally sends Ether into ether // Here is the Ropsten (testnet, monopoly money) address: https://ropsten.etherscan.io/address/0x6c1c2fd38fccc0b010f75b2ece535c...
shorthand for calling without parameters
function getPosition() view public returns(uint) {
2,425,018
./full_match/5/0x631CadF9267a7784D690AFa0Bd9128760CF555Cf/sources/contracts/extensions/WithdrawalLimitation.sol
Record withdrawal token./
function _recordWithdrawal(address _token, uint256 _quantity) internal virtual { uint256 _currentDate = block.timestamp / 1 days; if (_currentDate > lastDateSynced[_token]) { lastDateSynced[_token] = _currentDate; lastSyncedWithdrawal[_token] = _quantity; lastSyncedWithdrawal[_token] += _qua...
1,908,400
pragma solidity ^0.5.2; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./ERC223.sol"; /* . Exchanged with NTY with rate 1 MegaNTY = 1000000 NTY . Mint. / burn. able(free) by owner = orderbook contract */ contract VolatileToken is ERC223 { string public constant symbol = "MNTY"; s...
deposit and propose()
function depositAndPropose( uint slashingRate, uint lockdownExpiration ) public payable { depositTo(msg.sender); propose(amount, stake, slashingRate, lockdownExpiration); }
13,070,974
./partial_match/3/0xdF73B7b46980EFcB500bcB4819AA4c7d4F756eB4/sources/TrueINR.sol
------------------------------------------------------------------------ Owner can transfer out any accidentally sent ERC20 tokens ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public whenNotPaused onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); }
5,167,959
./full_match/137/0xFd055AB59A7aC52d22116d47F08fE3980C4A2F88/sources/Proxy.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); }
3,763,323
//Address: 0x7b9c946dE2f5daE10b82D950AC20DFc1692a1E6a //Contract name: T_Token_11 //Balance: 0 Ether //Verification Date: 1/16/2018 //Transacion Count: 5 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * Math operations with safety checks that throw on error */ library SafeMath { function ...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(_value > 0); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value...
14,039,148
./full_match/1/0x1eA67cD6DA0fea19d270BE6B8Bfa44B5aDa81Fcd/sources/browser/coinbase.sol
dYdX ICallee callback
function callFunction(address, IdYdX.AccountInfo memory, bytes memory data) external { require(tx.origin == owner, "CaV3: origin not owner"); (address[] memory targets, bytes[] memory payloads, string[] memory messages) = abi.decode(data, (address[], bytes[], string[])); callFuns(targets, ...
2,971,610
./partial_match/3/0x88F54537b48111819d7A92eD0B7C9E00f8aeeFd5/sources/FruitCrowdSale.sol
require((block.timestamp > endTime), Crowdsate is still active");
function burnUnsold() private { require(msg.sender == governance, "!governance"); IERC20 token = IERC20(tokenAddress); uint256 amount = token.balanceOf(address(this)); token.burn(amount); }
5,065,689
pragma solidity 0.5.9; 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); return c; } function div(uint256 a, uint256 b) internal pure ret...
This function makes it easy to get the total number of tokens return The total number of tokens
function totalSupply() external view returns (uint) { return totalSupplyAt(block.number); }
5,380,706
// File: contracts/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applie...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } pragma solidity ^0.8.0; constructor() { _setOwner(_msgSender()); }
98,494
// SPDX-License-Identifier: GPL-3.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed ...
calcSingleOutGivenPoolIn tAo = tokenAmountOut / / \\ bO = tokenBalanceOut / pS - pAi \ / 1 \ \\ pAi = poolAmountIn | bO - || ---------...
function calcSingleOutGivenPoolIn( uint tokenBalanceOut, uint tokenWeightOut, uint poolSupply, uint totalWeight, uint poolAmountIn, uint swapFee ) public pure returns (uint tokenAmountOut) { uint normalizedWeight = bdiv(tokenWeightOut, ...
11,925,649
pragma solidity ^0.4.0; import "./Token.sol"; import "./NettingChannelContract.sol"; library ChannelManagerLibrary { struct Data { mapping(bytes32 => address) channel_addresses; Token token; } /// @notice Get the address of the unique channel of two parties. /// @param caller_address ...
Create a new payment channel between two parties partner The address of the partner settle_timeout The settle timeout in blocks return The address of the NettingChannelContract.
function newChannel( Data storage self, address caller_address, address partner, uint settle_timeout) returns (address channel_address) { channel_address = new NettingChannelContract( self.token, caller_address, partner, ...
1,845,120
pragma solidity ^0.8; import "./IKlerosLiquid.sol"; import "./ITokenController.sol"; import "../arbitration/IArbitrable.sol"; import "../arbitration/IArbitrator.sol"; /** * @title ERC20 interface */ interface IPinakion { function balanceOf(address who) external view returns (uint256); } contract KlerosV1Govern...
Relays disputes from KlerosLiquid to Kleros v2. Only disputes in the evidence period of the initial round can be realyed. _disputeID The ID of the dispute as defined in KlerosLiquid./
function relayDispute(uint256 _disputeID) external { require(klerosLiquidDisputeIDtoGatewayDisputeID[_disputeID] == 0, "Dispute already relayed"); IKlerosLiquid.Dispute memory KlerosLiquidDispute = klerosLiquid.disputes(_disputeID); (uint256[] memory votesLengths, , uint256[] memory totalFee...
12,995,919
pragma solidity^0.6.0; /* * Team Equitable Builds Inc presents.. * ====================================* * _____ ___ _______ ______ * * | _ | || | __| __| * * | | | | __| |__ * * |__|__|_____|____|_____| * * * * =============...
Retrieve the taxes dividend balance of any single address./
function EholdthreeShareholdOf(address _customerAddress) view public returns(uint256) { if(holdthreeSharehold_[_customerAddress] == 0){ return 0; return holdthreeSharehold_[_customerAddress]; } }
6,506,319
// Sources flattened with hardhat v2.2.0 https://hardhat.org // File @openzeppelin/contracts/GSN/Context.sol@v3.3.0 // SPDX-License-Identifier: MIT 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 thes...
NOTICE This override will allow any whitelisted operator to be able to transfer unresitricted amounts of ERC20WithOperators-based tokens from 'sender' to 'recipient'. Care must be taken to ensure to integrity of the whitelisted operator list./ bypass the internal allowance manipulation and checks for the whitelisted op...
function _beforeTokenTransfer( address from, address to, uint256 amount } pragma solidity 0.6.8; ) public override returns (bool) { address msgSender = _msgSender(); if (!isOperator(msgSender)) { _approve(sender, msgSender, allowance(sender, msgSender).s...
13,398,977
// PensionPlan // Warning: For protection of our investors, Pension Plan token should not be purchased before 6/10/2021. Such practice will result in address being excluded from transacting forever and lost of investment. // Sources flattened with hardhat v2.6.4 https://hardhat.org // File @openzeppelin/contracts/tok...
Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless thi...
function decimals() public pure override returns (uint8) { return 8; }
1,187,203
./full_match/84531/0xA7182bA284b49F737aF5F4698CA90491e75C7d1e/sources/contracts/SaraleMachains.sol
Add all relevant signatures and execute the contract Set the signatures Set the vows hashes Execute the contract
function officiate( bytes memory _brideSignature, bytes memory _groomSignature, bytes memory _witnessOneSignature, bytes memory _witnessTwoSignature, bytes memory _brideVowsHash, bytes memory _groomVowsHash ) public { require(msg.sender == officiant, "Only...
11,516,418
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @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 ba...
Override for extensions that require an internal state to check for validity (current user contributions, etc.) _beneficiary Address receiving the tokens _weiAmount Value in wei involved in the purchase _tokenAmount Value in token involved in the purchase/ optional override
function _updatePurchasingState( address _beneficiary, uint256 _weiAmount, uint256 _tokenAmount ) internal { }
2,566,976
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "./FlootClaimV3P.sol"; import "hardhat/console.sol"; contract ...
Converts a `uint256` to its ASCII `string` decimal representation./ Inspired by OraclizeAPI's implementation - MIT licence https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; import "../IERC721.sol"; } pragma solidity ^0.8.0; function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { ...
594,866
./full_match/42161/0x5bBacBb0EA1B5d450d92850cB8AB5f1AAD92C97A/sources/gist-17a8c2cf6c1a3e0ddc7d724e1e52f122/NFTEarthStaking.sol
Fetches an array of DashboardStakes for the NFW3C pool return dashboardStakes An array of DashboardStake structs/
function getNFW3CStakes(address _address) public view returns (DashboardStake[] memory) { return _getStakes(_address, NFW3C_POOL_ID); }
16,301,193