file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.18; /** * @title SafeMath for performing valid mathematics. */ 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 (uint2...
Calculate tokens to send Current token price in cents Calculate value in dollars100 _value in dollars 100 Example: for $54.38 valueInDollars = 5438 Calculate bonus by purshase
function calcTokensToSend(uint256 _value) internal view returns (uint256){ require (_value > 0); uint256 currentTokenPrice = getCurrentTokenPriceInCents(); uint256 valueInDollars = _value.Mul(dollarsForEther).Div(10**16); uint256 tokensToSend = valueInDollars.Div(cu...
6,395,809
./partial_match/1/0x267EB1C74F3D3A8351e9915695a9bd6b5Ac2CAA6/sources/GrimReaper.sol
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { require(poolIsAdded[address(_lpToken)] == false, 'add: pool already added'); poolIsAdded[address(_lpToken)] = true; if (_withUpdate) { massUpdatePools(); } uint256 lastRewardB...
2,808,414
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state muta...
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
1,092,140
pragma solidity ^0.5.0; import {SafeMath} from "./SafeMath.sol"; contract RockPaperScissors { using SafeMath for uint256; /* * State Variables */ enum Stages {lobby, active, revealing, finals} struct Game { address _player1; address _player2; uint256 _deadline; ...
gameObj._stage is finals -> game must be finished via finishGame() Internal Functions/
revert("game should be finished via appropriate function"); } } function _p1Wins(uint256 gameId) internal { Game storage gameObj = activeGames[gameId]; balances[gameObj._player1] = balances[gameObj._player1].add(gameObj._wager * 2); emit LogGameFinished(gameId, gam...
12,578,228
./partial_match/1/0xB60fbba496BED5DFC3Be19B90A892351B07ABB2B/sources/USDTTokenDistributor.sol
Creates an instance of `USDTTokenDistributor` where each account in `payees` is assigned the number of shares at the matching position in the `shares` array. All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no duplicates in `payees`./ solhint-disable-next-lin...
function inputPayeeData( address[] memory payees, uint256[] memory amount ) public onlyOwner{ require( payees.length == amount.length, "USDTTokenDistributor: payees and amount length mismatch" ); require(payees.length > 0, "USDTTokenDistributor: n...
9,253,975
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "./ERC721.sol"; import "./ERC721Enumerable.sol"; import "./Address.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./cn-utils.sol"; interface CryptoMonkeyKing { function balanceOf(address _owner) external view returns...
helps/
function _isCmkAddress(address _addr) internal view returns (bool) { return cmkContract.balanceOf(_addr) > 0; }
13,448,676
./full_match/5/0xf6159f7B5f6a7988ef83b7199427cB56df21BEAc/sources/contracts/BeanzBurner.sol
User can burn from 1 to <maxBurnTokens> tokens The number of tokens will increase the chance of getting the reward
function burn(uint256[] calldata _tokenIds) external nonReentrant { require(!burnPaused, "Burn is paused"); uint256 len = _tokenIds.length; for (uint256 i; i < len; ++i) { nftCollection.safeTransferFrom(msg.sender, nullAddr, _tokenIds[i]); } rewardsToken.safeTra...
1,941,298
/** *Submitted for verification at Etherscan.io on 2021-09-12 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; pragma experimental ABIEncoderV2; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of...
The owner can set tokenURI if it's error /
function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner { super._setTokenURI(_tokenId, _tokenURI); }
154,506
/* * Holdenomics * put details here */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * *...
Starts trading. Only callable by owner. Set maturation time .5%
function openTrading() external onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), addres...
1,002,839
pragma solidity ^0.4.23; // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint25...
Returns the current BCH => 0.01$ rate/
function getBCHToUSDCentRate(string oraclizeResult) internal pure returns (uint256) { return parseInt(parseCurrencyRate(oraclizeResult, "BCH"), 2); }
14,096,976
pragma solidity 0.4.24; import "./SafeMath.sol"; import "./Ownable.sol"; import "./PLGToken.sol"; import "./Whitelist.sol"; /// @title Pledgecamp Crowdsale /// @author Sam Pullman /// @notice Capped crowdsale with bonuses for the Pledgecamp platform contract PLGCrowdsale is Ownable { using SafeMath for uint256; ...
Withdraw crowdsale ETH to owner wallet
function withdrawEth() public onlyOwner { owner.transfer(address(this).balance); }
6,427,159
// File: hardhat/console.sol pragma solidity >= 0.4.22 <0.9.0; library console { address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); function _sendLogPayload(bytes memory payload) private view { uint256 payloadLength = payload.length; address consoleAddress = CONSOLE_ADDRES...
purchase _tokenId _fullTokenURI string memory tokenURI _emptyTokenURI string memory empty tokenURI _name string memory token name _description string memory for description _category serum category _price uint256 token price _transformationFee fees of applying serum _classify int for serum type Requirements: '_...
function mintCollectable( address _owner, string memory _fullTokenURI, string memory _emptyTokenURI, string memory _name, string memory _description, string memory _category, uint256 _price, uint256 _transformationFee, uint256 _classif...
1,592,978
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol"; import "@openz...
Sets the developer wallet. developerWallet The new developer wallet./
function setDeveloperWallet( address developerWallet ) public onlyOwner { require(developerWallet != address(0), "bad developer address"); require(developerWallet != _config.developerWallet, "same address"); emit DeveloperWalletChanged(_config.developerWallet, developerWallet); ...
5,399,682
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/helpers/PointerLibraries.sol
Reads the uint224 at `rdPtr` in returndata.
function readUint224( ReturndataPointer rdPtr ) internal pure returns (uint224 value) { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) } }
4,300,463
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a p...
Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. It's a good idea to use the same `name` that is defined as the ERC20 token name./
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount uint256[45] private __gap; } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; import "../IERC20Upgradeable.s...
14,525,866
pragma solidity ^0.4.11; /******************************************************************************* * ERC Token Standard #20 Interface * https://github.com/ethereum/EIPs/issues/20 *******************************************************************************/ contract ERC20Interface { // Get the tot...
Function to determine if a ballot has ended, based on its end date /
function hasBallotEnded(uint32 _ballotId) private constant returns (bool) { return (ballotDetails[_ballotId].end < now); }
5,511,756
./full_match/5/0x10af821ccb715988358d3385735e041a38e2B0A1/sources/contracts/chugsplash/L1ChugSplashProxy.sol
Queries the owner of the proxy contract. Can only be called by the owner OR by making an eth_call and setting the "from" address to address(0). return Owner address./ slither-disable-next-line external-function
function getOwner() public view returns (address) { return _getOwner(); }
1,868,491
./partial_match/4/0x5Ca1802c96E675CE93Bc637aE5BCb347105CE018/sources/Gauge.sol
Deposit `_value` LP tokens _value Number of tokens to deposit addr Address to deposit for
function deposit(uint256 _value, address addr) external nonReentrant { if (addr != msg.sender) { require(approved_to_deposit[msg.sender][addr], "Not approved"); } _checkpoint(addr); if (_value != 0) { uint256 _balance = balanceOf[addr] + _value; ...
8,677,485
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/token/ERC721/IERC72...
Wraps ERC721 token from a different contract./ Update amount for existing wrapped token Create new wrapped token
function wrapERC721( address extNftContract, uint256 extTokenId, string calldata mimeType_ ) external override returns (uint256) { require( IERC165(extNftContract).supportsInterface(type(IERC721).interfaceId), "ERC1155: Contract is not ERC721" ); ...
1,773,880
./full_match/421613/0x771d78ee0a80314337d891a8aC5CfCD6C9575885/sources/project_/contracts/Box.sol
Reads the last stored value
function retrieve() public view returns (uint256) { return value; }
11,567,866
/** *Submitted for verification at Etherscan.io on 2021-06-15 */ // File: @openzeppelin/upgrades/contracts/Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `...
Allows platform to change the royalty percentage for a specific token set the percentages for this token emit an event to notify that the platform percent for this token has changed
function updatePlatformSalePercentage( uint256 tokenId, uint256 platformFirstSalePercentage, uint256 platformSecondSalePercentage ) external onlyPlatform { platformFirstSalePercentages[tokenId] = platformFirstSalePercentage; platformSecondSalePercentages[tokenId] = platfo...
2,041,760
./partial_match/1/0x1234567a022acaa848E7D6bC351d075dBfa76Dd4/sources/VokenTB.sol
Returns the number of decimals used to get its user representation./
function decimals() public pure override returns (uint8) { return _decimals; }
4,189,165
// SPDX-License-Identifier: UNLICENSED // EthAnchorFactory.sol: Factory contract for all account contracts pragma solidity >=0.6.0 <0.8.0; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@op...
custody mode contract holds returned aUST call will fail if aUST was not returned from Shuttle/Anchorbot/Terra contracts set ActionFlag to false emit finishdeposit event
function finishDepositStableCustody() public onlyAuthSender checkFinish terraAddressSet { require(anchorust.balanceOf(address(this)) > 0, "AnchorAccount: custody mode: finish deposit operation: not enough aust"); ActionFlag = false; emit FinishDeposit(walletAddress); }
5,948,071
// SPDX-License-Identifier: MIT /// @author Doge0420 and inspired by HashlipsLowerGasFee contract - MIT licence // Do not use this contract even i don't know if it's safe lol pragma solidity >=0.8.0 < 0.9.0; // cool stuff import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC...
ONLY OWNER remove addresse from the blacklist
function blacklistRemoveAddress(address _address) public onlyOwner { require(blacklist[_address], "This address is already out of the blacklist."); blacklist[_address] = false; }
5,470,086
pragma solidity ^0.4.23; import "./CowBreeding.sol"; import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; import "openzeppelin-solidity/contracts/token/ERC721/ERC721Metadata.sol"; /** * @title ERC721 compatible Cow Standard Basic Implementation * @dev Implements Cow transfer with inherited OpenZeppelin...
Tells whether an operator is approved by a given owner _owner owner address which you want to query the approval of _operator operator address which you want to query the approval of return bool whether the given operator is approved by the given owner/
function isApprovedForAll(address _owner, address _operator) public view returns (bool) { return _operatorApprovals[_owner][_operator]; }
6,457,937
./full_match/137/0x1d87438CD3c7d0B9d18F899aa831D1DDaBd3AB83/sources/src/MintpadERC1155Evolve.sol
Set the number to receive after burning `numberToBurn` NFTs
function setNumberToReceive(uint256 _amount) external onlyRole(DEFAULT_ADMIN_ROLE) { numberToReceive = _amount; }
3,746,741
./full_match/97/0x82788107C92FD98840e7C0079Ba9ef9E1F00EF48/sources/project_/contracts/factory.sol
Creates a beacon proxy, sets user's details and deposits ether into the beacon proxy. External function with access restriction. Emits a {NewProxyAddress} event./
function createEscrowProxy( string memory _dealId, address token, uint256 amount ) external dealIdInexistent(_dealId) notOwnerOrCommissionWallet isContract(token) checkAllowance(token, amount) { BeaconProxy proxy = new BeaconProxy( ...
5,043,957
//etherate v.2.0 //EtheRate – is the first in the world, an honest pool of crypto-rates, based on absolute randomness! //Official WEB-client: etherate.org //Talk to us on Discord.gg/nEnApvF /* ╔═══╗╔════╗╔╗─╔╗╔═══╗╔═══╗╔═══╗╔════╗╔═══╗ ║╔══╝║╔╗╔╗║║║─║║║╔══╝║╔═╗║║╔═╗║║╔╗╔╗║║╔══╝ ║╚══╗╚╝║║╚╝║╚═╝║║╚══╗║╚═╝║║║─║║╚╝║║╚╝║╚══...
MODIFIERSFUNCTIONSCHANGE FUNCTIONS
function changePermissions(address _agent, uint8 _value) public onlyADM() { require(msg.sender != _agent); require(_value <= 1); agents[_agent] = _value; LOG_ChangePermissions(msg.sender, _agent, _value); }
2,302,428
./full_match/5/0xDf3Be2F09DE440498ca5332b0eD3c5E83FD82b5A/sources/raffle.sol
Requests random values from Chainlink VRF No return, reverts on error/
function requestRandomWords() internal { uint256 requestId = i_vrfCoordinator.requestRandomWords( i_keyHash, i_subscriptionId, i_requestConfirmations, i_callbackGasLimit, s_numWords ); emit RaffleStarted(requestId); }
1,955,641
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
UserInfo storage user = userInfo[_msgSender()]; user.rewards = earned(_msgSender()); user.lastUpdated = block.timestamp; user.rewards = 0;
function harvest() public nonReentrant { require(_enableHarvest == true, "Harvest is not activated"); require(userStakedNFTCount(_msgSender()) > 0, "Nothing Staked NFTs"); require(isHarvested(_msgSender()) == false, "You already harvested"); uint256 harvestAmount = address(this).ba...
11,897,496
./full_match/42/0xCE47Aea567253fb38eB9E6962DA671AffF15eCDC/sources/Users/sergeisergeenko/defi5/poolRegistry/contracts/PoolRegistry.sol
Create new investment pool. token The address token contract for investment pool. locked The blocking period of assets. rate The address to query the wager of. interestFee The asset withdrawal commission. anualPrecent The annual percentage of tokens. superAdmin The An address that has privileges SUPER_ADMIN_ROLE....
function createPool( address token, uint256 locked, uint256 rate, uint256 interestFee, uint256 anualPrecent, address superAdmin, address gPartner, address lPartner, address team, address sturtapTeam, address referer ) public...
16,237,005
pragma solidity 0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed prev...
Processes a reimbursement claim for a given address. Emits a ReimbursementClaimed event for each successful iteration. _user The address being processed. The first time a user tries to claim tokens or a Reimbursement, they will have the admin fee subtracted from their contribution. This is the pro-rata portion added ...
function processReimbursementInternal(address _user) internal { if (!adminFeePaid[_user] && adminFeePayoutIsToken && adminFeePercentage > 0) { collectAdminFee(_user); } uint256 totalReimbursement = reimbursementTotal.mul(amountContributed).div(weiRaised); uint256 already...
7,281,140
./full_match/5/0x08fA73274Dc7EF3Eb0CDBb5D6D07C8454cD48b5A/sources/_superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol
requireValidCtx(ctx) onlyAgreement(agreementClass) requireValidCtx(ctx) isAppActive(app) Batch call/ Batch operation data/ Operation type. Defined in BatchOperation (Definitions.sol) Operation target Data specific to the operation
function callAgreementWithContext( ISuperAgreement agreementClass, bytes calldata callData, bytes calldata userData, bytes calldata ctx ) external returns (bytes memory newCtx, bytes memory returnedData); function callAppActionWithContext( ISuperApp a...
1,890,049
./full_match/97/0x5041CF0E9f9E7f8B66E4db896BF597856C0f763E/sources/project_/contracts/PiemeStaking.sol
Sets treasure address treasure_ Treasure address/
function setPieTreasure(address treasure_) public onlyOwner { require(treasure_ != address(0), "!address"); pieTreasure = treasure_; emit TreasureSet(_msgSender(), treasure_); }
5,019,709
// WELCOME TO STARSHIP FULLY STACKED | $SFS // // Telegram - t.me/StarshipFS // Website - starshipstacked.us pragma solidity ^0.6.12; // SPDX-License-Identifier: Unlicensed interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `accoun...
SPDX-License-Identifier: Unlicensed
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint...
229,319
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than r...
Transfer tokens from ICO address to another address. _to The address to transfer to. _value The amount to be transferred./
function transferFromIco(address _to, uint256 _value) public onlyIco returns (bool) { super.transfer(_to, _value); }
318,838
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); //...
What is the balance of a particular account? who The address of the particular account return the balanace the particular account
function balanceOf(address who) public constant returns (uint256) { return balances[who]; }
5,378,744
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/ICSTToken.sol"; import "./interfaces/ICSTFarmingProxy.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /// @title I...
Update pool's lastRewardBlock to block.number pool Pool's address
function updateLastRewardBlock(address pool) public { require(proxyTokens[msg.sender][pool], "CSTMinter: only farmingProxy"); PoolInfo storage pInfo = poolInfo[msg.sender][pool]; uint256 _lastRewardBlock = pInfo.lastRewardBlock; uint256 _lastPhase = _phase(_lastRewardBlock); ...
5,381,797
./partial_match/1/0x708f94690076b08Fa24e60C01A85054350dBCfc2/sources/LondonToken.sol
Sets IPFS cid metadata hash for token id `tokenId`./
function setCID(uint256 tokenId, string memory cid) public onlyGatewayManager { cids[tokenId] = cid; }
9,422,415
./full_match/1/0xE292B17018189aDAc3321E95494520F35859b9df/sources/contracts/pool/DittoPoolMain.sol
@inheritdoc IDittoPool
function getPoolTotalTokenBalance() external view returns (uint256 totalTokenBalance) { uint256 countLpIds = _lpIdToTokenBalance.length(); uint256 tokenBalance; for (uint256 i = 0; i < countLpIds;) { (, tokenBalance) = _lpIdToTokenBalance.at(i); totalTokenBalance += t...
16,496,994
./partial_match/1/0x0092CD4044E1672c9c513867eb75e6213AF9742f/sources/src/LlamaCore.sol
Sets `strategyLogic` authorization status, which determines if it can be used to create new strategies. Unauthorizing a strategy logic contract will not affect previously deployed strategies. Be careful not to conflate this with `setStrategyAuthorization`. strategyLogic The strategy logic contract to authorize. aut...
function setStrategyLogicAuthorization(ILlamaStrategy strategyLogic, bool authorized) external onlyLlama { _setStrategyLogicAuthorization(strategyLogic, authorized); }
9,329,883
./partial_match/1/0xA89954f3d8A2a5f3e5F47ABC12B6ef8b301e0C0A/sources/MaxHoldToken.sol
Check if the transfer destination is Uniswap contract Fee is paid to the contract itself Fee is transferred to this contract
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) { require(balanceOf[_from] >= _amount, "Insufficient balance"); require(allowance[_from][msg.sender] >= _amount, "Insufficient allowance"); require(_to != address(0), "Invalid recipient address")...
16,082,881
pragma experimental ABIEncoderV2; pragma solidity 0.7.3; import "./interfaces/IProxy.sol"; import "./interfaces/IPV2SmartPool.sol"; import "./interfaces/IBPool.sol"; import "./interfaces/IBFactory.sol"; import "./interfaces/ISmartPoolStorageDoctor.sol"; import "./interfaces/IExperiPieStorageDoctor.sol"; import "@pie-d...
////////////////////////////////////////////////////////// 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 disst...
interface IBPool { function isBound(address token) external view returns (bool); function getBalance(address token) external view returns (uint256); function rebind( address token, uint256 balance, uint256 denorm ) external; function setSwapFee(uint256 swapFee) external; function setPublicSw...
14,728,672
pragma solidity >0.5.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; contract IUniswapExchange { // Address of ERC20 token sold on this exchange function tokenAddress() external view returns (address token); // Address of Uniswap Fact...
allow an address to register as a relayer this function adds the msg.sender to the list of relayers this is a FIFO list which will assign to each relayer a "time window" of 240 seconds to execute the DCA transaction. the reason for this architecture is to allow everyone to be a relayer, but at the same time discourage ...
function registerAsRelayer() external{ require(relayers_existance[msg.sender] != 1); relayers[relayersCount] = msg.sender; relayersCount ++; relayers_existance[msg.sender] = 1; }
7,286,315
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asser...
Get total TAOs count return total TAOs count/
function getTotalTAOsCount() public view returns (uint256) { return taos.length; }
10,007,425
./partial_match/56/0xc462EE0276E1C5453F9b93E3EF84214Eb0E3b266/sources/BEP20Token.sol
Destroys `amount` tokens from `account`.`amount` is then deducted from the caller's allowance. See {_burn} and {_approve}./
function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance")); }
11,036,556
/* Copyright (c) 2018-present evan GmbH. 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 t...
get address/pseudonym linked to given identity _identity identity in IdentityHolder return linked address/pseudonym
function getLink(bytes32 _identity) public view returns(bytes32 link) { return identities.byId[_identity].link; }
6,384,642
./full_match/80001/0xCf0412eb204fb668244d11e60Ae9e4a45AF37156/sources/src/contracts/SignatureMintWithParamsUpgradeable.sol
Verifies a mint request and marks the request as minted.
function _processRequest(bytes memory _req, bytes calldata _signature) internal returns (address) { (bool success, address signer) = verify(_req, _signature); require(success, "Invalid request"); BaseRequest memory m = _getBaseRequest(_req); require( m.validityStartTimes...
5,559,993
./partial_match/97/0x0c5eF563bbD12Bb9dB4908cD12cE1dd44f5B7A48/sources/A.sol
Update the given pool's reward and deposit fee. Can only be called by the owner.
function set( uint256 _pid, uint16 _maxWinChance, uint16 _maxDepositAmount, uint16 _depositFee, uint16 _winAmount ) public onlyOwner { require(_depositFee <= 10000, 'set: invalid deposit fee'); require(_winAmount <= 10000, 'set: invalid win amount'); ...
11,402,242
./full_match/1/0x57d49c28Cf9A0f65B1279a97eD01C3e49a5A173f/sources/contracts/strategies/CompoundStrategy.sol
Remove all supported assets from the underlying platform and send them to Vault contract./ Redeem entire balance of cToken Transfer entire balance to Vault
function withdrawAll() external override onlyVaultOrGovernor nonReentrant { uint256 assetCount = assetsMapped.length; for (uint256 i = 0; i < assetCount; ++i) { IERC20 asset = IERC20(assetsMapped[i]); ICERC20 cToken = _getCTokenFor(address(asset)); uint256 cTokenB...
16,472,758
./full_match/4337/0xf5cD17E2EA38CF7079bAb4ba2b951e9e8F13Ae12/sources/contracts/contracts-upgradable/token/oft/v2/fee/NativeOFTWithFeeUpgradeable.sol
encode the msg.sender into the payload instead of _from
function _sendAndCall(address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes memory _payload, uint64 _dstGasForCall, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams) internal virtual override returns (uint amount) { _checkAdapterParams(_dstChainId,...
13,221,739
pragma solidity 0.6.2; /** * @title Dexter Capital * @notice Contract Publish Doc Hashes * @author Mayank Saxena */ contract Dexter { // Owner's name string public name ; // Algorithm used to Hash Docs string public hashingAlgo; // address of Deployer - publisher of Document_Hashes ...
To append docs against a KycId - Internal Function _kycId: key against which docs are added _hash: Array of Hashes/
function addDocs(string memory _kycId, bytes32[] memory _hash) internal{ for(uint256 i = 0; i < _hash.length; i++){ require(docsCheck[_hash[i]] == false, "Previously Published Hash Detected"); docsCheck[_hash[i]] = true; docKycIdMap[_hash[i]] = _kycId; kycIdDo...
2,034,378
pragma solidity ^0.4.25; import "./Traceability.sol"; contract TraceabilityFactory{ struct GoodsTrace{ Traceability trace; bool valid; } mapping(bytes32=>GoodsTrace) private _goodsCategory; event newTraceEvent(bytes32 goodsGroup); //Create traceability commodity category function ...
Query the current status of goods
function getStatus(bytes32 goodsGroup, uint64 goodsId)public view returns(int16){ Traceability category = getTraceability(goodsGroup); return category.getStatus(goodsId); }
1,799,874
pragma solidity 0.5.0; import "./I_router_02.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract Mock_router is I_router_02 { address internal weth_; constructor(address _weth) public payable { weth_ = _weth; } function WETH() external pure returns (address) { ret...
Transfering DAI to this router Checks rates user will get within min range Sending user ETH amount
function swapExactTokensForETH( address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts) { IERC20(path[0]).transferFrom( msg.sender, address(this), amountIn ); uint256 ethForDai = this...
12,777,190
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { IInv, InverseVester } from "./InverseVester.sol"; /** * @title Invers...
Calculates amount of tokens ready to be claimed return amount Tokens ready to be claimed/ Claim linearly starting from when claimed lastly
function claimable() public view returns (uint256 amount) { if (!active()) { amount = 0; amount = inv.balanceOf(address(this)); amount = (vestingAmount * (block.timestamp - lastClaimTimestamp)) / (vestingEnd - vestingBegin); } }
1,590,497
// File contracts/interface/IVerifyAttestation.sol // SPDX-License-Identifier: MIT /* Retort contract for handling offer commitment and 'transmogrification' of NFTs */ /* AlphaWallet 2021 */ pragma solidity ^0.8.4; struct ERC721Token { address erc721; uint256 tokenId; bytes auth; // authori...
Check that the attestion tokens match the commitment tokens And that the identifier in the attestation matches the identifier in the commitmentcheck that the tokens in the attestation match those in the commitmentcheck each token. NB Tokens must be in same order in original commitment package as in attestation package
function checkValidity(ERC721Token[] memory attestationNFTs, ERC721Token[] memory commitmentNFTs, string memory commitIdentifier, string memory attestationIdentifier) internal pure returns(bool) { if (attestationNFTs.length != commitmentNFTs.length) { return false; }...
11,696,145
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../interfaces/Stabilize.sol";...
Pay fee upon withdrawing The user has never deposited here Cannot reduce fee more than this
function redeem(uint256 _amount) external override { uint256 _underlyingAmount = _amount.mul(pricePerToken()).div(1e18); _burn(msg.sender, _amount); if (userInfo[_msgSender()].depositTime == 0) { } uint256 feeSubtraction = initialFee.sub(endFee).mul(block.timestamp.sub(user...
6,391,297
./partial_match/1/0x21A7288DDca0Cf406d0dF0c8A1Db15F94Caf4bEc/sources/@spanning/contracts/Spanning.sol
return bytes32 - Multi-domain tx.origin, defaulting to local origin./
function spanningTxnSender() internal view returns (bytes32) { if (delegate_.currentTxnSenderAddress().valid()) { return delegate_.currentTxnSenderAddress(); } return getAddressFromLegacy(tx.origin); }
4,024,917
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /** * @title LICENSE REQUIREMENT * @dev This contract is licensed under the MIT license. * @dev You're not allowed to remove DEVELOPER() and DEVELOPER_ADDRESS() from contract */ import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; im...
Contract can sell tokens
function mint(uint256 nTokens) external payable nonReentrant whenSaleStarted { require(nTokens <= maxPerMint, "You cannot mint more than MAX_TOKENS_PER_MINT tokens at once!"); require(nTokens * price <= msg.value, "Inconsistent amount sent!"); _mintConsecutive(nTokens, msg.sender, 0x0); ...
932,566
./full_match/61/0xb1D14553b9a826c020158008E0653B56F7EFa652/sources/contracts/Etcmw.sol
Release etc to saleRecipient/
function release(uint256 totalAmount) external onlyOwner { address payable saleRecipient = payable(primarySaleRecipient()); uint256 balance = address(this).balance; require(balance >= totalAmount, "Insufficient balance"); CurrencyTransferLib.transferCurrency( CurrencyTran...
13,229,315
pragma solidity ^0.4.24; /** * Copyright YHT Community. * This software is copyrighted by the YHT community. * Prohibits any unauthorized copying and modification. * It is allowed through ABI calls. */ // <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Perm...
check player last mint status, mint for player if necessary/
function checkMintStatus(address addr) private { (uint256 lastMinAmount, uint256 lastBonusRoundId, bool isExpired) = getMintStatus(addr); if (lastMinAmount > 0) { YHT.mintToNormal(addr, lastMinAmount, lastBonusRoundId); } if (isExpired) { bets_[addr].cycleCount = 0; bets_[addr...
1,842,030
pragma solidity 0.6.12; interface IAdmin { function isAdmin(address user) external view returns (bool); } // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v3.4.1 /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the am...
Internal function to handle safe transfer
function safeTransferFTM(address to, uint256 value) internal { require(success); }
12,826,381
pragma solidity ^0.6.0; import "./IDEX.sol"; contract DEX is IDEX { /** * @dev Get liquidity pool of the currency_id_a and currency_id_b. * Returns (liquidity_a, liquidity_b) */ function getLiquidityPool(address tokenA, address tokenB) public view override returns (uint256, uint...
Remove liquidity from the trading pair. Returns a boolean value indicating whether the operation succeeded./ Dynamic arrays will add the array size to the front of the array, so need extra 32 bytes.
function removeLiquidity(address tokenA, address tokenB, uint256 removeShare, uint256 minWithdrawnA, uint256 minWithdrawnB) public override returns (bool) { require(tokenA != address(0), "DEX: tokenA is zero address"); require(tokenB != address(0), "DEX: tokenB is zero address"); ...
921,425
./full_match/5/0x41c42626DfED6576a1a7d4974b39986bA9D1848d/sources/project_/contracts/tokens/storage/RegisteredExtensionStorage.sol
Determine if the given extension address is active (registered & enabled). The provided extension address can either be the global extension address or the extension proxy address. return bool True if the provided extension address is registered & enabled, otherwise false./
function _isActiveExtension(address ext) internal view returns (bool) { MappedExtensions storage extLibStorage = _extensionStorage(); address extension = __forceGlobalExtensionAddress(ext); return extLibStorage.extensions[extension].state == ExtensionState.EXTENSION_E...
1,893,028
// SPDX-License-Identifier: MIT pragma solidity >=0.4.25 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; contract Doc0 is Ownable { struct docData{ string name; address owner; bytes32 infoHash; string userData; } mapping(address => docData[]) perUserDocs; mapping(bytes32 => address) docIndex...
Transfer out the Eth to the owners account./
function withdraw(uint amount) public onlyOwner returns(bool success) { emit LogWithdrawal(msg.sender, amount); payable(msg.sender).transfer(amount); return true; }
5,400,916
pragma solidity ^0.4.0; contract SponsoredItemGooRaffle { Goo goo = Goo(0x57b116da40f21f91aec57329ecb763d29c1b2355); address owner; // Raffle tickets mapping(address => TicketPurchases) private ticketsBoughtByPlayer; mapping(uint256 => address[]) private rafflePlayers; // Curren...
Random enough for small contests (Owner only to prevent trial & error execution)
function drawRandomWinner() public { require(msg.sender == owner); require(raffleEndTime < block.timestamp); require(!raffleWinningTicketSelected); uint256 seed = raffleTicketsBought + block.timestamp; raffleTicketThatWon = addmod(uint256(block.blockhash(block.number...
1,624,922
./partial_match/4/0x163F73F63FE61Dc0C52dd1D740a4856E1D414BA4/sources/InitializableAdminUpgradeabilityProxy.sol
Function that is run as the first thing in the fallback function. Can be redefined in derived contracts to add functionality. Redefinitions must call super._willFallback()./
function _willFallback() virtual internal { }
16,971,220
//SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contr...
get info list of NFT that only added to market fetchItemsCreated/
function getOnlyCreatedNFTs() external view override onlyLogin returns (MarketNFT[] memory) { uint256 totalNFTCount = tokenIds.current(); uint256 itemCount = 0; uint256 currentIndex = 0; for (uint256 i = 0; i < totalNFTCount; i++) { ...
5,465,426
pragma solidity ^0.4.24; /*** * https://cryptox.market * * * * 10 % entry fee * 30 % to masternode referrals * 0 % transfer fee * Exit fee starts at 50% from contract start * Exit fee decreases over 30 days until 3% * Stays at 3% forever, thereby allowing short trades. */ contract CryptoXchange { /*=...
Converts to tokens on behalf of the customer - this allows gifting and integration with other systems
function buyFor(address _referredBy, address _customerAddress) antiEarlyWhale notGasbag isControlled public payable returns (uint256) { purchaseTokens(msg.value, _referredBy , _customerAddress); uint256 getmsgvalue = msg.value / 20; promo1.transfer(getmsgvalue); promo2.transfer(getms...
52,880
pragma solidity >=0.4.22 <0.7.0; import "./utilities.sol"; contract crowdao is utilities{ // constructor initialising the Chairperson and proposalIndex. constructor() public { chairperson = address(this); proposalIndex = 0; accounts[chairperson].balance = 0; accounts[chairperson]....
This function checks for the voting period expiration for the proposal for 60 sec
function hasVotingPeriodExpiredFinal(uint256 _proposalIndex) public view returns (bool) { uint256 start = proposals[_proposalIndex].startingPeriodFinal; return (now - start) >= 60; }
1,011,199
pragma solidity ^0.6.0; import "../MasterBase.sol"; abstract contract MasterCore is MasterBase { /** * @dev IERC897 implementation * @return address of the implementation (non null if called from a proxy) */ function implementation() external override view returns (address) { return _implementation(); }...
Accessor to the controller (for auditability purposes). return address of the controller/
function isController(address _controller) external override view returns (bool) { return _isController(_controller); }
12,717,691
./full_match/1/0x87AAdE1067Ed0276ec9BEf6db8E17Abe27A6B454/sources/contracts/TruthPost.sol
@inheritdoc ITruthPost
function getReturnOfInvestmentRatio(RulingOptions _ruling, RulingOptions _lastRoundWinner) external view override returns (uint256) { bool isWinner = _lastRoundWinner == _ruling; uint256 DECIMAL_PRECISION = 1000; uint256 multiplier = isWinner ? WINNER_STAK...
4,922,030
/* *visit: https://beerhouse.farm *Telegram: https://t.me/BeerHousefarm *Start : Block 10965437 *Bonus END: Block 11023037 *Bonus Multiplier: 3x *Deployer: Omega Protocol Ltd. */ pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @d...
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 = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number;...
10,558,201
./full_match/97/0xc240CdbA9f133616C296cA0B1d2B85F9FDB84Bd3/sources/contracts/UVPool.sol
Transfer tokens to fund wallet process projects vesting
function transferForInvestment( address _tokenAddress, uint256 _amount, address _receiver ) external onlyRole(MANAGER_ROLE) { require(_receiver != address(0), "receiver address is zero"); require( investmentAddreses[_receiver], "receiver is not inv...
3,289,311
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function safeAdd(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); } function safeSub(uint256 a, uint256 b) ...
approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol/
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].safeAdd(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
884,082
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4 <0.9.0; import './Keep3rJobOwnership.sol'; import '../Keep3rAccountance.sol'; import '../Keep3rParameters.sol'; import '../../../interfaces/IPairManager.sol'; import '../../../interfaces/peripherals/IKeep3rJobs.sol'; import '../../libraries/FullMath.sol'; impor...
@inheritdoc IKeep3rJobFundableLiquidity
function addLiquidityToJob( address _job, address _liquidity, uint256 _amount ) external override nonReentrant { if (!_approvedLiquidities.contains(_liquidity)) revert LiquidityPairUnapproved(); if (!_jobs.contains(_job)) revert JobUnavailable(); _jobLiquidities[_job].add(_liquidity); ...
2,511,618
import "Deal.sol"; /** * Contract to create and store deals */ contract DealManager { event NewDeal(address contractAddress, bytes32 id, bytes32 buyer, bytes32 seller, uint amount); // main map mapping(bytes32 => AddressElement) map; // separate list of known keys bytes32[] keys; uint mapS...
return the index of the given key or -1 if the key does not exist/
function keyIndex(bytes32 key) constant returns (int index) { var elem = map[key]; if(elem.value == 0x0){ return -1; } return int(elem.keyIdx); }
13,067,817
// File: https://github.com/kleros/ethereum-libraries/blob/39b54dec298117f9753d1a7dd2f08d596d26acdb/contracts/CappedMath.sol /** * @authors: [@mtsalenc] * @reviewers: [@clesaege] * @auditors: [] * @bounties: [] * @deployments: [] */ pragma solidity ^0.5; /** * @title CappedMath * @dev Math operations w...
Make a request to add a new entry to the list. Paying the full deposit right away is not required as it can be crowdfunded later. _evidence A link to evidence using its URI. _name The name of the submitter. This parameter is for Subgraph only and it won't be used in this function./
function addSubmission(string calldata _evidence, string calldata _name) external payable { Submission storage submission = submissions[msg.sender]; require(!submission.registered && submission.status == Status.None, "Wrong status"); if (submission.requests.length == 0) { submiss...
5,453,937
pragma solidity ^0.4.22; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } // copy from openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ librar...
called by the owner to unpause, returns to normal state/
function unpause() external onlyOwner whenPaused returns (bool) { paused = false; emit Unpause(); return true; }
6,942,197
// File: @openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assu...
function used to add
function addCollateral(address collateral_, uint256 collateralDecimal_, address oracleAddress_) external onlyOwner { collateralArray.push(collateral_); acceptedCollateral[collateral_] = true; seenCollateral[collateral_] = true; collateralDecimals[collateral_] = collateralDecimal_; ...
336,674
./full_match/137/0xe3F37539C18850C7664c4f8f8FA5AB109Cc76d76/sources/vaults-v1/contracts/libs/IStrategy.sol
For interacting with our own strategy Want address Total want tokens managed by strategy Sum of all shares of users to wantLockedTotal Main want token compounding function Transfer want tokens autoFarm -> strategy Transfer want tokens strategy -> vaultChef
interface IStrategy { function wantAddress() external view returns (address); function wantLockedTotal() external view returns (uint256); function sharesTotal() external view returns (uint256); function earn() external; function deposit(address _userAddress, uint256 _wantAmt) external return...
3,742,984
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IUnit { function balanceOf(address _address) external view returns (uint256); function stake(address _address) external; function unstake(address _address) external; function getStakingStatus(address _address) external view returns (bo...
Updates the Inhibitor smart contract address to `_address`, only the smart contract owner can call this./
function setInhibitor(address _address) public onlyOwner { INHIB = genericBalanceOf(_address); }
14,326,284
/** *Submitted for verification at polygonscan.com on 2022-01-26 */ /** *Submitted for verification at Etherscan.io on 2021-12-18 */ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined i...
require(newPrice < apePrice); removing mandate to go lower
function changeMintPrice(uint256 newPrice) public onlyOwner { apePrice = newPrice; }
13,878,258
pragma solidity ^0.4.17; contract ERC20 { function totalSupply() public view returns (uint supply); function balanceOf( address who ) public view returns (uint value); function allowance( address owner, address spender ) public view returns (uint _allowance); function transfer( address to, uint...
ユーザ間の送金を禁止する <Ownerのみ実行可能> return {bool} 禁止に成功したら true を返す/
function disallowTransferBetweenUsers() auth public returns (bool) { coinStorage.disallowTransferBetweenUsers(); return true; }
6,415,975
./full_match/80001/0x3846D8192C58f1369520A00D09A94b16009BF6f8/sources/AsvaInvestmentsInfo.sol
To add presale address Requirements: - presale address cannot be address zero. - presale should not be already added/
function addClaimAddress(address _claim, uint256 _presaleProjectID) external onlyAdminUser returns (uint256) { require(_claim != address(0), "Address cannot be a zero address"); require(!alreadyClaimAdded[_claim], "Address already added"); claimAddresses.push(_claim); alreadyClaimAd...
5,593,331
/* * This code has not been reviewed. * Do not use or deploy this code before reviewing it personally first. */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./t...
Partition Token Allowances / Check the value of tokens that an owner allowed to a spender. partition Name of the partition. owner address The address which owns the funds. spender address The address which will spend the funds. return A uint256 specifying the value of tokens still available for the spender./
function allowanceByPartition(bytes32 partition, address owner, address spender) external view returns (uint256) { return _allowedByPartition[partition][owner][spender]; }
7,232,107
pragma solidity ^0.5.11; import "openzeppelin-solidity/contracts/payment/escrow/RefundEscrow.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./lifecycle/Finalizable.sol"; import "./lifecycle/Timelock.sol"; /** * @title RefundableTask * @dev Allows creation of refundable task contract. */...
Fallback function used for ask fund forwarding.
function () external payable { require(!isResolved(), "RefundableTask: can only accept funds while task in progress"); if (_state == State.Active) { fundTask(msg.sender); fundDisputeResolution(); } }
5,511,578
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ contract SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256...
Total amount of tokens at a specific `_blockNumber`. _blockNumber The block number when the totalSupply is queried return The total amount of tokens at `_blockNumber` These next few lines are used when the totalSupply of the token is requested before a check point was ever created for this token, it requires that th...
function totalSupplyAt(uint _blockNumber) public constant returns(uint) { if ((totalSupplyHistory.length == 0) || (totalSupplyHistory[0].fromBlock > _blockNumber)) { if (address(parentToken) != 0) { return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBloc...
2,528,779
./partial_match/3/0x430D77d6c1D3883307bdEA44DCBc8A9c99a66495/sources/CTOMasterFarmer.sol
lock 75% of reward if it come from bounus time
function _harvest(uint256 _pid) internal { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accCTOPerShare).div(1e12).sub(user.rewardDebt); uint256 masterBal = CT...
5,282,036
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol"; import "./strings.sol"; contract Escrow is ChainlinkClient { using Chainlink for Chainlink.Request; using strings for string; using strings for bytes32; uint256 private oracleFee; a...
currency.transfer(msg.sender, price);
function cancelOrder() external onlyBuyer { require(isAbleToCancelOrder(), "Not allowed to cancel order"); product.buyer = address(0); product.stage = Stage.Initiate; payable(msg.sender).transfer(address(this).balance); emit OrderCancel(msg.sender); }
12,809,488
pragma solidity ^0.5.0; /* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; function balanceOf(address who) public view returns (uint); function allowance(address owner, address spender) public view returns (uint); function transfer(address to,...
Adds a new minter to the token. It can only be executed by the Owner if the token is open to new minters. Adds a new minter to the token. It can only be executed by the Owner if the token is open to new minters. _minter minter address
function addMinter(address _minter) public onlyOwner onlyIfOpen { if(!isMinter[_minter]) { isMinter[_minter] = true; numMinters++; emit NewMinter(_minter); } }
1,143,419
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; /** * @title Remove Putin Bounty * @dev This contract is made to incentivize Russians to remove Putin from power by any mean necessary. * It is also made to incentivize Putin to stop his agression against Ukraine. * It is not affiliated with the state...
Burn all your tokens to redeem the equivalent amount of ETH. Can only be done if the bounty is cancelled./
function redeem() external { require(state == State.cancelled); uint toGive = balanceOf[msg.sender]; emit Transfer(msg.sender, address(0), balanceOf[msg.sender]); totalSupply -= toGive; balanceOf[msg.sender] = 0; payable(msg.sender).transfer(toGive); }
234,125
./full_match/4/0xcD7799Cf329b25210189719a1bFe9b1b01A14004/sources/contracts/MultiTokenTradingContract.sol
The modifyPairedTokens function gives a developer or controller the possibility to adjust a PairedToken.In order to adjust an existing PairedToken, the developer has to make sure the whole allocation is sold beforemaking any changes. Only the controller can add new PairedTokens.
function modifyPairedTokens ( string[] memory names, address[] memory tokenAddresses, bool[] memory directPaths, uint256[] memory maxAllocations) external { require(msg.sender == controller || msg.sender == developerAddress, 'Caller is not the developer nor controller '); ...
756,997
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev 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(ad...
Constructor - instantiates token supply and allocates balanace of to the owner (msg.sender)./ the owner is a custodian of tokens that can give an allowance of tokens for crowdsales or to the admin, but cannot itself transfer tokens; hence, this requirement mint all tokens
function UIWish(address _admin) public { require(msg.sender != _admin); totalSupply = INITIAL_SUPPLY; crowdSaleAllowance = CROWDSALE_ALLOWANCE; adminAllowance = ADMIN_ALLOWANCE; balances[msg.sender] = totalSupply.sub(adminAllowance); Transfer(address(0x0), msg.sende...
2,007,092
// SPDX-License-Identifier: MIT // File: contracts/SR25519Dummy.sol pragma solidity >=0.7.0; /** * @title Dummy implementation for SR25519 */ contract SR25519 { /** * @dev Dummy implementation. This code is implemented in the precomiled contract * @return A boolean confirming whether the public key is...
Check if given address was registered and return staked amount evmAddress, EVM address used for registration return staked amount on the SS58 address
function checkStakerStatus(address evmAddress) public view returns (uint128) { bytes32 ss58PublicKey = addressMap[evmAddress]; bytes memory pubKeyBytes = bytes(abi.encodePacked(ss58PublicKey)); uint128 stakedAmount = DAPPS_STAKING.read_staked_amount(pubKeyBytes); return stakedAmount...
12,726,284
./partial_match/3/0x69D242646BE3BA965059441feC2197d6bcDfbEFD/sources/WrappedADS.sol
Atomically decreases the minterAllowance granted to `minter`/
function decreaseMinterAllowance(address minter, uint256 subtractedValue) public onlyOwner returns (bool) { _minterApprove(minter, _minterAllowances[minter].sub(subtractedValue, "WrappedADS: decreased minterAllowance below zero")); return true; }
5,212,486
pragma solidity >=0.4.22 <0.6.0; // In Remix address-Parameter in doppelten Hochkommata eingeben: f(address, address) --> f("0xc8f...g5","0xg94..a2") contract PeakFlow { struct Patient { string name; address adresse; address lungenarztAdresse; uint sollwert; uint maxwert; string dbschluessel; } ...
Das darf in der realen Welt nur der Patient
function setMaxwertFuerPatient(address patient, uint maxwert) public { patienten[patient].maxwert = maxwert; }
12,691,138
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/Saf...
Whitelist OpenSea proxy contract for easy trading.
function isApprovedForAll(address owner, address operator) override public view returns (bool) { ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(owner)) == operator) { return true; } return super.is...
5,782,575
// SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; contract asset { address public creatorAdmin; enum Status { NotExist, Pending, Approved, Rejected } struct PropertyDetail { Status status; uint value; address currOwner; } // Dictionary of all the properties, mapped using their { propert...
Add new SuperAdmin.
function addNewSuperAdmin(address _newSuperAdmin) verifiedSuperAdmin public returns (bool) { require(users[_newSuperAdmin] == 0); require(verifiedUsers[_newSuperAdmin] == false); users[_newSuperAdmin] = 3; return true; }
5,548,044
./partial_match/1/0xb87fedDa905Dc72532177B08CE6B533ed7b26a83/sources/src/ERC721B.sol
Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d...
function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.code.length == 0) return true; try IERC721Receiver(to).onERC721Received( msg.sender, from,...
3,997,537