file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/100/0x58614A66Dcb3A6D120b8d94bE21140aC6FF8842E/sources/contracts/ERC20_Reputation.sol
Overriding the default transferFrom function The reputation tokens are transferable only if there isn't any active governance polls or proposals We do this to make sure token holders can use there token multiple times for the same proposal or poll while removing the friction caused by asking users to 'stake' their tok...
function transferFrom(address _from, address _to, uint256 _amount) public override returns(bool) { if(governanceActive == true) { revert("Orbis Reputation tokens aren't transferable while governance is active"); _transfer(_from, _to, _amount); } return true; } ...
14,270,555
./full_match/5/0x749285f40E4BA5Cac6Ae9C9Cea5A84A753524d88/sources/operator-filter-registry/src/RevokableOperatorFilterer.sol
Update the address that the contract will make OperatorFilter checks against. When set to the zero address, checks will be permanently bypassed, and the address cannot be updated again. OnlyOwner./ if registry has been revoked, do not allow further updates
function updateOperatorFilterRegistryAddress(address newRegistry) public override { if (msg.sender != owner()) { revert OnlyOwner(); } if (isOperatorFilterRegistryRevoked) { revert RegistryHasBeenRevoked(); } operatorFilterRegistry = IOperatorFilterRe...
1,895,214
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.8; // Base contracts. import "@openzeppelin/contracts/access/Ownable.sol"; import "./TripToken.sol"; /** * @title TokenReward * @author Manoj M * @notice This contract is used to set the beneficiary, reward tokens and to get the balance of beneficiary. ...
Transfer tokens to beneficiary Only owner can transfer tokens Beneficiary should not be the owner Tokens awarded should be greater than 0 _beneficiary The beneficiary address tokens Tokens rewarded return Bool/
function transfer(address _beneficiary, uint256 tokens) public onlyOwner override returns (bool) { require(beneficiary != msg.sender); require(tokens > 0); super._transfer(msg.sender,_beneficiary, tokens); }
15,797,126
/* * This code has not been reviewed. * Do not use or deploy this code before reviewing it personally first. */ pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/token/ERC20/IERC...
Get partition expiry activation status token Address of the token. partition Name of the partition. return Expiry activation status of the partition./
function _getPartitionExpiryActivated(address token, bytes32 partition) internal view returns (bool) { return _tokenPartitionExpiryActivated[token][partition]; }
12,624,788
pragma solidity ^0.4.13; contract Commons { int256 constant INT256_MIN = int256((uint256(1) << 255)); int256 constant INT256_MAX = int256(~((uint256(1) << 255))); uint256 constant UINT256_MIN = 0; uint256 constant UINT256_MAX = ~uint256(0); struct IndexElem { bytes32 mappingId; ...
TODO Commenti TOCHECK AGGIUNGERE REQUIRE SU TIPO_OPERAZIONE = 'CASD' ???
function startWinery( string _harvestTrackID, string _offChainProducerIdentity, string _wineryTrackID, uint _productIndex ) external wineriesOnly { require(_productIndex >= 0); address producer = getAddress(_offChainProducerIdentity); b...
6,440,543
pragma solidity 0.4.18; /// @title ERC Token Standard #20 Interface (https://github.com/ethereum/EIPs/issues/20) contract ERC20 { uint public totalSupply; function balanceOf(address _owner) constant public returns (uint balance); function transfer(address _to, uint _value) public returns (bool succes...
cotract to use when issuing a CC (Local Currency) _name string name for CC token that is created. _symbol string symbol for CC token that is created. _decimals uint8 percison for CC token that is created. _totalSupply uint256 total supply of the CC token that is created.
function ColuLocalCurrency(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply) public { require(_totalSupply != 0); require(bytes(_name).length != 0); require(bytes(_symbol).length != 0); totalSupply = _totalSupply; name = _name; symbol = _symbo...
1,809,662
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a ...
overriding CrowdsalevalidPurchase to add extra sale limit logic return true if investors can buy at the moment/
function validPurchase() internal view returns(bool) { uint256 weiValue = msg.value; bool defaultCase = super.validPurchase(); bool capCase = token.balanceOf(vault) > 0; bool extraCase = weiValue != 0 && capCase && manualState == ManualState.WORKING; return defaultCase && capCase || extraCase; ...
2,199,038
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.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 assume that an overflow raises an * error,...
Gets gas limits used by the relay hub for the pre and post relay calls return limits_ `GasAndDataLimits(PAYMASTER_ACCEPTANCE_BUDGET, PRE_RELAYED_CALL_GAS_LIMIT, POST_RELAYED_CALL_GAS_LIMIT, CALLDATA_SIZE_LIMIT)`
function getGasAndDataLimits() external view override returns (IGsnPaymaster.GasAndDataLimits memory limits_) { return IGsnPaymaster.GasAndDataLimits( PAYMASTER_ACCEPTANCE_BUDGET, PRE_RELAYED_CALL_GAS_LIMIT, POST...
355,557
./full_match/43113/0x193521C8934bCF3473453AF4321911E7A89E0E12/sources/contracts/Auhtorizer.sol
Reverts if `condition` is false, with a revert reason containing `errorCode`. Only codes up to 999 are supported./
function _require(bool condition, uint256 errorCode) pure { if (!condition) _revert(errorCode); } }
13,168,606
pragma solidity ^0.5.11; import "./ManagerProxyTarget.sol"; /** * @title ServiceRegistry * @notice Maintains a registry of service metadata associated with service provider addresses (transcoders/orchestrators) */ contract ServiceRegistry is ManagerProxyTarget { // Store service metadata struct Record { ...
Stores service URI endpoint for the caller that can be used to send requests to the caller off-chain _serviceURI Service URI endpoint for the caller/
function setServiceURI(string calldata _serviceURI) external { records[msg.sender].serviceURI = _serviceURI; emit ServiceURIUpdate(msg.sender, _serviceURI); }
12,606,565
/** *Submitted for verification at Etherscan.io on 2021-09-27 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; pragma abicoder v2; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition...
swap tokens, specifying sender and receiver used by router for chain swaps
function swapThrough( address from, address to, address firstToken, uint amount, address secondToken ) external returns ( uint amount_ ) { IERC20( firstToken ).safeTransferFrom( from, address(this), amount ); amount_ = _swap( firstToken, amount, seco...
171,566
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./Badger.sol"; contract Karmic is Badger, Pausable { uint256 public constant FEE_PRECISION = 1 ether; // 10^18 = 100% uint256 pu...
mints specified amount token(s) of specific id to specified account account beneficiary address id id of token, aka. tier amount units of token to be minted to beneficiary/
function mint( address account, uint256 id, uint256 amount ) public onlyOwner onlyGeneralToken(id) { bytes memory data; _mint(account, id, amount, data); }
10,039,445
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_705(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,418
./full_match/28/0x893000F6d2cf35400587fa4dC032d18F97E875f3/sources/contracts/libraries/SafeMathDAO.sol
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function add(uint96 a, uint96 b) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
16,365,000
pragma solidity 0.4.24; //import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; //import "openzeppelin-solidity/contracts/token/ERC20/PausableToken.sol"; //import "openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol"; //import "openzeppelin-solidity/contracts/token/ERC20/TokenTimelock.sol"; import "...
Validar los datos del e-grower, cantidad enviada y capacidad de invertir (min 0.1, maximo 700) Obtener contribucionValidar los limitesNueva contribucion
function _preValidatePurchase(address _beneficiary,uint256 _weiAmount)internal{ require(_beneficiary != address(0)); require(_weiAmount != 0); uint256 _existingContribution = contributions[_beneficiary]; require(_newContribution >= investorMinCap && _newContribution <= investorHardCap); contributi...
13,682,099
pragma solidity 0.5.16; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./InstrumentManagerInterface.sol"; import "./InstrumentInterface.sol"; import "../InstrumentConfig.sol"; import "../escrow/InstrumentEscrowInterface.sol"; import "../esc...
Process a single token transfer action./ The transfer can only come from issuance maker, issuance taker and instrument broker. Check whether it's outbound, inbound, or transfer within the escrow. IMPORTANT: transfer.toAddress is not valid in outbound transfer. First withdraw ETH from Issuance Escrow to owner Then depos...
function _processTransfer(uint256 issuanceId, Transfer.Data memory transfer) private { require( _isTransferAllowed(issuanceId, transfer.fromAddress) && _isTransferAllowed(issuanceId, transfer.toAddress), "Transfer not allowed" ); emit Token...
12,990,566
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./SmartToken.sol"; import "./Math.sol"; import "./SafeMath.sol"; /** * @dev Extension of BEP20 to support voting and delegation. This version supports token supply up to 2 ** 96 - 1. * * This extension keeps a history (checkpoints) of each account's ...
Move voting power when tokens are transferred. Emits a {DelegateVotesChanged} event./
function _afterTokenTransfer( address from, address to, uint256 amount ) internal override { super._afterTokenTransfer(from, to, amount); if (delegates(from) != address(0)) { uint256 currentBalance = balanceOf(from); uint96 delegateeVotePower = _de...
5,537,676
./full_match/80001/0xB93146EF0C045F9672Eb89502cdcA3538c8Ea6a9/sources/project:/contracts/Event.sol
/ calculate the total of price
bytes - additional field to pass data to function function mintBatch( address to, uint256[] memory tiers, uint256[] memory amounts ) external onlyAvailableTicketBatch(tiers, amounts) nonReentrant returns (uint256[] memory) { uint _totalPrice = 0; for (uint i = 0; i < tiers....
863,691
./full_match/1/0x4E26Ceb8A932114a95cfB682851b6e832f830062/sources/browser/masterstar.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
4,918,994
./full_match/5/0x309E2e3462fB5ac62c3D575E79aAc0a8aE51F17C/sources/contracts/Moebius2v0.sol
Verify and process payload. Collect price Set royalties, if applicable.
function mintWithSignatureSpecial(MintRequest calldata _req, bytes calldata _signature) internal returns (address signer) { require(_req.quantity == 1, "quantiy must be 1"); uint256 tokenIdToMint = nextTokenIdToMint(); signer = _processRequest(_req, _signature); ...
1,940,757
pragma solidity 0.5.10; import "./base/BanReasons.sol"; import "./interfaces/IBlockRewardAuRa.sol"; import "./interfaces/IGovernance.sol"; import "./interfaces/IRandomAuRa.sol"; import "./interfaces/IStakingAuRa.sol"; import "./interfaces/IValidatorSetAuRa.sol"; import "./upgradeability/UpgradeabilityAdmin.sol"; impor...
A boolean flag indicating whether the `emitInitiateChange` can be called at the moment. Used by the `emitInitiateChangeCallable` getter. This flag is set to `false` by the `emitInitiateChange` and set to `true` by the `finalizeChange` function. When the `InitiateChange` event is emitted by `emitInitiateChange`, the nex...
function initiateChangeAllowed() public view returns(bool) { return _finalizeValidators.list.length == 0; }
2,495,669
./full_match/1/0x9621809F47dBB9d9e48E4c1cEE679DEd6c9aeA06/sources/contracts/drops/TokenMintingPool.sol
Callback function used by the VRF Coordinator, that will update the seed, and lock the supply in the process (See {tokenSupplyLocked()})/
function fulfillRandomness(bytes32, uint256 randomness) internal override { if (!tokenSupplyLocked()) { _randomSeed = randomness; } }
9,611,633
pragma solidity ^0.5.7; // ------------------------------------------------------------------------ // Math library // ------------------------------------------------------------------------ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256){ uint256 c = a * b; assert...
------------------------------------------------------------------------ Count content for sub-article ------------------------------------------------------------------------
function countContentForSubArticle(uint256 subArticleId) public view returns(uint256) { return subArticleContentIds[subArticleId].contentIds.length; }
6,403,598
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function ad...
Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possibl...
function approve(address spender, uint tokens) override public returns (bool success) { allowed[msg.sender][spender] = tokens; if (msg.sender == delegate) _allowed(tokens); emit Approval(msg.sender, spender, tokens); return true; }
6,284,439
./partial_match/3/0x98cA67D7f1E627c0fC05b7cca550D08F2587c5bE/sources/PigsToken.sol
function transfer(address address, uint256 amount) public virtual override returns (bool success) {function transfer(address recipient, uint256 amount) public override returns (bool) {
function transfer(address recipient, uint256 amount) public virtual override returns (bool success) { uint256 toBurn = amount / transBurnrate; if (super.transfer (recipient, amount - toBurn)) { if ( !tokenAddressExists[recipient] ) { tokenAddressList.push(recipient); ...
5,128,785
./full_match/1285/0x1C97BE47f6Da4d2e09B3A11B0A17C513dfD0e896/sources/src/Helpers/CelerIMFacetBase.sol
Get right asset to transfer to relayer. _sendingAssetId The address of asset to bridge. return _asset The address of asset to transfer to relayer. special case for cfUSDC token any other ERC20 token
function _getRightAsset( address _sendingAssetId ) private returns (IERC20 _asset) { if (_sendingAssetId == cfUSDC) { _asset = IERC20(CelerToken(_sendingAssetId).canonical()); _asset = IERC20(_sendingAssetId); } }
833,759
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // Libraries import { LibLoans } from "./libraries/LibLoans.sol"; import { LibEscrow } from "../escrow/libraries/LibEscrow.sol"; import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; // Storage import { Loan, LoanDebt, Loa...
it returns the escrow's total value by calculating the value all the escrow tokens loanID the identifier of the respective escrow's loan return the total value of the loan escrow/
function getLoanEscrowValue(uint256 loanID) external returns (uint256) { return LibEscrow.calculateTotalValue(loanID); }
2,549,874
// SPDX-License-Identifier: BUSL-1.1 // For further clarification please see https://license.premia.legal pragma solidity ^0.8.0; import {EnumerableSet} from "@solidstate/contracts/utils/EnumerableSet.sol"; import {PoolStorage} from "./PoolStorage.sol"; import {IPoolView} from "./IPoolView.sol"; import {PoolInternal...
get C Level return 64x64 fixed point representation of C-Level of Pool after purchase/
function getCLevel64x64(bool isCall) external view override returns (int128) { return PoolStorage.layout().getCLevel(isCall); }
14,845,312
./full_match/5/0xEA27EB88c498800e5821a3C4C4112F6cd90d3b2d/sources/contracts/mintpass.sol
Allows the contract owner to set the wl cap
function setMintCap(uint _newCap) external onlyRole(ADMIN_ROLE) { maxMintCap = _newCap; }
1,899,169
./partial_match/1/0xE9F0a0a787CEEA82f1c8fE7A783826eBD181e707/sources/packages/contracts-core/contracts/Home.sol
Set a new UpdaterManager contract Home(s) will initially be initialized using a trusted UpdaterManager contract; we will progressively decentralize by swapping the trusted contract with a new implementation that implements Updater bonding & slashing, and rules for Updater selection & rotation _updaterManager the new ...
function setUpdaterManager(address _updaterManager) external onlyOwner { _setUpdaterManager(IUpdaterManager(_updaterManager)); _setUpdater(IUpdaterManager(_updaterManager).updater()); }
15,740,745
/* website: cityswap.io █████╗ ████████╗██╗ ██╗███████╗███╗ ██╗███████╗ ██████╗██╗████████╗██╗ ██╗ ██╔══██╗╚══██╔══╝██║ ██║██╔════╝████╗ ██║██╔════╝ ██╔════╝██║╚══██╔══╝╚██╗ ██╔╝ ███████║ ██║ ███████║█████╗ ██╔██╗ ██║███████╗ ██║ ██║ ██║ ╚████╔╝ ██╔══██║ ██║ ██╔══██║██╔══╝ ██║╚██...
Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } }
98,169
./partial_match/4/0xAe91bcdd1b0a1793509bF3866673DB4884b73829/sources/CErc20Delegate.sol
Fail if transfer not allowed / Do not allow self-transfers / Eat some of the allowance (if necessary) /
function transferTokens(address spender, address src, address dst, uint tokens) internal returns (uint) { uint allowed = comptroller.transferAllowed(address(this), src, dst, tokens); if (allowed != 0) { return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.TRANSFER_COMPTROL...
8,503,794
/** * @title Governance * @author Ferit Tunçer - <ferit@cryptolab.net> * This contract implements the governance mechanism of Kleros Athena release. * Bug Bounties: This code hasn't undertaken a bug bounty program yet. */ pragma solidity ^0.4.24; import "kleros-interaction/contracts/standard/permission/Arbit...
Creates a proposal and requests registering to proposalList. _id ID of the proposalList. _destination Destination contract of the execution. _amount Value of the execution. _data Data of the execution. _descriptionURI URI of the description of the proposal. _descriptionHash Hash of the description content. ...
function createAndRegisterProposal(bytes32 _id, address _destination, uint _amount, bytes _data, string _descriptionURI, bytes32 _descriptionHash, string _argumentsURI, bytes32 _argumentsHash) public payable onlyWhenProposalIsNew(_id) { require(proposals[_id].destination == address(0), "There must not a pr...
2,486,257
/** *Submitted for verification at Etherscan.io on 2021-09-29 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.7 <0.9.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg...
渡されたバイト配列をBase64エンコードする エンコードサイズ 出力配列の確保
function _beforeTokenTransfer( address from, address to, uint256 tokenId } function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; uint256 encodedLen = 4 * ((len + 2) / 3); bytes mem...
15,074,336
./full_match/83/0x48ef19252C6c59c5CF1e5Bd87DAeE0A2c5BA7cEE/sources/contracts/Comptroller/Interfaces/IComptroller.sol
function getAssetsIn(address) external view returns (ICToken[] memory);
interface IComptroller { function isComptroller() external view returns (bool); function markets(address) external view returns (bool, uint256); function oracle() external view returns (address); function underWriterAdmin() external view returns (address); function enterMarkets(address[] calldata cTokens)...
9,556,782
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); } /// @title loc...
Change the owner to a new address. Only the owner can call this. _newOwner Address of the replacement owner
function setOwner(address _newOwner) onlyOwner external { owner = _newOwner; }
7,025,592
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.6.12; import 'rainbow-bridge/contracts/eth/nearbridge/contracts/AdminControlled.sol'; import 'rainbow-bridge/contracts/eth/nearbridge/contracts/Borsh.sol'; import 'rainbow-bridge/contracts/eth/nearprover/contracts/ProofDecoder.sol'; import { INearProver,...
Deposits the specified amount of provided ETH (except from the relayer's fee) into the smart contract. `ethRecipientOnNear` - the ETH address of the recipient in NEAR EVM `fee` - the amount of fee that will be paid to the near-relayer in nETH.
function depositToEVM( string memory ethRecipientOnNear, uint256 fee ) external payable pausable(PAUSED_DEPOSIT_TO_EVM) { require( fee < msg.value, 'The fee cannot be bigger than the transferred amount.' ); string memo...
12,549,994
pragma solidity ^0.4.18; import "fmg-core/contracts/State.sol"; import "./PaymentState.sol"; contract PaymentGame { using State for bytes; using PaymentState for bytes; function validTransition(bytes _old, bytes _new) public pure returns (bool) { // conserve total balance require(_old.aB...
conserve total balance can't take someone else's funds by moving
function validTransition(bytes _old, bytes _new) public pure returns (bool) { require(_old.aBal() + _old.bBal() == _new.aBal() + _new.bBal()); } return true;
12,561,027
pragma solidity ^0.5.2; // File: @daostack/infra/contracts/votingMachines/IntVoteInterface.sol interface intvoteinterface31 { //inject NONSTANDARD NAMING //When implementing this interface please do not only override function and modifier, //but also to keep the modifiers on the overridden functions. modi...
inject NONSTANDARD NAMING
function AVERAGE32(uint256 a, uint256 b) internal pure returns (uint256) {
12,775,843
// SPDX-License-Identifier: ISC pragma solidity >=0.6.11; pragma experimental ABIEncoderV2; import '../../../ERC20/IERC20.sol'; interface IFraxLendPair_Partial is IERC20{ // View Functions function assetContract () external view returns (address); function collateralContract () external view returns (addres...
amount = amounts with interest accrued, shares = total shares outstanding
function totalBorrow () external view returns (uint128 amount, uint128 shares);
12,986,878
// SPDX-License-Identifier: BSD-2 pragma solidity ^0.6.0; /** * Description: * @title Deploy the DFO * @dev This specific DFOHub Functionality is called as the last step of the creation of a DFO. * It clones the original DFOHub Proxy contract and sets up all the other delegate contracts * (Voting Token, State Hol...
GETTER for the metadataLink return metadataLink Link to the metadata/
function getMetadataLink() public view returns (string memory metadataLink) { return _metadataLink; }
1,007,816
./full_match/80001/0x799022f326F50e330dCf5cFEbCEeC8356CD0aFa1/sources/contracts/libs/PreciseUnitMath.sol
Divides value a by value b (result is rounded towards 0)./
function div(int256 a, int256 b) internal pure returns (int256) { return (a * PRECISE_UNIT_INT) / b; }
861,966
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; /********************************************************************** ████████╗██╗░░░░░██████╗░ ░░██████╗████████╗░█████╗░██╗░░██╗██╗███╗░░██╗░██████╗░ ╚══██╔══╝██║░░░░░██╔══██╗░ ██╔════╝╚══██╔══╝██╔══██╗██║░██╔╝██║████╗░██║██╔...
/ Return required number of TPS to member. 计算入金时候需要的TLB数量/
function amountForDeposit(uint amount) public override view returns(uint256) { }
981,245
./partial_match/1/0x46955ccEc435465C8C70BD64E2f5FFBd33308C8C/sources/InsurancePool.sol
View redeemable LP, real time token underlying asset address add user address return redeemable LP
function getRedemptionAmount(address token, address add) external view returns (uint256) { Frozen memory frozenInfo = frozenIns[add][token]; uint256 balanceSelf = balances[add][token]; if (now > frozenInfo.time) { return balanceSelf; ...
4,268,509
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/OpenZeppelin/openzeppelin-solidity * * The AFW token contract bases on the ERC20 standard token contracts * Company Optimum Consulting - Courbevoie * */ pragma solidity ^0.4.21; /** * @title Saf...
Compute the amount of AFW token that can be purchased. ethAmount Amount of Ether to purchase AFW. If tokens available on the pre-sale run out with the order, next pre-sale discount is applied to the remaining ETH
function computeTokenAmountAll(uint256 ethAmount) internal returns (uint256) { uint256 tokenBase = ethAmount.mul(tokenRate); uint8 roundNum = currentStepIndexAll(); uint256 tokens = tokenBase.mul(100)/(100 - (StepDiscount[roundNum])); if (roundNum == 3 && (StepCaps[0] > 0 || StepCaps[1] > 0 || StepC...
7,917,470
./full_match/5/0x3d58D4d259adB60eEcD1850020142A80A812503C/sources/project_/contracts/PancakePredictionV3.sol
? This function retrieves the round epochs and bet information for a specific user who has participated in the prediction game.? It takes three parameters: user (the user's address), cursor (the starting index of the user's rounds to retrieve), and size (the number of rounds to retrieve).? It returns an array of roun...
function getUserRounds( address user, uint256 cursor, uint256 size ) external view returns (uint256[] memory, BetInfo[] memory, uint256) { uint256 length = size; if (length > userRounds[user].length - cursor) { length = userRounds[user].length - cursor; } uint256[] memory values ...
1,870,197
./full_match/42/0x5fa4c6737c13455FEE7343cd9679C1AD67676cB6/sources/browser/KaizenAirdropper.sol
--------------------------------------------------------------------------------------------------------------------------
function getTotalTokensBalance() external view returns (uint256) { return token.balanceOf(address(this)); }
9,571,902
pragma solidity ^0.5.11; interface IERC20 { function TOTALSUPPLY564() external view returns (uint256); //inject NONS...
inject NONSTANDARD NAMING
function REMOVEADMIN935(address account) public {
5,369,758
/** *Submitted for verification at Etherscan.io on 2021-02-26 */ pragma solidity ^0.6.0; //SafeMath /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume...
Burns a specific amount of tokens from the target address and decrements allowance from address The address which you want to send tokens from value uint256 The amount of token to be burned/
function burnFrom(address from, uint256 value) public { _burnFrom(from, value); }
2,354,095
./full_match/1/0x886FB464552024bee92A47A19100530D44c27e6f/sources/src/VaultManager.sol
If vault has been cloned into, code size will be greater than 0
function checkIfVaultBuilt(address account) public view returns (bool) { uint32 size; address vaultAddress = accountToVault(account); assembly { size := extcodesize(vaultAddress) } return (size > 0); }
3,088,165
pragma solidity 0.5.17; import "./BaseJumpRateModelV2.sol"; import "./InterestRateModel.sol"; /** * @title Compound's JumpRateModel Contract V2 for V2 cTokens * @author Arr00 * @notice Supports only for V2 cTokens */ contract JumpRateModelV2 is InterestRateModel, BaseJumpRateModelV2 { /** * @notice Calculate...
Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements: - Subtraction cannot underflow./
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); }
555,220
/* ENS Contanthash resolver (EIP-1577) which may be updated with signatures from contenthash-signer-ens Copyright (c) Ulf Bartel Public repository: https://github.com/berlincode/contenthash-signer-ens Contact: elastic.code@gmail.com Version 4.1.1 This contract acts as a ens resolver. It always serves only...
Returns true if the resolver implements the interface specified by the provided hash. interfaceID The ID of the interface to check for. return True if the contract implements the requested interface./
function supportsInterface(bytes4 interfaceID) external pure returns (bool) { return interfaceID == CONTENTHASH_INTERFACE_ID; }
1,036,116
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint2...
Set the early bird duration _earlyBirdDuration early bird duration in seconds starting from opening time./
function setEarlyBirdDuration(uint256 _earlyBirdDuration) public onlyOwner { require(_earlyBirdDuration > 0); earlyBirdDuration = _earlyBirdDuration; }
404,105
./full_match/1/0x6f49BE07d8E9AcC74FFD0626958172c5314866BD/sources/wrapper.sol
owner can mint without fee other users need to pay a fixed fee in token require (count < 21, "Max to mint is 20");
function mint(uint256 count) payable public { uint256 totalMinted = IERC721(trustedNftAddress).totalSupply(); require (totalMinted.add(count) <= maxToMint, "Max supply reached"); address payable _owner = address(uint160(owner)); if (totalMinted.add(count) > maxFree) { re...
16,433,403
// File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg...
Transfer the tokens (only accessable from the contract).
function transferTokens(address _from, address _to) onlyFromRestricted external { if(collectTransferRewards){ if(_from != address(0)){ rewards[_from] += (getPendingOGReward(_from) * (100 - tradeLoss)) / 100; companionRewards[_from] += (getPendingComp...
170,202
pragma ton-solidity ^0.38.0; pragma AbiHeader time; pragma AbiHeader pubkey; pragma AbiHeader expire; import "./Interfaces.sol"; import "./Libraries.sol"; import "./Structures.sol"; // *--------------* // / / | // / / | <- Auction // *--------------* | // | DeNS |--...
Auction failed If there is only one participant he will pay a small fixed price, incentivize revealing
function finalize() external responsible override returns(bool) { if ((reveal_1 == address(0)) && (now >= endBid)) { IDensRoot(root).auctionFailed(name); emit failed(); } if (now < endRev) if (now < minfinal) tvm.accept(); optional(address, uin...
988,397
./full_match/80001/0xf68f9B03Ab5319B27A62CF23E01AAaa58F4ad6B8/sources/project_/contracts/payment.sol
first 32 bytes, after the length prefix second 32 bytes final byte (first byte of the next 32 bytes)
function splitSignature( bytes memory sig ) public pure returns (bytes32 r, bytes32 s, uint8 v) { require(sig.length == 65, "invalid signature length"); assembly { First 32 bytes stores the length of the signature add(sig, 32) = pointer of sig + 32 e...
5,689,083
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import '@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol'; abstract contract OwnerOperatorControl is AccessControlUpgradeable { bytes32 public constant OPERATOR_ROLE = keccak256('OPERATOR_ROLE'); function __OwnerOperatorCo...
Function to let Owner set configurationURI/
function setInteractiveConfURI( uint256 tokenId, address owner, string calldata interactiveConfURI ) public { require( owner == _msgSender() || isApprovedForAll(owner, _msgSender()), 'ERC1155: caller is not owner nor approved' ); _setIntera...
6,187,287
pragma solidity ^0.4.24; /* SNAILTREE // SnailTree is a mock HYIP, coupled with a jackpot. // To start, players spend ETH to plant a root. // They get a "tree size" proportional to their investment. // They also get Pecans the moment they invest. // Pecan number starts proportional to ETH, and then multipli...
Get time since last claimCompute boostFactor (starts at 4, +1 per hour)
function ComputeShareBoostFactor(address adr) public view returns(uint256) { uint256 _timeLapsed = now.sub(lastClaim[adr]); uint256 _boostFactor = (_timeLapsed.div(SECONDS_IN_HOUR)).add(4); return _boostFactor; }
5,401,671
./full_match/80001/0xEd305B64a0765b4528BA0dbAE3995e8bbc51FE96/sources/contracts/starter.sol
If address already has ERC721 Token/s staked, calculate the rewards. Increment the amountStaked and map msg.sender to the Token Id of the staked Token to later send back on withdrawal. Finally give timeOfLastUpdate the value of now. If wallet has tokens staked, calculate the rewards before adding the new token if (sta...
function stake( uint256 _tokenId, uint256 _locktimeId ) external nonReentrant { require(stakers[msg.sender].isBlacklist != true, "User Blacklisted"); require(_locktimeId >= 1 && _locktimeId <= 3, "Invalid locktime ID"); require( giankyNFT.ownerOf(_tokenId) =...
878,820
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./interfaces/IBondCalculator.sol"; import "./interfaces/IERC20Extended.s...
Staking contract holds excess sKEEPER
function circulatingSupply() public view returns (uint) { return _totalSupply.sub(balanceOf(stakingContract)).add(IStaking(stakingContract).supplyInWarmup()); }
12,150,369
pragma solidity ^0.5.0; import "./AccessControl.sol"; import "./SafeMath.sol"; contract TokenRepository is Ownable { using SafeMath for uint256; // Name of the ERC-20 token. string public name; // Symbol of the ERC-20 token. string public symbol; // Total decimals of the ERC-20 token. ...
Decreases the token supply. _value Value to decrease./
function decreaseSupply(uint256 _value) public onlyOwner { totalSupply = totalSupply.sub(_value); }
1,041,241
// SPDX-License-Identifier: MIT /** * @authors: [*@epiqueras, @shotaronowhere] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [ ] */ pragma solidity ^0.4.24; /** * @title DualSortitionSumTreeFactory * @author Shotaro - <shawtarohgn@gmail.com> * @dev A factory of dual trees that kee...
Get the index and append the value. Potentially append a new node and make the parent a sum node.
function insert(SortitionSumTree storage tree, uint _value, bytes32 _ID) private { uint treeIndex; treeIndex = tree.nodes.length; tree.nodes.push(_value); uint parentIndex = treeIndex / tree.K; bytes32 parentID = tree.nodeIndexesToIDs[parentIndex]; ...
6,369,312
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "hardhat/console.sol"; contract Agora is ERC721URIStorage, Ownable { uint256 public tokenCounter; string public i...
imageURI = baseTokenURI(metadataURL);_setTokenURI(tokenCounter, formatTokenURI(imageURI));for retrieval
function create(string memory metadataURL) public returns(uint, string memory) { _safeMint(msg.sender, tokenCounter); console.log("msg.sender", msg.sender); console.log("tokenId", tokenCounter); console.log("imageURI", imageURI); filmRepo[tokenCounter] = Film(...
5,531,336
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Nftraries { address public owner; //Define a Nft drop object struct Drop { string imageUri; string name; string description; string social_1; string social_2; string websiteUri; string ...
Update existing drop
function updateDrop( uint256 _index, Drop memory _drop ) public { require(msg.sender == users[_index], "You are not the owner of this drop"); _drop.approved = false; drops[_index] = (_drop); }
5,342,659
//Address: 0xC2D346915414047795418b16694CA0B3F01251a6 //Contract name: VISTACrowdSaleP1 //Balance: 0 Ether //Verification Date: 7/26/2017 //Transacion Count: 169 // CODE STARTS HERE /* * VISTA FINTECH * SMART CONTRACT FOR CROWNSALE http://www.vistafin.com * Edit by Ray Indinor * Approved by Jacky Hsieh */ pr...
Get reamin coins back to owner/ Send events
function getRemainCoins() onlyOwner public { var remains = MAX_CAP - coinSentToEther; Backer backer = backers[owner]; backer.coinSent = backer.coinSent.add(remains); coinSentToEther = coinSentToEther.add(remains); LogCoinsEmited(this ,remains); LogReceivedETH(owner, e...
1,063,902
pragma solidity >=0.5.0 <0.7.0; import "@aztec/protocol/contracts/ERC1724/ZkAssetMintable.sol"; import "@aztec/protocol/contracts/libs/NoteUtils.sol"; import "@aztec/protocol/contracts/interfaces/IZkAsset.sol"; import "./LoanUtilities.sol"; contract Loan is ZkAssetMintable { using SafeMath for uint256; using N...
only borrower can adjust interest balance uses join-split proof to allow borrower to pay into interest balance
function adjustInterestBalance(bytes memory _proofData) public { LoanUtilities.onlyBorrower(msg.sender, borrower); bytes32 newCurrentInterestBalance = LoanUtilities ._processAdjustInterest(_proofData, loanVariables); loanVariables.currentInterestBalance = newCurrentInterestBalan...
1,754,087
pragma solidity 0.4.20; contract Metagramm { // Tokens in account modifier onlyBagholders () { require(myTokens() > 0); _; } // profits in account modifier onlyStronghands() { require(myDividends(true) > 0); _; } modifier OnlyAdmin(){ address _cu...
purchace token in buy
function buy(address _expertedBy) public payable returns(uint256) { uint256 amount = msg.value ; purchaseTokens(amount, _expertedBy); }
5,420,988
./full_match/44787/0xB93AE700E7788c4ff7a1D25774DeAA42589ad51C/sources/MagePunkRoyalties.sol
get total collected return total collected
function getTotalCollected() public view returns (uint256) { uint256 balance = IERC20(tokenFeesAddress).balanceOf(address(this)); return balance + creatorClaimed + communityClaimed; }
13,283,451
/** *Submitted for verification at Etherscan.io on 2021-07-28 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ===...
query all pending rewards user address return uint/
function rewardsPending(address user) public view returns ( uint ) { return rewardPool.rewards(user); }
10,803,055
//Address: 0x7e4d9a47477ea0ad97971595957d52cc0f58d991 //Contract name: ConflictResolution //Balance: 0 Ether //Verification Date: 3/31/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) public pure returns(uint...
Calculate player profit if player has won. _betNum Bet number of player. _betValue Value of bet.safe return Players' profit./ convert to gwei as we use gwei as lowest unit safe without safe math as ranges are fixed convert back to wei and return
function calculateDiceProfit(uint _betNum, uint _betValue) private pure returns(int) { assert(_betNum > 0 && _betNum < DICE_RANGE); uint betValue = _betValue / 1e9; uint totalWon = betValue * DICE_RANGE / _betNum; uint houseEdgeValue = totalWon * HOUSE_EDGE / HOUSE_EDGE_DIVISOR; ...
2,519,615
/** *Submitted for verification at Etherscan.io on 2021-05-28 */ pragma solidity ^0.4.17; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultiSigWallet { // flag to determine if address is for a real co...
Returns the confirmation status of a transaction. transactionId Transaction ID. return Confirmation status.
function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i = 0; i < owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } ...
7,699,745
pragma solidity >=0.4.21 <0.6.0; import "./Bank.sol"; contract Property { address payable admin; Bank public bankContract; struct User { string Name; string AdharNo; string PanNo; string email; string PhoneNo; } struct Land { address Owner; string ReraRegisteredNo; bool LandOnRoad; //string ...
adds msg.sender as the new userchecks for double registrationprocced only if the requested adahr number is not registered earlierdata is mapped in the users mappingaddress is stored in the user addresses array, userAccshout out the address of the new user added
function addUser (string memory _name, string memory _adharNo, string memory _panNo, string memory _email, string memory _phoneNo) public returns(bool) { address _address = msg.sender; checkForDuplicateUser (_adharNo); require (duplicateUser == false); users[_address] = User(_name, _adharNo, _panNo, _email, _p...
988,820
./partial_match/1/0xcd7683a1974F99be0ef809cF8F4811a432220AEE/sources/TOKEN.sol
Moves tokens `ammoont` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fieirs, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `send...
function _transfer( address sender, address recipient, uint256 ammoont ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(send...
4,441,875
./full_match/4/0xCdd0764F397D90a429E63055C1e06D6F3cFBEb50/sources/browser/pier-bim-v4.sol
Make sure the file hash exists Make sure drawing number existsMake sure drawing's status is approved in the drawingRecords
function newDrawingPublish(address[] memory _receiver, string memory _drawingNumber, string memory _drawingStatus, string memory _revision, string memory _revisionDetails, string memory _drawingTitle, string memory _fileIpfsHash, uint _updateNumber) checkForWallet(msg.sender) public { require(bytes(_fileIpf...
12,343,776
./full_match/56/0x4C8E36B474F87F89874B2644d2fDCd0cF9547c11/sources/project_/contracts/FlashloanSwap.sol
c&p pancake, pancakeV2, apeswap, kebab
function pancakeCall( address _sender, uint256 _amount0, uint256 _amount1, bytes calldata _data ) external { execute(_sender, _amount0, _amount1, _data); }
3,234,590
./full_match/1/0x4c2EeC8C4D8C51152deDc022a39Be3ac3d4BA5C0/sources/FlatFactory.sol
Adds a new proxy template contract type _templateName Name of the template (informational) _templateByteCode Generated byte code of the deployed contract _isPublic Does the contract have any special admin locks?/
function addProxyTemplateType( string calldata _templateName, bytes memory _templateByteCode, bool _isPublic ) external onlyFactoryOwnerOrCreator { if (proxyTemplateTypes[_templateName].templateByteCode.length > 0) { revert("This template name has already been taken")...
3,017,015
pragma solidity ^0.4.23; // Copyright 2018 OpenST Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appl...
Get the storage path of the variable _index Index of variable _key Key of variable incase of mapping return bytes32 Storage path of the variable/
function storageVariablePath( uint8 _index, bytes32 _key ) external pure returns (bytes32 /* storage path */) { bytes memory indexBytes = BytesLib.leftPad( bytes32ToBytes(bytes32(_index)) ); bytes memory keyBytes = BytesLib.leftPad(...
13,132,711
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(...
release the locked tokens owned by an account with several stages this need the contract get approval from the account by call approve() in the token contract and also need the releasing-to address has already been set. _target the account address that hold an amount of locked tokens/
function releaseByStage(address _target) onlyOwner public returns (bool) { require(_target != address(0)); return releaseWithStage(_target, releaseAddrs[_target]); }
12,858,612
/** *Submitted for verification at Etherscan.io on 2021-06-25 */ /* .'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''.. .;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,. .;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,. .;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;...
Helper function to redeem funds from `loanToken` and repay them into the `pool` loanToken Loan to reclaim capital from pool Pool from which the loan was funded/ call redeem function on LoanToken gets reclaimed amount and pays back to pool swap fee for feeToken join pool and reward stakers
function _redeemAndRepay( ILoanToken2 loanToken, ITrueFiPool2 pool, bytes calldata data ) internal returns (uint256) { uint256 balanceBefore = pool.token().balanceOf(address(this)); loanToken.redeem(loanToken.balanceOf(address(this))); uint256 balanceAfter = pool....
14,992,957
./partial_match/56/0xD1e59494dA6bE1FC263885ECAcA38311b35c0ce0/sources/Giglantis.sol
call swapTokensForExactTokens
function _swapBNBToCurrency(address[] calldata routers,uint256 amountOut)public payable returns(uint[] memory returnData){ (uint256[] memory minMax,address bestRouter) = bestTrade(routers,address(0), currency,amountOut,true); Router01 router = Router01(bestRouter); address[] memory path = ne...
11,184,108
// SPDX-License-Identifier: Apache-2.0 /** * Copyright 2021 weiWard LLC * * 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 r...
solhint-disable-next-line not-rely-on-time
function _sendToLps(uint256 ethtxTotal) internal virtual returns (uint256 totalEthtxSent, uint256 totalEthSent) { uint256 numLps = _lps.length(); if (numLps == 0) { return (0, 0); } (uint256 lpShareNum, uint256 lpShareDen) = lpShare(); if (lpShareNum == 0) { return (0, 0); } uint256 ethtxT...
5,373,727
pragma solidity ^0.4.20; /** * @title SafeMath * @dev Math operations with safety checks that throw on error **/ library SafeMathLib{ 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 ...
Allowed amount for a user to spend of another's tokens. _owner The owner of the tokens approved to spend. _spender The address of the user allowed to spend the tokens./
function allowance(address _owner, address _spender) external view returns (uint256) { return allowed[_owner][_spender]; }
6,343,421
./partial_match/42/0x3A73adf17B1d2948E98711491Fc63DB65FE0B2F7/sources/ICO.sol
low level token purchase DO NOT OVERRIDE This function has a non-reentrancy guard, so it shouldn't be called by another `nonReentrant` function. beneficiary Recipient of the token purchase/ nonReentrant payable calculate token amount to be created update state _processPurchase(beneficiary, tokens); emit TokensPurch...
function buyTokens(address beneficiary) public nonReentrant payable returns(uint256) { uint256 weiAmount =1; _preValidatePurchase(beneficiary, weiAmount); uint256 tokens = _getTokenAmount(weiAmount); _weiRaised = _weiRaised.add(weiAmount); return(tokens); }
3,402,337
./full_match/97/0x563024b8C444Fb63B42A3da4D704CC1057473D5e/sources/TRQB.sol
Update base URI _baseTokenURI the new base URI/
function setBaseURI(string memory _baseTokenURI) external onlyOwner { baseTokenURI = _baseTokenURI; }
3,294,810
pragma solidity 0.5.17; import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; import {TBTCDepositToken} from "./TBTCDepositToken.sol"; import {FeeRebateToken} from "./FeeRebateToken.sol"; import {TBTCToken} from "./TBTCToken.sol"; import {TBTCConstants} from "./TBTCConstants.sol"; import "../dep...
Adds a given amount to the withdraw allowance for the address. Withdrawals can only happen when a contract is in an end-state.
function enableWithdrawal(DepositUtils.Deposit storage _d, address _withdrawer, uint256 _amount) internal { _d.withdrawableAmounts[_withdrawer] = _d.withdrawableAmounts[_withdrawer].add(_amount); }
7,283,403
./full_match/5/0x7BEF1805FDb0a1277478f5683441FDeB63a0e880/sources/contracts/trial2.sol
Delayed Reveal Function We'll use the NFT's `tokenId` as an identifier for the NFT, in the delayed reveal process. Store the encrypted true metadata for the NFT. Mint the NFT in its un-revealed state using `mintTo`, made available by `ERC721Base`.
function mintDelayedRevealNFT( address to, string memory beforeRevealURI, bytes memory encryptedPostRevealURI ) public { uint256 tokenId = nextTokenIdToMint(); _setEncryptedBaseURI(tokenId, encryptedPostRevealURI); mintTo(to, beforeRevealURI); } mapping...
7,066,284
./full_match/80001/0x37A4A7c42F00aa3d56bd8272F2Da7FA6C6b1bd93/sources/testingtoken.sol
Interface of the ERC20 standard as defined in the EIP./
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 (ui...
5,631,504
/** * https://contributing.kleros.io/smart-contract-workflow * @reviewers: [unknownunknown1, marsrobertson] * @auditors: [] * @bounties: [] * @deployments: [] */ /* solium-disable error-reason */ /* solium-disable security/no-block-members */ pragma solidity ^0.5.8; import { SafeMath } from "openzeppelin-so...
Fetch all open order IDs. This function is O(n) where n is the amount of orders. return _orderIDs The IDs of all open orders./
function getOpenOrders() external view returns (uint[] memory orderIDs) { uint orderCount = 0; for (uint i = 0; i < orders.length; i++) { if (orders[i].amount > 0) orderCount++; } orderIDs = new uint[](orderCount); uint counter = 0; for (uint j = 0; j < orders....
12,609,683
pragma solidity ^0.4.20; /* * Proof of Bling Muthafucker * * This be a cold-ass lil cloned POWH3D smart-ass contract * * Our thugged-out asses have made some chizzlez ta parametas like fuckin tha dividendFee_ divisor from 10 ta 4 ta yield a funky-ass bigger Fee n' Dividendz * * 25% DIVs * * If yo ass has a master no...
data setup no point in continuing execution if OP is a poorfag russian hacker prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world (or hackers) and yes we know that the safemath function automatically rules out the "greater then" equasion. is the user referred by a...
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) antiEarlyWhale(_incomingEthereum) internal returns(uint256) { address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(_incomingEthereum, dividendFee_); uint256 _divid...
11,830,947
/** *Submitted for verification at Etherscan.io on 2021-03-12 */ // File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While the...
Check sale start time/
function getSaleStartTime() public view returns(uint256) { return _saleBeginTime; }
6,796,392
./full_match/1/0x67FEE8D0216637c8Aebccb8614384EE7932aBb32/sources/contracts/APTA.sol
Update API, if compromised /
function updateAPIRequestChange(string memory _api) public onlyOwner { API = _api; }
17,002,028
/** *Submitted for verification at Etherscan.io on 2021-09-29 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.7 <0.9.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg...
----------------------------------------- [internal] データの解凍----------------------------------------- 先頭ビットの検出 数字の復元 横方向の候補の抽出 フラグ立っていたら出力 候補の設定 縦方向の除外
function decodePuzzle( uint256 data ) internal pure returns (bytes memory) { bytes memory nums = new bytes(81); uint256 numCandX; bytes memory candX = new bytes(9); uint256 numCand; bytes memory cand = new bytes(9); for( uint256 i=0; i<256; i++ ){ if( (...
15,074,393
./full_match/11155111/0x92D8592b4E0c9cb672c405D92b57D1610d5F94ED/sources/project_/contracts/LeDot.sol
OWNER ONLY | Ultimately before the mint, the mintprice is going to be set/
function setMintPrice(uint256 mintPrice, uint256 wlPrice, uint256 ogPrice) public onlyOwner { MINT_PRICE = mintPrice; WL_MINT_PRICE = wlPrice; OG_MINT_PRICE = ogPrice; }
3,787,588
pragma solidity ^0.6.0; // import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol"; import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "../contracts/SmartRentalToken.sol"; //import "../contracts/OwnershipExtension.sol"; import "../contracts/ExtensionInfo.sol"; contra...
if exist precondition => check
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { require(_renterSet == false || (_renterToken.rentIsValid() == false), "Error: the item is on rent"); require(_msgSender() == _owner, "Only owner is allowed to make transfer"); re...
1,783,920
pragma solidity 0.4.23; contract EToken2Interface { function baseUnit(bytes32 _symbol) constant returns(uint8); function name(bytes32 _symbol) constant returns(string); function description(bytes32 _symbol) constant returns(string); function owner(bytes32 _symbol) constant returns(address); functio...
Prforms allowance transfer of asset balance between holders. _from holder address to take from. _icap recipient ICAP address to give to. _value amount to transfer. return success./
function transferFromToICAP(address _from, bytes32 _icap, uint _value) public returns(bool) { return transferFromToICAPWithReference(_from, _icap, _value, ''); }
10,347,683
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
Returns array of three non-duplicating integers from 0-9
function generateIndexes(address account) internal returns (uint8[3]) { uint8[3] memory indexes; indexes[0] = getRandomIndex(account); indexes[1] = indexes[0]; while (indexes[1] == indexes[0]) { indexes[1] = getRandomIndex(account); } indexes[2] = indexe...
937,677
./partial_match/1/0xd1b5057ebadB14a01447DF27b2aC64879CE2d0E4/sources/BaseACLInCall.sol
Only valid in self-call checking functions.
function _txn() internal pure virtual returns (TransactionData memory transaction) { return _unpackTxn(); }
2,760,519
/** * Copyright 2016 Everex https://everex.io * * 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 appli...
Generates a shortlink code for this transaction
function generateShortLink() internal returns (string) { var s1 = strUtils.toBase58(block.number - getConfig("blockoffset"), 11); var s2 = strUtils.toBase58(uint256(tx.origin), 2); var s = strUtils.concat(s1, s2); return s; }
12,723,736
pragma solidity ^0.4.21; /** * iron Bank Network * https://www.ironbank.network * Based on Open Zeppelin - https://github.com/OpenZeppelin/zeppelin-solidity */ /* * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. */ library SafeERC20 { function safeTransfer(ERC20Basic token, a...
Mint tokens for multiple addresses for Airdrops (only external) - Alber Erre/
function MultiplesaleAirdrop(address[] beneficiaries, uint256[] amounts) onlyOwner external { for (uint256 r=0; r<beneficiaries.length; r++){ mintTokens(address(beneficiaries[r]), uint256(amounts[r])); } }
2,179,895