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.21; /** * @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) { if (a == 0) { return 0; } c ...
This function changes startTimestamp time with _startingTime given./
@dev PRE-ICO and ICO times can be changed with this function by the owner if ICO has not started. @param _startPrivateICO contains new starting date for PRE-ICO @param _endPrivateICO contains new ending date for PRE-ICO @param _startPreICO contains new starting date for ICO @param ...
8,081,112
// "SPDX-License-Identifier: UNLICENSED" pragma experimental ABIEncoderV2; pragma solidity >=0.6.0; import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./StockAPI.sol"; import "./PredictionsDB.sol"; /** * Smart Contract to evaluate predictions on DA...
Function to mint REP Tokens on successful evaluation to an address _predictor - the address of the predictor/
function mint(address _predictor) private { uint256 amount = 1; totalSupply = totalSupply.add(amount); balanceOf[_predictor] = balanceOf[_predictor].add(amount); emit RepTokensMinted(_predictor, balanceOf[_predictor], amount); }
14,049,658
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.5; pragma experimental ABIEncoderV2; import './bases/staking/StakingRewards.sol'; import './bases/BaseTokenUpgradeable.sol'; import './bases/staking/interfaces/IOriginatorStaking.sol'; import '../reserve/IReserve.sol'; import '../utils/SafeMathUint128.sol'; im...
Function to transfer participation amount (originator or auditor)/
function _depositProposer(address _proposer, uint256 _percentage, uint256 _goalAmount) internal { uint256 percentageAmount = _calculatePercentage(_goalAmount, _percentage); uint256 depositAmount = 0; if (_proposer == getRoleMember(ORIGINATOR_ROLE, 0)) { depositAmount = _calculat...
142,852
pragma solidity 0.5.10; contract Context { constructor () internal { } function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING return msg.sender; } function _MSGDATA330() ...
inject NONSTANDARD NAMING
function EXTRACTINPUTTXID926(bytes memory _input) internal pure returns (bytes32) {
1,784,071
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; import "../contracts/IToken.sol"; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/LibCommit.sol"; contract TestLibCommit2 { MatryxPlatform.Info info; MatryxPlatform.Data data; bool transferHappen...
set token sender can use matryx set total balance tournament exists, round is Open tournament entry fee paid commit claim commit Commit Submission commit state clearing tournament state clearing
function testCreateSubmission() public { info.token = address(this); data.whitelist[msg.sender] = true; data.totalBalance = 20; data.tournaments[address(this)].rounds.length = 1; LibTournament.RoundData storage roundZero = data.tournaments[address(this)].rounds[0]; ...
5,461,102
./full_match/5/0xFed95E426FED3d682eBBF71252Fb19192c0e71C7/sources/contracts/protocol/modules/v1/DebtIssuanceModuleV2.sol
Returns components from the SetToken, unwinds any external module component positions and burns the SetToken. If the token has debt positions, the module transfers in the required debt amounts from the caller and uses those funds to repay the debts on behalf of the SetToken. All debt will be paid down first then equity...
function redeem( ISetToken _setToken, uint256 _quantity, address _to ) external override nonReentrant onlyValidAndInitializedSet(_setToken) { require(_quantity > 0, "Redeem quantity must be > 0"); _callModulePreRedeemHooks(_setToken, _...
7,078,600
/** *Submitted for verification at Etherscan.io on 2022-03-22 */ /** *Submitted for verification at Etherscan.io on 2022-01-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev...
claims all rewards for account - both for v1 and and v2./
function claimRewards() public nonReentrant { address account = msg.sender; uint256 totalEtherOwed = _getTotalEtherOwed(account); uint256 _totalEtherOwedPerPG = _getTotalEtherPerPG(); uint256 _totalEtherOwedPerAP = _getTotalEtherPerAP(); uint256[] memory stakedPG = STAKING.getStakerTokens(account, address(PG...
6,251,592
/* * Copyright 2019 ConsenSys AG. * * 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 wr...
Get the amount of Ether an address owns in this contract. return amount of Ether in Wei msg.sender has stored in this contract./
function getBalance(address account) external view returns (uint256) { return(whoOwnsWhat[account]); }
6,472,067
pragma solidity ^0.4.21; contract RetirementFundChallenge { uint256 startBalance; address owner = msg.sender; address beneficiary; uint256 expiration = now + 10 years; function RetirementFundChallenge(address player) public payable { require(msg.value == 1 ether); beneficiary = pl...
an early withdrawal occurred penalty is what's left
function collectPenalty() public { require(msg.sender == beneficiary); uint256 withdrawn = startBalance - address(this).balance; require(withdrawn > 0); msg.sender.transfer(address(this).balance); }
13,040,796
pragma solidity ^0.4.24; /* * gibmireinbier - Full Stack Blockchain Developer * 0xA4a799086aE18D7db6C4b57f496B081b44888888 * gibmireinbier@gmail.com */ /* CHANGELOGS: . GrandPot : 2 rewards per round 5% pot with winner rate 100%, no dividends, no fund to F2M contract ...
get reveiced Tickets, based on current round ticketSum
function getTAmount(uint256 _ethAmount, uint256 _ticketSum) public pure returns(uint256) { uint256 _tPrice = getTPrice(_ticketSum); return _ethAmount.div(_tPrice); }
887,375
./partial_match/1/0xf61617938821B059371add876af6b427C9CC3f55/sources/DohaFifaCoin.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Doha Fifa Coin", "DFC") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; ...
4,409,310
./partial_match/1/0x17ed939dfD12D003ebeb8eC010f761ec95e1Fd83/sources/B4SETokenLock.sol
Transfer ownership to new owner
function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0), "New owner cannot be a zero address"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
2,588,015
/* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; // Number of tokens in circulation function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address...
Creates &quot;amount&quot; tokens and send them to &quot;recipient&quot; address Only executed by authorized minters (see &quot;Minted&quot; contract)
function mint(address recipient, uint amount) public onlyMinters returns (bool success) { totalSupply = safeAdd(totalSupply, amount); balances[recipient] = safeAdd(balances[recipient], amount); Transfer(0x0, recipient, amount); return true; }
5,374,735
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9; /// @notice Emitted when the result overflows uint256. error PRBMath__MulDivFixedPointOverflow(uint256 prod1); /// @notice Emitted when the result overflows uint256. error PRBMath__MulDivOverflow(uint256 prod1, uint256 denominator); /// @notice Emitted when ...
mintNFTPostReveal is a public payable function which any user can call AFTER the pre-reveal sale phase. This allows a user to mint any available token ID that hasn't been sold yet. This function cannot be executed until hands have been revealed and distributed. Correct ether value is expected to pay for token. toke...
function mintNFTPostReveal(uint256 tokenId) external payable { uint256 price = getPostRevealNftPrice(tokenId); require(msg.value >= price, "eth too low"); _safeMint(msg.sender, tokenId); }
13,810,355
//Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721) // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/con...
Get the amount of times a user minted nfts. This is different from the balanceOf method because we don't check his amount of tokens, we check the amount of mints. _address The user we want to check how many times did mint. return uint, The amount of times the user minted.
function balanceOfAddress(address _address) public view returns (uint256) { uint256 balance = freeMintsAmount[_address] + whiteListAmount[_address] + publicAmount[_address]; return balance; } event FallbackCalled(address sender, uint256 value, bytes data);
11,651,111
// File: contracts/src/common/interface/IGroup.sol pragma solidity ^0.5.0; contract IGroup { function isGroup(address _addr) public view returns (bool); function addGroup(address _addr) external; function getGroupKey(address _addr) internal pure returns (bytes32) { return keccak256(abi.encodePacked("_group", _...
Set the latest Policy contract address. Only the latest PolicyFactory contract can execute this function./
function setPolicy(address _addr) external { addressValidator().validateAddress(msg.sender, policyFactory); policy = _addr; }
1,388,617
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import "../interfaces/IReign.sol"; import "../interfaces/IPoolRouter.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; contract BasketBalancer { using SafeMath for uint256; uint256 public fullAllocation; uint128 public lastEpochUpdate;...
removes a token from the baskte balancer every time a token is removed to the pool it needs to be removed here as wellremove token from array, moving all others 1 down if necessary
function removeToken(address token) external onlyDAO returns (uint256) { require(tokenAllocation[token] != 0, "Token is not part of Basket"); fullAllocation = fullAllocation.sub(continuousVote[token]); uint256 index; for (uint256 i = 0; i < allTokens.length; i++) { if (...
998,073
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./SafeMath.sol"; import "./OriToken.sol"; // HNK Orijent 1919 - $ORI - Shared Invest Contract // This Contract is Investment Model 1 contract OriShare { // When an investment was contributed event Invested(address indexed _from, address indexed _to, u...
Terminate this contract, and pay-out all remaining investors
function terminate() public { require(owner == msg.sender, 'Only owner can terminate'); while(investors.length != 0) { _cashOut(investors[0]); } terminated = true; }
5,392,821
/// @title Base contract for Snark. Holds all common structs, events and base variables. /// @dev See the Snark contract documentation to understand how the contract is structured. pragma solidity >=0.5.0; import "./openzeppelin/Ownable.sol"; import "./openzeppelin/SafeMath.sol"; import "./snarklibs/SnarkBaseExtraLib....
Return a total number of user's profit share schemes
function getProfitShareSchemeCountByAddress(address schemeOwner) public view onlyOwner returns (uint256) { return SnarkBaseExtraLib.getNumberOfProfitShareSchemesForOwner(_storage, schemeOwner); }
12,776,266
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/E...
Helper to avoid the stack-too-deep error
function __multiSwap( address _fromToken, address _toToken, uint256 _fromAmount, IParaSwapAugustusSwapper.Path[] memory _paths ) private returns (uint256) { address[] memory assetsFromIntegratee = new address[](1); assetsFromIntegratee[0] = _toToken; uint...
1,697,775
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "ds-test/test.sol"; import "../../../../test/utils/Caller.sol"; import {CheatCodes} from "../../../../test/utils/CheatCodes.sol"; import {MockProvider} from "@cleanunicorn/mockprov...
Update the mock to return an unsupported decimal number Set the expected error for the revert Oracle arguments Time update window Chainlink arguments
function test_deploy_shouldRevertWithInvalidCurve3TokenDecimals() public { curve3PoolTokenMock.givenQueryReturnResponse( abi.encodeWithSelector(ERC20.decimals.selector), false ); cheatCodes.expectRevert( abi.encodeWithSelector( LUSD3CRVVal...
15,864,693
// SPDX-License-Identifier: Apache 2.0 // Copyright © 2021 Anton "BaldyAsh" Grigorev. All rights reserved. pragma solidity ^0.8.0; import "../../interfaces/INFT.sol"; import "../../interfaces/INFTStaticMethods.sol"; import "../../../common/proxy/contract-interface/Interface.sol"; import "../../../common/upgradability/...
Returns the Uniform Resource Identifier (URI) for `tokenId` token./
function tokenURI(uint256 tokenId) external view override returns (string memory result) { result; bytes memory data = abi.encodeWithSelector(INFTStaticMethods(address(0x00)).tokenURI_.selector, tokenId); _staticCall(data); }
12,796,765
./full_match/4/0xACcEfe44b73e6517fCCbF8f8961AD0257Ebd8b81/sources/Visitors.sol
Sets the URI for our dynamic API/
function setBaseURI(string memory newBase) public onlyOwner { _baseDynamicURI = newBase; }
670,511
// Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either...
inject NONSTANDARD NAMING
function FLIP981(bytes32) external view returns (address);
12,918,619
pragma solidity ^0.4.15; /** * @title Input validation * * - Validates argument length * * #created 01/10/2017 * #author Frank Bonnet */ contract InputValidator { /** * ERC20 Short Address Attack fix */ modifier safe_arguments(uint _numArgs) { assert(msg.data.length ==...
Send `_value` token to `_to` from `msg.sender` - Notifies registered observers when the observer receives tokens _to The address of the recipient _value The amount of token to be transferred return Whether the transfer was successful or not/
function transfer(address _to, uint _value) public returns (bool) { bool result = super.transfer(_to, _value); if (isObserver(_to)) { ITokenObserver(_to).notifyTokensReceived(msg.sender, _value); } return result; }
12,547,120
./full_match/42/0xa56Ebbcf4A37016A9659Fd50bcF6e7F9232ABaB6/sources/contracts/ClearingHouse.sol
Return the last traded price (used for TWAP)
function marketPrice(uint256 idx) external view returns (uint256) { return perpetuals[idx].marketPrice(); }
9,594,878
pragma solidity ^0.5.11; import "../Manager.sol"; import "./IMinter.sol"; import "./ILivepeerToken.sol"; import "../rounds/IRoundsManager.sol"; import "../bonding/IBondingManager.sol"; import "../libraries/MathUtilsV2.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title Minter * @dev Mana...
Withdraw ETH to a recipient. Only callable by BondingManager or TicketBroker - always trusts these two contracts _to Recipient address _amount Amount of ETH/
function trustedWithdrawETH(address payable _to, uint256 _amount) external onlyBondingManagerOrJobsManager whenSystemNotPaused { _to.transfer(_amount); }
1,836,919
./partial_match/3/0xFF6d4B4684a39ff3bE7E49AF74f75e4bf776a4d5/sources/LandResourceV5.sol
remove the miner from land2ResourceMineState; update status! for backward compatibility if strength can fluctuate some time in the future
function _stopMining(uint256 _tokenId) internal { uint64 minerIndex = miner2Index[_tokenId].indexInResource; address resource = miner2Index[_tokenId].resource; uint256 landTokenId = miner2Index[_tokenId].landTokenId; mine(landTokenId); uint64 lastMinerIndex = uint64( land2ResourceMineState[landToken...
5,276,759
./full_match/84531/0x70302d7cFfCb2a56A39DAf66DC4410fFF2B0242d/sources/contracts/lzApp/LzAppUpgradeable.sol
abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging _checkPayloadSize(_dstChainId, _payload.length);
function _blockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual; function _lzSend( uint16 _dstChainId, bytes memory _payload, address payable _refundAddress, address _zroPaymen...
14,311,248
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; /// @title The IKONDAO - a distributed collective for icon, vector graphics, animated svg's creators and creative artists /// @author Fernando M. Trouw /// @notice this contract experimental /// @notice this contract is an experimental contract and should not be...
mints tokens to the proxy address amount amount of tokens that will be minted to proxy address
function mintUtilityTokens(uint256 amount, address to) external onlyRole(ADMIN_ROLE) { token.mint(to, amount * 10 ** token.decimals()); }
12,789,884
pragma solidity ^0.5.0; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint25...
Checks if valid purchase after other ecosystem contracts roundtrip (double check). return true if the transaction can buy tokens
function validPurchasePostCheck(Data storage _self, uint256 _tokensCreated) private view returns (bool) { require(_self.state == State.Started, "not in state started"); bool withinCap = _self.tokensRaised.add(_tokensCreated) <= _self.cap; require(withinCap, "not within cap"); retur...
1,083,270
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ /** * SourceUnit: d:\GitWork\PollMarket\contracts\contracts\MultipleNFT.sol */ ////// SPDX-License-Identifier-FLATTEN-SUPPRESS-WARNING: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * http...
Returns the total quantity for a token ID _id uint256 ID of the token to query return amount of token in existence/
function totalSupply(uint256 _id) public view returns (uint256) { require(_exists(_id), "ERC1155Tradable#uri: NONEXISTENT_TOKEN"); return Items[_id].supply; }
6,604,539
./full_match/100/0x264F4D5556E7bC67e7F0a95E7f8Bb99184Cf7d73/sources/contracts/citrus-vaults/src/mixins/Vault.sol
approve a contract to be used during harvesting
function allowHarvester(address target, bool allowed) public onlyOwner { if (allowed) { _allHarvesters.push(target); } allowedHarvesters[target] = allowed; emit UpdateAllowedHarvester(target, allowed); }
14,271,956
./full_match/11155111/0x039794dAe419d28AEF3d115F257eccF5125962be/sources/project_/contracts/World1.sol
Admin can unpause the World. Check functions with whenPaused/whenNotPaused modifier
function unpauseWorld() external whenPaused onlyRole(DEFAULT_ADMIN_ROLE) { super._unpause(); }
3,813,803
./full_match/1/0x92785FfB89414a2eB0d9fE4f5F4431262fEEAD9a/sources/src/SecurityToken.sol
Allows a document manger to set a document documentName the name of the document uri the uri of the document documentHash the SHA-256 hash of the document/
function setDocument( bytes32 documentName, string calldata uri, bytes32 documentHash ) external onlyRole(DOC_MANAGER) { _setDocument(documentName, uri, documentHash); }
2,939,717
/** *Submitted for verification at Etherscan.io on 2021-10-27 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uin...
Swaps an amount of tokens for ETH uniswapV2Router: The uniswap router to trade through amount: The amount of tokens to swap to: The address to send the recieved tokens to return The amount of ETH recieved/
function swapForETH( IUniswapV2Router uniswapV2Router, uint256 amount, address to ) internal returns (uint256) { uint256 startingBalance = to.balance; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); ...
2,427,461
./full_match/43113/0xB2Af12407Ec884D8d3dE6d1f7f5dC4777bA501B2/sources/contracts/minita_yak.sol
otherToken.transfer(tx.origin, amountReceived.sub(amountRequired));
function joeCall( address _sender, uint _amount1, bytes calldata _data ) external { require( msg.sender == 0x85e355d284082D2E8C5BDb88a3D9D1c1d0347bB5, 'Unauthorized' ); address[] memory pathMiniYakWavax = new address[](2); uint256 amountRequired = JoeLibrary.g...
7,137,113
pragma solidity ^0.4.2; // @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens // @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf(address _owner) pu...
Creates Periodic Table as first element
function createContractPeriodicTable(string _name) public onlyCEO { require(periodicTableExists == false); _createElement(0, _name, address(this), periodicStartingPrice, scientistSTART); periodicTableExists = true; }
5,503,538
pragma solidity ^0.4.24; import "contracts/Storage.sol"; contract MultiSignAdmin is Pausable, Administratable, UserContract { /* * Constants */ uint256 constant public maxBankCount = 50; /* * events */ event BankAddition(address indexed bank); event BankRemoval(address indexed bank); event ...
Web3 call functions/ Returns number of confirmations of a transaction. transactionId Transaction ID. return Number of confirmations.
function getConfirmationCount(uint256 transactionId) public view returns (uint256 count) { for (uint256 i=0; i<alliance.length; i++) if (confirmations[transactionId][alliance[i]]) count += 1; }
5,414,987
// SPDX-License-Identifier: Apache-2.0-or-later /* Copyright 2021 Rigo Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required b...
Increases the amount of liquidity in a position, with tokens paid by the `msg.sender` params tokenId The ID of the token for which liquidity is being increased, amount0Desired The desired amount of token0 to be spent, amount1Desired The desired amount of token1 to be spent, amount0Min The minimum amount of token0 to s...
function increaseLiquidity(INonfungiblePositionManager.IncreaseLiquidityParams calldata params) external payable returns ( uint128 liquidity, uint256 amount0, uint256 amount1 ) { ( , , address token0, address token1, , , , , , , , ) = I...
12,971,095
./full_match/5/0x46D27417cfbd9b3b110dD14c0122933D36557c69/sources/contracts/ArcadeSwap.sol
Update the swap fee receiver for the contract Throws on the following restriction errors: Caller is not the Contract Admin _newReceiver the updated account receiver for swap fees/
function updateFeeReceiver(address _newReceiver) public onlyRole(DEFAULT_ADMIN_ROLE) { SWAP_FEE_RECEIVER = payable(_newReceiver); emit FeeReceiverUpdated(_newReceiver); }
7,037,236
pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED interface IBEP20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); functio...
How much of the staking tax should be allocated for marketing
function TeamChangeStakingShare(uint8 newShare) public onlyOwner{ require(newShare<=50); StakingShare=newShare; }
965,477
/** *Submitted for verification at Etherscan.io on 2021-04-21 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: Context abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view...
Update the dev fee for this contract defaults at 5% of taxFee, It can be set on only by WEED governance. Note contract owner is meant to be a governance contract allowing WEED governance consensus/
function changeLotteryInfo(uint16 lotteryFee, uint256 lotteryLimit) external onlyOwner { _lotteryFee = lotteryFee; _lotteryLimit = lotteryLimit; emit ChangedLotteryInfo(_msgSender(), lotteryFee, lotteryLimit); }
10,708,995
pragma solidity ^0.4.21; // Open Zeppelin library for preventing overflows and underflows. 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, uint2...
Add a new shop to the collection of official shops / Add shop in shops Array Add shop in shopsMap
function addShop(address _newShop) public onlyOwner returns (bool) { shops.push(_newShop); shopsMap[_newShop] = true; return true; }
12,744,806
./full_match/1/0xCC9Dc9034B6d198EA908B974d6c109FB8edf621d/sources/contracts/ERC721DeterministicCollection.sol
Add a new item to the collection. that this method should only allow itemIds less than or equal to 32 bytes _itemIds - item ids _maxIssuances - total supply for the items/
function addItems(bytes32[] calldata _itemIds, uint256[] calldata _maxIssuances) external onlyOwner { require(_itemIds.length == _maxIssuances.length, "Parameters should have the same length"); for (uint256 i = 0; i < _itemIds.length; i++) { addItem(_itemIds[i].bytes32ToString(), _maxIs...
16,472,123
pragma solidity ^0.4.24; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "zeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "./Percent.sol"; import "./BackedERC20Token.sol"; /* * Sensei Kevlar presents... * * ==========================...
Converts all incoming counter to tokens for the caller/They must send in more than 0 tokensMint the tokens for their investment
function invest() public payable ethCounter returns(uint256) { require(msg.value > 0, "You must send ETH to invest."); return mintTokens(msg.sender, msg.value); }
1,090,944
./full_match/3/0x5ED1F78fCffa96c8aA4A28442dc6660b8DC98407/sources/contracts/Staking.sol
A method to distribute rewards to all stakeholders. Should be called at the end of the month./
function distributeRewards(uint256 time) public onlyOwner { for (uint256 s = 0; s < stakeholders.length; s += 1){ address stakeholder = stakeholders[s]; uint256 reward = calculateReward(stakeholder, time); rewards[stakeholder] = rewards[stakeholder].add(reward...
8,182,135
pragma solidity >=0.4.21 <0.7.0; import "./Ownable.sol"; import "./IERC20.sol"; import "./SafeMath.sol"; //Owner is the Token Manager, not the authority! contract CommunityToken2 is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; address belongingAddress; m...
Gets the balance of the specified address. owner The address to query the balance of. return An uint256 representing the amount owned by the passed address./
function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; }
1,770,912
pragma solidity ^0.5.16; contract Function { // cannot use map for inputs // function mapInput(mapping(uint => uint) memory map) public { // } // can use multi dimensional fixed size array for input function multiDimFixedSizeArrayInput(uint[9][9] memory _arr) public { } // cannot use mult...
Functions can return multiple values.
function returnMultipleVals() public pure returns (uint, bool, uint) { return (1, true, 2); }
12,880,249
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import "@solv/v2-solidity-utils/contracts/access/AdminControl.sol"; import "@solv/v2-solidity-utils/contracts/misc/BokkyPooBahsDateTimeLibrary.sol"; import "@solv/v2-solidity-utils/contracts/misc/StringConvertor.sol"; import "@solv/v2-vnft-cor...
require(block.timestamp > maturity, "too early");
function refreshUnderlyingPriceOfSlot(address voucher_, uint256 slot_) external { uint64 maturity = _getMaturityOfSlot(voucher_, slot_); address underlying = IConvertibleVoucher(voucher_).underlying(); (uint64 fromDate, uint64 toDate) = _getPeriod(voucher_, maturity); g...
12,917,141
./full_match/1/0x65fff8F5f6a9922b6dC13fE06345a0Fe46Dd413D/sources/contracts/VFToken.sol
Update the royalties contract Requirements: - the caller must be an admin role - `royaltiesContractAddress` must support the IVFRoyalties interface/
function setRoyaltiesContract(address royaltiesContractAddress) external onlyRole(_controlContract.getAdminRole()) { require( IERC165(royaltiesContractAddress).supportsInterface( type(IVFRoyalties).interfaceId ), "Contract does not supp...
4,972,463
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma abicoder v2; import "../GitFactory.sol"; import "../libraries/LibGitRepository.sol"; contract GitIssues { event NewIssue(string Cid); enum IssueState {Open, Closed, Resolved} bytes32 constant GIT_ISSUES_STORAGE_POSITION = keccak256("diamond....
The open issue function allows a user to open or reopen an already closed issue by providing a cid. The user is able to add a bounty to an issue. issueCid (string) - CID of issue location/ if there exists already an issue but the state is closed, it is reopened if no issue exists, a new one is opened otherwise just re...
function openIssue(string memory issueCid) public payable { GitIssuesStorage storage i = gitIssues(); bytes32 userCidHash = getUserCidHash(msg.sender, issueCid); Issue storage issue = i.issues[userCidHash]; if(issue.isActive && issue.state == IssueState.Closed) { issue.st...
14,098,747
./full_match/1/0x353C7afDe6Ce407162D4148f5978699bD699a389/sources/contracts/KresusNFT.sol
See {IKresusNFT} emits an {bulkSuccessful} event. Requirements: - Only `proxyAddress` can call this function. - Lengths of `_assetIds`, `_tokenURIs` and `_amounts` must be equal. - All ids in `_assetIds` should not be minted before./
function bulkMint( address _to, uint256[] memory _amounts, bytes memory _data, uint256[] memory _assetIds, string[] memory _tokenURIs ) external override { require(msg.sender == proxyAddress, "Kresus NFT: Caller not Proxy"); require(_a...
3,101,826
./full_match/5/0x378a23c0FA0c6E4F9680ae93caC368B5111BfC6F/sources/project_/contracts/managementContract.sol
View function which checks if `addr` is whitelisted. Returns `true` or `false`/
function isWhitelisted(address addr) external virtual view returns (bool) { return whitelisted[addr]; }
1,960,324
./full_match/1/0x249846ee9acfdCd7685EC7fd7AB02d536d343e3D/sources/contracts/dao/logic/GnarsDAOLogicV2.sol
Admin function for setting the maximum quorum votes bps newMaxQuorumVotesBPS maximum quorum votes bps Must be lower than `MAX_QUORUM_VOTES_BPS_UPPER_BOUND` Must be higher than or equal to minQuorumVotesBPS/
function _setMaxQuorumVotesBPS(uint16 newMaxQuorumVotesBPS) external { if (msg.sender != admin) { revert AdminOnly(); } DynamicQuorumParams memory params = getDynamicQuorumParamsAt(block.number); require( newMaxQuorumVotesBPS <= MAX_QUORUM_VOTES_BPS_UPPER_BOU...
9,673,272
pragma solidity ^0.5.5; pragma experimental ABIEncoderV2; import "contracts/SignatureBase.sol"; contract Signature is SignatureBase { address public newContractAddress; constructor() public { paused = false; ceoAddress = msg.sender; } /// @dev Used to mark the smart contract...
Returns all the signature based on a user_id. _user_id The ID of the user of interest.
function getSignaturesOfUser(uint32 _user_id) external view whenNotPaused returns ( Signature[] memory signatures ) { signatures = _signaturesOfUser[_user_id]; }
5,452,704
/** *Submitted for verification at Etherscan.io on 2021-08-30 */ // SPDX-License-Identifier: MIT pragma solidity =0.7.6; interface IERC20 { function totalSupply() external view returns (uint256 supply); function balanceOf(address _owner) external view returns (uint256 balance); function transfer(a...
Withdraws Ether from the contract _to Address where Eth will be sent _amount Amount of Eth to be sent, if 0 it takes the whole balance
function withdrawEth(address payable _to, uint256 _amount) public onlyAdmin { if (_amount == 0) { _amount = address(this).balance; } require(success, "Eth send failed"); }
2,285,172
pragma solidity ^0.4.24; import "../lib/ERC20.sol"; contract Voting { /* The key of the mapping is candidate name stored as type bytes32 and value is an unsigned integer which used to store the vote count */ mapping (bytes32 => uint256) public votesReceived; mapping (address => bool) public v...
This function returns the list of candidates.
function getCandidateList() public view returns (bytes32[]) { return candidateList; }
12,905,690
pragma solidity 0.4.23; contract CareerCertificate { struct Certificate { bytes32 id; bool isCertificate; bytes32 date; string completeName; string RUT; string institution; bytes32 RutInstitution; string title; string Totalhash; bytes32 FechaTitulacion; ...
Ver si employee esta agregado
function getEmployee(address user) public view returns (bool) { return employee[user]; }
6,437,508
pragma solidity ^0.4.14; contract DSMath { /* standard uint256 functions */ function add(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x + y) >= x); } function sub(uint256 x, uint256 y) constant internal returns (uint256 z) { asse...
allows destroy this whithin 180 days after crowdsale ends
function destroy() onlyOwner { if (time() > end_time + 180 days) { selfdestruct(dev_multisig); } }
2,480,918
pragma solidity >=0.5.15 <0.7.0; import {Ownable} from "@openzeppelin/contracts/ownership/Ownable.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {SynthInterface, SynthetixInterface} from "./SynthetixInt...
Total value of Synths issued to an account, priced in currencyKey account The account to check currencyKey The currency to value the synths in return The total value of the Synths/
function issuedSynths(address account, bytes32 currencyKey) public view returns (uint256) { uint256 total = 0; bytes32[] memory currencyKeys = synthetix.availableCurrencyKeys(); for (uint256 i = 0; i < currencyKeys.length; i++) { total = total.add(syn...
12,720,135
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.6.11; import "./ERC2222.sol"; contract MapleToken is ERC2222 { bytes32 public immutable DOMAIN_SEPARATOR; bytes32 public constant PERMIT_TYPEHASH = 0xfc77c2b9d30fe91687fd39abb7d16fcdfe1472d065740051ab8b13e4bf4a617f; // bytes32 public const...
View the amount of funds that an address has withdrawn. _owner The address of a token holder. return The amount of funds that `_owner` has withdrawn./
function withdrawnFundsOf(address _owner) public view returns (uint256) { return withdrawnFunds[_owner]; }
1,087,247
./full_match/137/0xe35129A1E0BdB913CF6Fd8332E9d3533b5F41472/sources/contracts/protocol/deps/Authority.sol
@inheritdoc IAuthority
function setFactory(address factory, bool isWhitelisted) external override onlyOwner { _changePermission(factory, isWhitelisted, Role.FACTORY); }
3,746,212
./full_match/1/0xD051d5F8bba751350E7B00630E9d990ef338a4ED/sources/contracts/PixelPugs.sol
Returns if the name has been reserved./
function isNameReserved(string memory nameString) public view returns (bool) { return _nameReserved[toLower(nameString)]; }
2,939,312
pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/EnumerableMapUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "contracts/interfaces/apwine/tokens/IFutureY...
Getter for the factor of claimable yield when unlocking _periodDuration the duration of the periods return the factor of the claimable yield of the last period/
function getUnlockYieldFactor(uint256 _periodDuration) public view returns (uint256) { return unlockClaimableFactorByDuration[_periodDuration]; }
13,427,566
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contract...
Receive stakes for an account account address/
function getStakes(address account) external view returns (Stake memory accountStake) { return stakes[account]; }
928,591
./full_match/7700/0xaFDff583519AC6eE8578290E1833385b8EAC360B/sources/contracts/manifold/overrides/RoyaltyOverrideCloneable.sol
See {IEIP2981RoyaltyOverride-setDefaultRoyalty}./
function setDefaultRoyalty(TokenRoyalty calldata royalty) external override onlyOwner { _setDefaultRoyalty(royalty); }
4,648,618
// 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...
The vault receives tokens on behalf of an account account The account address value The acount received/
function _receiveFor(address account, uint256 value) internal { _balances[account] = _balances[account].add(value); _totalBalance = _totalBalance.add(value); emit Received(account, value); }
12,574,907
pragma solidity ^0.4.24; import "../coffeeaccesscontrol/ConsumerRole.sol"; import "../coffeeaccesscontrol/DistributorRole.sol"; import "../coffeeaccesscontrol/FarmerRole.sol"; import "../coffeeaccesscontrol/RetailerRole.sol"; import "../coffeecore/Ownable.sol"; // Define a contract 'Supplychain' contract SupplyChain ...
Define a function 'fetchItemBufferTwo' that fetches the data Assign values to the 9 parameters
function fetchItemBufferTwo(uint256 _upc) public view returns ( uint256 itemSKU, uint256 itemUPC, uint256 productID, string productNotes, uint256 productPrice, uint256 itemState, address distributorID, ...
12,877,985
pragma solidity >=0.4.22 <0.7.0; //Below are the 6 functions needed to implement the erc20 standard interface BEP20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns ...
Returns the symbol of the token. E.g. “HIX”.TODO
function symbol() external returns (string memory){ }
12,591,390
pragma solidity ^0.4.24; interface ERC165 { /// @notice Query if a contract implements an interface /// @param interfaceID The interface identifier, as specified in ERC-165 /// @dev Interface identification is specified in ERC-165. This function /// uses less than 30,000 gas. /// @return `t...
If `_tokenId` is not valid trows an exception otherwise return a URI which point to a JSON file like: { "name": "Identifies the asset to which this NFT represents", "description": "Describes the asset to which this NFT represents", "image": "A URI pointing to a resource with mime type image/ repr...
function tokenURI(uint256 _tokenId) external view validToken(_tokenId) returns (string) { bytes memory prefix = new bytes(2); prefix[0] = 0x12; prefix[1] = 0x20; (,,,,,,bytes32 ipfs) = dataSource.roomnights(_tokenId); bytes memory value = ...
13,066,512
pragma solidity ^0.4.18; import "contracts/interfaces/InvestorsPool.sol"; contract UnilotInvestors is InvestorsPool { enum InvestorState { ANONYMOUS, //Basically default value REGISTERED, //Can invest APPROVED, //Can play (KYC) BANNED, //Mostly for abuse cases FROZE...
We shouldn't know this investor beforeReferrer should be registered investor if providedRecord referrer if he was provided
function add(address investor, uint _state, address referrer) public onlyAdministrator validState(_state) notAdministrator(investor) { require( investors[investor].state == InvestorState.ANONYMOUS ); require( referrer == address(0) || investors[referrer].state != ...
14,096,525
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "../interfaces/IAuction.sol"; import "../math/SafeMathU128.sol"; contract AuctionProtocol is IAuction { using SafeMath for uint128; // Node in the protocol struct Node { address validator; string nodeUrl; } // State o...
get minimum bid for a given slot
function getMinBid(uint16 slotNumber) public view returns(uint128) { require( slotNumber > (getCurrentSlotNumber() + CLOSED_SLOTS), "Slot number must be greater than current slot number" ); return slots[slotNumber].minBid; }
7,320,616
pragma solidity ^0.4.0; interface ERC20 { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to,...
Fallback will donate to pot
function() payable { totalEtherGooResearchPool += msg.value; }
1,496,661
pragma solidity 0.4.24; import "./libraries/openzeppelin/migrations/Initializable.sol"; import "./libraries/tokenfoundry/StateMachine.sol"; import "./libraries/openzeppelin/ECRecovery.sol"; import "./libraries/Bytes.sol"; /// @title Battleship game over state channels. /// @author Ricardo Rius - <ricardo@rius.info> ...
Reveal played board. _hits length > 0 and <= 20 _notHits length > 0 and <= 80
function revealOtherBoard(uint[] _hits, uint[] _notHits) public checkAllowed ifPlayer { require(_hits.length > 0 && _hits.length <= 20 && _notHits.length > 0 && _notHits.length <= 80,", incorrect revealed board size."); require(hiddenShips[msg.sender] != bytes32(0) && playerSigner[msg.sender] != add...
1,824,995
pragma solidity ^0.4.11; import './SafeMath.sol'; /* Open issues: - The formula is not yet super accurate, especially for very small/very high ratios - Possibly support dynamic precision in the future */ contract Math is SafeMath { uint256 constant PRECISION = 32; // fractional bits uint256 c...
Solidity automatically throws when dividing by 0 There is no case in which this doesn't hold
function div(uint256 _x, uint256 _y) internal constant returns (uint256) { assert(_x <= MAX_F && _y <= MAX_F); assert(_y > 0); _x = _x << PRECISION; uint256 _z = _x / _y; assert(_x == _z * _y + _x % _y); return _z; } Returns result upshifted by PRECIS...
12,578,025
./full_match/44787/0x54C84bbB313dFe1397Cc1187f1caaC18508C1e45/sources/contracts/StarNode.sol
burn uint256 indexLength = NFTLogic.getAllTokenId().length; if(indexLength > 0){ uint256 divAmountBonus = amountBonus.mul(1e12).div(indexLength); for(uint256 i = 0;i< indexLength;i++){ uint256 tokenId = NFTLogic.getAllTokenId()[i]; uint256 UserBonusToken = NFTLogic.disposeBonusToke(tokenId); ...
function depositNode(uint256 _unit) external { address _user = _msgSender(); require(userInviter[_user] == address(0), "User must not node user"); require(_unit > 0, "Uint must greater than 0"); uint256 _amount = _unit.mul(unitPrice); starToken.burnFrom(_user, _amount.mul(100...
13,267,955
./full_match/1/0x409741E6a15c1B7F9f54eBf877a917296a635A06/sources/contracts/HashBet.sol
Return the bet in extremely unlikely scenario it was not settled by Chainlink VRF. In case you ever find yourself in a situation like this, just contact hashbet support. However, nothing precludes you from calling this method yourself. Validation check Unlock possibleWinAmount from lockedInBets, regardless of the outco...
function refundBet(uint256 betID) external payable nonReentrant { Bet storage bet = bets[betID]; uint amount = bet.amount; uint betTime = betPlaceTime[betID]; require( block.timestamp >= (betTime + 1 hours), "Wait after placing bet before requesting refund." ...
4,966,729
./full_match/137/0x6ceb95626A59a2F8B1d0B6DB970F4190B89354C7/sources/_koyofinance/exchange-vault-solidity-utils/contracts/helpers/WordCodec.sol
We never accept 256 bit values (which would make the codec pointless), and the larger the offset the smaller the maximum bit length. Testing signed values for size is a bit more involved. For positive values, we can simply check that the upper bits are clear. Notice we remove one bit from the length for the sign bit. N...
function _validateEncodingParams( int256 value, uint256 offset, uint256 bitLength ) private pure { _require(offset < 256, Errors.OUT_OF_BOUNDS); _require(bitLength >= 1 && bitLength <= Math.min(255, 256 - offset), Errors.OUT_OF_BOUNDS); if (value >= 0) { ...
3,751,646
./full_match/1/0xdc2F3feD14a87ccE44440ceF069B3F17a868d929/sources/browser/Unibase.sol
returns amount of days past since contract deployment
function daysPastDeployment() public view returns(uint) { if(deploymentStart == 0){ return 0; } uint daysPast = now.sub(deploymentStart).div(DAYSECONDS); if(daysPast >= 1){ } else{ return 0; } }
2,908,767
// SPDX-License-Identifier: MIT // // https://cryptomarketpool.com/time-lock-contract pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; // The time lock Solidity smart contract below demonstrates how to use the passing of time in a Solidity smart contract. // Think of this contract li...
check that the sender has ether deposited in this contract in the mapping and the balance is >0 check that the now time is > the time saved in the lock time mapping
function withdraw() public { require(balances[msg.sender] > 0, "insufficient funds"); require(block.timestamp > lockTime[msg.sender], "lock time has not expired"); uint amount = balances[msg.sender]; balances[msg.sender] = 0; require(sent, "Failed to send ether"); }
2,570,134
./partial_match/1/0x99B52db75A2C37efA07C3867eC5811B9D878D4e3/sources/VaultStaking.sol
Updates the current NFT contract that allows staking for rewards
function updateNftAddress(address _newNftAddress) external onlyOwner { nftAddress = IERC721(_newNftAddress); }
3,734,961
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import './Context.sol'; import './Strings.sol'; import './ERC165.sol'; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { function hasRole(bytes32 role, address account) external view ...
Restrict a borrower from further borrowing./
function _setBorrowingRestriction( address borrower, bool isBorrowingRestricted ) internal { bool oldIsBorrowingRestricted = _BORROWER_RESTRICTIONS_[borrower]; if (oldIsBorrowingRestricted != isBorrowingRestricted) { _BORROWER_RESTRICTIONS_[borrower] = isBorrowingRestricted; emit B...
5,860,475
./partial_match/1/0x04264df62040290622257F83ee110Ac43d36dE69/sources/API3DAORevenueIncinerator.sol
checks applicable Liquidity struct to see if any LP tokens are redeemable, then redeems that amount of liquidity to this address (which is entirely converted and burned in API3 tokens via '_burnAPI3'), then deletes that mapped struct in 'liquidityAdds'. Implemented in case of lpAddIndex--lpRedeemIndex mismatch / redee...
function redeemSpecificLP(uint256 _lpRedeemIndex) external { if (liquidityAdds[_lpRedeemIndex].withdrawTime > block.timestamp) revert NoRedeemableLPTokens(); uint256 _redeemableLpTokens = liquidityAdds[_lpRedeemIndex].amount; if (_redeemableLpTokens == 0) { delete li...
15,500,467
pragma solidity 0.4.21; // File: contracts/BytesDeserializer.sol /* * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt */ /* * Deserialize...
contractAddr = token.owner(); Give the sale contract rights to reclaim tokens
function setTokenAgent() external onlyOwner { token.setReleaseAgent(); }
2,166,627
pragma solidity 0.5.11; library AddressCalc { function futureAddressCalc(address payable _origin, uint _nonce) internal pure returns (address) { if(_nonce == 0x00) return address(uint160(uint256((keccak256(abi.encodePacked(byte(0xd6), byte(0x94), _origin, byte(0x80))))))); if(_nonce <...
Term time is currently in weeks/
function makeInvestment(uint256 _unlockTime, uint256 _amount, uint term123) external returns (uint256) { require(_balances[_msgSender()] >= _amount, "You dont have sufficent amount of tokens"); require(_amount > 0, "Investment amount should be bigger than 0"); require(_unlockTime >= secondsI...
5,368,339
./full_match/137/0x9E40a8A535D4875848e1821e3C59AB5C5dd86135/sources/contracts/core/connext/libraries/AssetLogic.sol
Calculates the hash of canonical ID and domain. This hash is used as the key for many asset-related mappings. _id Canonical ID. _domain Canonical domain. return bytes32 Canonical hash, used as key for accessing token info from mappings./
function calculateCanonicalHash(bytes32 _id, uint32 _domain) internal pure returns (bytes32) { return keccak256(abi.encode(_id, _domain)); }
4,795,349
/** *Submitted for verification at Etherscan.io on 2020-07-14 */ /** *Submitted for verification at Etherscan.io on 2019-10-02 */ pragma solidity ^0.5.8; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigne...
destruction is for token upgrade
function destruction() onlyOwner public { selfdestruct(msg.sender); }
12,651,217
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; im...
Returns the latest price/
function _chainlink_price() internal returns (int) { ( uint80 roundID, int price, uint startedAt, uint timeStamp, uint80 answeredInRound ) = priceFeed.latestRoundData(); return price; }
12,825,788
pragma solidity ^0.5.10; import './interfaces/SyscoinSuperblocksI.sol'; import "./SyscoinParser/SyscoinMessageLibrary.sol"; import "./SyscoinErrorCodes.sol"; import "./SyscoinTransactionProcessor.sol"; // @dev - Manages superblocks // // Management of superblocks and status transitions contract SyscoinSuperblocks is ...
- sets ClaimManager instance associated with managing superblocks. Once trustedClaimManager has been set, it cannot be changed. _claimManager - address of the ClaimManager contract to be associated with
function setClaimManager(address _claimManager) public { require(address(trustedClaimManager) == address(0) && _claimManager != address(0)); trustedClaimManager = _claimManager; }
12,919,838
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function tran...
Transfer tokens from one address to another _from The address which you want to send tokens from _to The address which you want to transfer to _value The amount of tokens to be transferred/
function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { _transferFrom(_from, _to, _value, msg.sender); return true; }
13,059,869
./full_match/1/0x6d372bA84722826A29EA564d1daFBFf4e87dB67A/sources/contracts/wrapper/NameWrapper.sol
Cannot directly burn other non-user settable fuses
function _checkFusesAreSettable(bytes32 node, uint32 fuses) internal pure { if (fuses | USER_SETTABLE_FUSES != USER_SETTABLE_FUSES) { revert OperationProhibited(node); } }
8,376,511
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interfaces/ILiquidityProtectionStore.sol"; import "../token/ReserveToken.sol"; import "../utility/Owned.sol"; import "../utility/Utils.sol"; /** * @dev This contract serves as t...
updates an existing protected liquidity pool/reserve amounts Requirements: - the caller must be the owner of the contract/ update the protected liquidity update the total amounts
function updateProtectedLiquidityAmounts( uint256 id, uint256 newPoolAmount, uint256 newReserveAmount ) external override ownerOnly greaterThanZero(newPoolAmount) greaterThanZero(newReserveAmount) { ProtectedLiquidity storage liquidity = _protectedLiquidities[id]; addres...
1,063,799
./partial_match/80001/0xF9bC9c1d66e4B28F56069c98A8c5373ec0200a25/sources/WitnetProxy.sol
Payable fallback accepts delegating calls to payable functions. Gas optimized delegate call to 'implementation' contract. Note: `msg.data`, `msg.sender` and `msg.value` will be passed over to actual implementation of `msg.sig` within `implementation` contract. pass back revert message: pass back same data as retu...
function isUpgradableFrom(address from) virtual external view returns (bool); function initialize(bytes memory) virtual external; function version() virtual public view returns (string memory); } fallback() external payable { /* solhint-disable no-complex-fallback */ address _implementation ...
8,823,162
// File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT 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...
Creates a new virtual chain Called only by: an authorized subscription plan contract the initial amount paid for the virtual chain must be large than minimumInitialVcPayment name is the virtual chain name tier is the virtual chain tier rate is the virtual chain tier rate as determined by the subscription plan amo...
function createVC(string calldata name, string calldata tier, uint256 rate, uint256 amount, address owner, bool isCertified, string calldata deploymentSubset) external override onlySubscriber onlyWhenActive returns (uint vcId, uint genRefTime) { require(owner != address(0), "vc owner cannot be the zero addr...
173,641
./full_match/80001/0xB769200Eb2109732eA9da606259A4d34986f5315/sources/contracts/player-id/ParagonsDAOPlayerID.sol
Returns whether the Player rank is high enough to transfer. Fetches the minimum rank required for transfers from PlayerManagement. tokenId The Player's Token ID. return transferrable_ Whether the Player has reached the minimum rank required for transfers./
function _transferrable(uint256 tokenId) private view returns (bool transferrable_) { if (!_exists(tokenId)) revert NoPDP(); IPlayerManagement pm = IPlayerManagement(_addressRegistry.playerMgmt()); return pm.getPlayerData(tokenId).playerRank >= pm.getMinRankForTransfers(); }
9,505,815
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } interface IERC721 is IERC165 { event Transfer( address indexed from, address indexed to, uint256 indexed tokenId); event Approval( address indexed owner, ad...
To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and then delete the last slot (swap and pop). When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so rarely (when the last minted token is burnt) that we still do the ...
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; uint256 lastTokenId = _allTokens[lastTokenIndex]; delete _allTokensIndex[tokenId]; _allTokens.pop(); }
643,701
./full_match/1/0xD688aD7669E5c72B2813f06F969A0700F71505e9/sources/src/UniwarAirdropImpl.sol
_starshot The starshot (token) to check the amount of quills (tokens) an archer has. _archer The archer to check the amount of quills (tokens) for. return The amount of quills (tokens) an archer has for a starshot (token).
function quillsOf(address _starshot, address _archer) external view returns (uint256) { return _quillsOf(_starshot, _archer); }
16,591,135
pragma solidity ^0.5.11; // import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; // import "./SafeMath.sol"; import "./DomainRegistry.sol"; /** * @title DomainDAO - Equity based voting system managed by domain investo...
Returns the amount of shares an investor owns, as well as the total shares in the domain. Used as numerator and denominator bidID unique identifier for a bid, used to query info in 3box info JSON information about a bid/
function createBid(uint bidID, bytes32 info) public isInvestor() bidIsUnique(bidID) { for(uint i = 0; i < investorArray.length; i += 1) { investorsSnapshot[bidID][investorArray[i]] = true; investorSharesSnapshot[bidID][investorArray[i]] = investorSharesArray[i]; investorArraySnapshot[bidID] = in...
15,824,124
//Address: 0x1277ee49236da5c07e93b8b9df29d629842f0ab9 //Contract name: MinesFactory //Balance: 0 Ether //Verification Date: 2/14/2018 //Transacion Count: 7 // CODE STARTS HERE /* CryptoMines game via Ethereum Smart Contract In the game you can buy, sell and upgrade mines from 1 to 14 levels. Upgrade 13 level m...
super bonus for the creation high level mine
function UpMineLVL(uint256 _MineId) public { uint8 MineLVL=MineLevel[_MineId]; require (MineLVL>0 && MineLVL<=13 && MineOwner[_MineId]==msg.sender); for (uint8 lvl=1; lvl<=MineLVL; lvl++) { require (ResourcesOwner[lvl][msg.sender] >= (MineLVL-lvl+2)*15); } for (lvl=1; lvl<=MineLVL; lvl++) { ...
15,804,009