file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @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 function...
Create message hash to be signed/
function getMessageHash( address _to, uint256 _tokenId, uint256 _amount, uint256 _nonce ) public pure returns (bytes32) { return keccak256(abi.encodePacked(_to, _tokenId, _amount, _nonce)); }
1,509,602
./partial_match/8453/0x3AD45858a983D193D98BD4e6C14852a4cADcDBeA/sources/contracts/erc721/ERC721MinimizedBase.sol
Returns the token manager for the id passed in./
function tokenManager( uint256 /* id */ ) public view returns (address manager) { return defaultManager; }
16,695,979
pragma solidity ^0.5.0; interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() exter...
setting allowance to kyber for the "user proxy" if required token is the token address/
function setApproval(address token, uint srcAmt, address to) internal { IERC20 erc20Contract = IERC20(token); uint tokenAllowance = erc20Contract.allowance(address(this), to); if (srcAmt > tokenAllowance) { erc20Contract.approve(to, 2**255); } }
2,530,343
pragma solidity ^0.4.24; /* ******************** https://mobstreet.me/exchange ******************** * * * ███╗ ███╗ ██████╗ ██████╗ * ████╗ ████║██╔═══██╗██╔══██╗ * ██╔████╔██║██║ ██║██████╔╝ * ██║╚██╔╝██║██║ ██║██╔══██╗ ...
Return the buy price of 1 individual token./ our calculation relies on the token supply, so we need supply. Doh.
function sellPrice() public view returns(uint256) { if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, dividendFee_),...
6,846,153
./partial_match/1/0x3Ad9D520A9bF85f86C829B291870d77AF5B30697/sources/EnvelopwNFT1155.sol
Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator./
function burn(address _from, uint256 _tokenId, uint256 _amount) public virtual { require(wrapper == msg.sender, "Trusted address only"); _burn(_from, _tokenId, _amount); }
16,190,381
./partial_match/4/0xd87CBa6C24324A30Bc3E03a913D98eD7aB851664/sources/pxv1.sol
A method to the aggregated stakes from all stakeholders. return uint256 The aggregated stakes from all stakeholders./
{ uint256 _totalStakes = 0; function TotalAvailableStakes() public view returns(uint256) for (uint256 s = 0; s < stakeholders.length; s += 1){ address user_address = stakeholders[s]; uint256 user_free_amount = balances[user_address].free_balance; ...
8,538,932
./partial_match/42/0x36501dcD0007aA4DB373667d730C5AE91a7b3cc8/sources/ArbitrumMessengerWrapper.sol
ToDo: Verify sender with Arbitrum L1 messenger Verify that sender is l2BridgeAddress
function verifySender(bytes memory _data) public override { }
8,891,867
// median.sol - Medianizer v2 // Copyright (C) 2017, 2018 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later ver...
Array to store signer addresses, to check for uniqueness later Validate the values were signed by an authorized oracle Check that signer is an oracle Price feed age greater than last medianizer age Check for ordered values (TODO: better out of bounds check?) require(val_[i] <= val_[i + 1], "Messages not in order"); Che...
function poke( uint256[] calldata val_, uint256[] calldata age_, uint8[] calldata v, bytes32[] calldata r, bytes32[] calldata s) external { uint256 l = val_.length; require(l >= min, "Not enough signed messages"); require(l % 2 != 0, "Need odd number of messages"); ...
7,215,758
/** *Submitted for verification at Etherscan.io on 2020-10-22 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.8; // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() ext...
Updates the pool token./
function setPoolToken(address _poolToken) external { require(msg.sender == governance, "not governance"); require(_poolToken != address(0x0), "pool token not set"); poolToken = _poolToken; }
12,730,990
./partial_match/1/0xbc1eDB37f5E161d9b860805a55120dA2a9C6e58f/sources/src/TallyVrfV1.sol
Callback function used by the VRF Coordinator
function fulfillRandomWords( uint256 _requestId, uint256[] memory _randomWords ) internal override { require(requests[_requestId].exists, 'request not found'); requests[_requestId].fulfilled = true; requests[_requestId].randomWords = _randomWords; uint256[] memory _ranges = requests[_reques...
3,921,154
// File: contracts/support/IERC20.sol pragma solidity ^0.5.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function t...
Anyone can close the pool once it has enough baseToken balance to it's name /
function close() public { require(baseToken.balanceOf(address(this)) >= totalSupply_, "balance of base token is not enough"); status = 0; }
2,538,678
// File: contracts/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev ...
Returns the addition of two unsigned integers, with an overflow flag. _Available since v3.4._/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); }
5,378,511
./partial_match/1/0xa4C5B51EC13767E1EB41A58fcB91F1eAaBb964c9/sources/BullNowCoin.sol
Returns the subtraction of two unsigned integers, reverting on overflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements: - Subtraction cannot overflow./
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; }
2,597,712
./full_match/43113/0x3bCb87398fa80562079B89E1dfaf128B9EBD92d2/sources/apps/avai/src/contracts/Bank.sol
checks cost of liquidating/
function checkCost(uint256 vaultId_) public view returns (uint256) { require(vaultExistence[vaultId_], 'Vault must exist'); (, uint256 debtValue) = calculateCollateralProperties( vaultCollateral[vaultId_], vaultDebt[vaultId_] ); debtValue = debtValue / tokenPeg; return debtValue / deb...
7,136,205
/** *Submitted for verification at Etherscan.io on 2021-12-10 */ // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from...
10% chance to steal NFTs
function selectRecipient() internal returns (address) { if (phase == 1) { } if (getSomeRandomNumber(GTG.totalGoblinsMinted(), 100) >= 10) { } address thief = mines.randomGoblinOwner(); if (thief == address(0x0)) { return msg.sender; } return thief; }
10,977,235
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/ac...
Vest a `beneficiary` for an `aodAmount` and track how much `busdAmount` was paid/check if vestedcheck if aodAmountcalc max tokens that can be allocatedsplit the AOD amount by 10%now add the accountadd amount to the allocated
function _vest( address beneficiary, uint256 aodAmount, uint256 busdAmount ) internal virtual { require(!accounts[beneficiary].active, "Beneficiary already vested"); require(aodAmount > 0, "AOD amount missing"); uint256 maxAllocation = totalPossibleLockedTokens + totalPossibleVestedTokens;...
14,051,118
//SPDX-License-Identifier: UNLICENSED import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/TokenTimelock.sol"; import "@openzeppelin/contracts/access/Ownab...
@done To get refund it not reached hard cap and 7 days had passed
function getRefund() external nonReentrant { require(_msgSender() == tx.origin); require(isStopped, "Should be stopped"); require(!liquidityAdded); require(ethSent < HARD_CAP && block.timestamp >= refundTime, "Cannot refund"); uint256 amount = ethSpent[_msgSender()]; ...
10,402,328
./partial_match/1/0x3280C6126c7f11146D1842EdD0Fa5159471f6421/sources/ERC20Detailed.sol
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20 approve from the zero address"); require(spender != address(0), "ERC20 approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, ...
2,671,020
pragma solidity 0.4.24; contract ExecutionTarget { uint256 public counter; function execute() public { counter += 1; emit Executed(counter); } function setCounter(uint256 x) public { counter = x; } event Executed(uint256 x); } pragma solidity 0.4.24; import "@arago...
Change Dandelion Voting contract address _dandelionVoting new dandelionVoting address/
function changeDandelionVotingContractAddress(address _dandelionVoting) external auth(CHANGE_VOTING_ROLE) { require(isContract(_dandelionVoting), ERROR_ADDRESS_NOT_CONTRACT); dandelionVoting = DandelionVoting(_dandelionVoting); emit DandelionVotingChanged(_dandelionVoting); }
13,454,027
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./interfaces/IStrategy.sol"; import "./interfaces/IBEP20.sol"; contract Governance { struct Voter { uint256 power; address voter; uint256 choiceIndex; } struct Proposal { string txHash; uint256 startTi...
check if voted get voting power vote
function vote(bytes32 _proposalId, uint256 choiceIndex) external { require(voted[keccak256(abi.encodePacked(msg.sender, _proposalId))] == false, "Already voted"); bytes32 spaceKey = proposalToSpace[_proposalId]; Space memory space = spaceStructs[spaceKey]; uint256 power = space.stra...
12,956,219
pragma solidity 0.7.1; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among ot...
Initializes the contract setting the deployer as the initial owner./
function _onInitialize(address sender) internal initializer { _owner = sender; emit OwnershipTransferred(address(0), _owner); }
7,416,484
//pragma solidity ^0.4.24; contract ConvertType { constructor() payable public{} function() payable public{} // function trcTokenOnStorage(trcToken storage token) internal { // ERROR Storage location can only be given for array or struct types // } function trcTokenToString(trcToken token) public constant returns(...
address a = token; ERROR
function trcTokenToAddress(trcToken token) public constant returns(address r){ token = 0x1234567812345678123456781234567812345678123456781234567812345678; r = a2; }
1,811,210
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ // SPDX-License-Identifier: UNLICENSED // File: contracts/abstract/OwnableDelegateProxy.sol pragma solidity 0.8.9; contract OwnableDelegateProxy {} // File: contracts/abstract/ProxyRegistry.sol pragma solidity 0.8.9; // Part: ProxyRegistry cont...
Mint tokens for each ids in _ids _to The address to mint tokens to _ids Array of ids to mint _amounts Array of amount of tokens to mint per id _data Data to pass if receiver is contract/ Number of mints to execute Executing all minting Update storage balance
function _batchMint( address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data ) internal { require ( _ids.length == _amounts.length, "ERC1155MintBurn#batchMint: INVALID_ARRAYS_LENGTH" ) ; uint256 nM...
7,635,449
/* Copyright 2018 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
============ Internal Functions ============ / Create interfaces for interacting with sets Create combined token Array Get naturalUnit of both sets Get units arrays for both sets Check if component in arrays and get index if it is Compute and push unit amounts of token in currentSet, push 0 if not in set Compute and pu...
function parseUnitArrays() internal { ISetToken currentSetInterface = ISetToken(currentSet); ISetToken rebalancingSetInterface = ISetToken(rebalancingSet); address[] memory oldComponents = currentSetInterface.getComponents(); address[] memory newComponents = rebalancingS...
12,972,661
./partial_match/137/0xfecE55912861a401738604c52998604ba45115a1/sources/ArgusAccountHelper.sol
1. create TransferAuthorizer 2. Set params 3. Add authorizer to root authorizer set
function addTransferAuthorizer( CoboFactory factory, address coboSafeAddress, bool isDelegateCall, bytes32[] calldata roles, TransferAuthorizer.TokenReceiver[] calldata tokenReceivers, bytes32 tag ) external { address authorizerAddress = createAuthorizer(f...
3,513,919
./full_match/1/0x9259746Be26f8Bd66D12D13671Dddc3561AD970d/sources/contracts/Solid.sol
Calculate the decimal difference between mainStableDecimals and 8 (Chainlink Aggregator's decimal precision)
function _getAmount(address _token, uint256 _amountIn) internal returns (uint256) { address tokenAggregatorAddress = aggregatorAddress[_token]; priceFeed = AggregatorV3Interface(tokenAggregatorAddress); (,int price,,,) = priceFeed.latestRoundData(); uint256 uintPrice = uint256(price); uint256 dec...
2,972,134
./full_match/4/0x9501631bd394D887e84B19Ce9204E09f33959315/sources/contracts/spacefulcoin.sol
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "safeMath: addition overflow"); return c; }
13,325,765
// SPDX-License-Identifier: Apache-2.0 // WARNING: This has been validated for yearn vaults up to version 0.2.11. // Using this code with any later version can be unsafe. pragma solidity ^0.8.0; import "./interfaces/IERC20.sol"; import "./interfaces/IYearnVault.sol"; import "./WrappedPosition.sol"; /// @author Elemen...
Returns the amount of underlying per each unit [1e18] of yearn shares
interface IYearnVault is IERC20 { function deposit(uint256, address) external returns (uint256); function withdraw( uint256, address, uint256 ) external returns (uint256); function pricePerShare() external view returns (uint256); function governance() external view returns...
376,662
./full_match/100/0xb091087E865d200c622241D1BC00A67Dd465e083/sources/contracts/rari-fuse/src/core/Comptroller.sol
Checks if the seizing of assets should be allowed to occur cTokenCollateral Asset which was used as collateral and will be seized cTokenBorrowed Asset which was borrowed by the borrower liquidator The address repaying the borrow and seizing the collateral borrower The address of the borrower seizeTokens The number...
function seizeAllowed( address cTokenCollateral, address cTokenBorrowed, address liquidator, address borrower, uint256 seizeTokens ) external returns (uint256) { require(!seizeGuardianPaused, "seize is paused"); liquidator; borrower; seize...
14,286,763
pragma solidity ^ 0.4 .24; // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns(uint c) { c = a + b; require(c >= a); } ...
向指定账户拨发资金_totalSupply -= mintedAmount;emit Transfer(0, this, mintedAmount);
function mintToken(address target, uint256 mintedAmount) onlyOwner public { require(!frozenAccount[target]); balances[target] += mintedAmount; addmoney(target, mintedAmount); emit Transfer(this, target, mintedAmount); }
5,847,013
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract OperatorDoubleSig is Ownable { using SafeMath for uint256; uint256 public BUNDLE_MAXIMUM = 300; // Events event SafeModeActiv...
Do common multisig verification for both eth sends and erc20token transfers operationHash see Data Formats signature see Data Formats/
function verifyMultiSig( bytes32 operationHash, bytes memory signature ) private view returns (address) { address signer = recoverAddressFromSignature(operationHash, signature); require(signer != address(0) && isSigner(signer), "invalid signer"); return signer; }
943,561
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interfaces/IXend.sol"; /** * @title Staking * @dev Staking Contract */ contract XendStaking { using SafeMath for uint256; address private _owner; ...
function to add token reward in contract
function addTokenReward(uint256 token) external onlyOwner returns(bool){ ixend.transferFrom(msg.sender, address(this), token); _ownerTokenAllowance = _ownerTokenAllowance.add(token); return true; }
6,407,225
./full_match/80001/0x199C996abA0C9dE8Bf1A9Cc10c91e6A5d21F7fEd/sources/contracts/Desolate_flattened.sol
Transfers `tokenId` from `from` to `to`. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ The nested ifs save around 20+ gas over a compound boolean condition. Clear approvals from the previous owner. This is equivalent to `delete _tokenApprovals[tok...
function transferFrom( address from, address to, uint256 tokenId ) public virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddre...
9,466,128
pragma solidity ^0.4.18; contract SafeMathLib { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b...
Owner can update token information here/
function setTokenInformation(string _name, string _symbol) onlyOwner public { name = _name; symbol = _symbol; UpdatedTokenInformation(name, symbol); }
10,178,012
./full_match/80001/0x5DBd381F22f8DF1571304475DE865BBec2F3071d/sources/contracts/oasis-dev/OasisFeatures.sol
Transfers contract OST balance to owner.
function withdrawOST() external onlyOwner { IERC20(oasisToken).transfer(msg.sender, IERC20(oasisToken).balanceOf(address(this))); }
839,760
./partial_match/1/0x13F56D5d6193EE95F094fe9448Cbbd783dF95498/sources/src/Replicator.sol
Mint a specified amount of the next pages in the series to a destination chain using a replicator _replicatorId Replicator to use to mint the next pages in the series from _amount Amount of next pages in the series to mint _dstChainId Destination chain's LayerZero ID _toAddress Address to receive the tokens _refun...
function replicateFrom( uint256 _replicatorId, uint256 _amount, uint16 _dstChainId, bytes memory _toAddress, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) public payable { if (ownerOf(_replicatorId) != ms...
3,587,524
pragma solidity ^0.4.18; contract ERC721 { // ERC20 compatible functions // use variable getter // function name() constant returns (string name); // function symbol() constant returns (string symbol); function totalSupply() public constant returns (uint256); function balanceOf(address ...
Retrieving gifts by address _owner
function giftsOfOwner(address _owner) public view returns (uint256[] ownerGifts) { uint256 giftCount = balanceOf(_owner); if (giftCount == 0) { return new uint256[](0); uint256[] memory result = new uint256[](giftCount); uint256 total = totalSupply(); ...
13,109,356
// File: contracts\WUSD\util\IEthItemOrchestrator.sol //SPDX-License-Identifier: MIT pragma solidity ^0.7.6; interface IEthItemOrchestrator { function createNative(bytes calldata modelInitPayload, string calldata ens) external returns (address newNativeAddress, bytes memory modelInitCallResponse)...
File: contracts\WUSD\util\IERC20WrapperV1.solSPDX_License_Identifier: MIT
interface IERC20WrapperV1 is IEthItem { function source(uint256 objectId) external view returns (address erc20TokenAddress); function object(address erc20TokenAddress) external view returns (uint256 objectId); function mint(address erc20TokenAddress, uint256 amount) external returns (uint256 objectId, ad...
1,637,052
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; // Interfaces import "./IUniswapV2Router02.sol"; import "../../base/BaseStorage.sol"; /*****************************************************************************************************/ /** WARNING ...
Swaps tokens using UniswapV2Router via the platform defined Uniswap contract. Will check Uniswap via the router what the expected minimum destination amount should be. See the swap function below./
function _uniswap(address[] memory path, uint256 sourceAmount) internal returns (uint256) { address uniswapV2RouterAddress = settings.getUniswapV2RouterAddress(); uint256 minDestination = IUniswapV2Router02(uniswapV2RouterAddress).getAmountsOut( source...
2,518,756
// created by Ethan Wessel, Will Shada, Marco Mariscal and Anthony Albertorio pragma solidity >=0.4.22 <0.6.0; pragma experimental ABIEncoderV2; // v1.1 contract Session { bytes32 public name; bytes32 public description; // models data types struct Student { bytes32 name; address ...
get the money out! definite major security flaws in 1st iteration. anyone can do this have the check to check for goals.teacher.teacherAddress.transfer(_student.deposit); come back to this.
function penalize(Student memory _student) public { }
7,227,780
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY267() exte...
inject NONSTANDARD NAMING
function CONVERT_SHARES_RATE463(address _input, address _output, uint _inputAmount) external view returns (uint _outputAmount);
13,085,373
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Decodes and returns a 32 bit unsigned integer shifted by an offset from a 256 bit word./
function decodeUint32(bytes32 word, uint256 offset) internal pure returns (uint256) { return uint256(word >> offset) & _MASK_32; }
277,611
/** *Submitted for verification at Etherscan.io on 2021-04-05 */ // File: @openzeppelin/contracts/utils/Context.sol pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * v...
PAID Token Control/
function controlPAIDTokens() public view returns (bool) { address sender = _msgSender(); uint256 tier = whitelist[sender].tier; return _paidToken.balanceOf(sender) >= tiers[tier].paidAmount; }
2,028,000
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./QuicMasterStorage.sol"; // QuicMasterFarmer is the master of Quic. He can make Quic and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once Quic i...
Withdraw without caring about rewards. EMERGENCY ONLY. This has the same 25% fee as same block withdrawals to prevent abuse of thisfunction.
function emergencyWithdraw(uint256 _pid) public { (bool delegateCallStatus, ) = transactionsContract.delegatecall( abi.encodeWithSignature("emergencyWithdraw(uint256)", _pid) ); require(delegateCallStatus, "EDCF"); }
6,407,699
./full_match/1/0x7F485ed9DAEF80600403137d7a0aF5Ab8a065Fef/sources/src/modules/adaptors/BaseAdaptor.sol
Helper function that checks if `spender` has any more approval for `asset`, and if so revokes it./
function _revokeExternalApproval(ERC20 asset, address spender) internal { if (asset.allowance(address(this), spender) > 0) asset.safeApprove(spender, 0); }
3,190,231
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; /// @author: manifold.xyz import "../access/AdminControlUpgradeable.sol"; import "./ASHRateEngineCore.sol"; contract ASHRateEngineUpgradeable is ASHRateEngineCore, AdminControlUpgradeable { /** * @dev See {IERC165-supportsInterface}. */ func...
See {IASHRateEngineCore-updateEnabled}./
function updateEnabled(bool enabled) external override adminRequired { _updateEnabled(enabled); }
10,007,682
./full_match/1/0xFEc7C6AA64fDD17f456028e0B411f5c3877ADa5e/sources/contracts/optimistic-asserter/implementation/OptimisticAsserter.sol
Returns the minimum bond amount required to make an assertion. This is calculated as the final fee of the currency divided by the burnedBondPercentage. If burn percentage is 50% then the min bond is 2x the final fee. currency currency to calculate the minimum bond for. return minimum bond amount./
function getMinimumBond(address currency) public view returns (uint256) { uint256 finalFee = cachedCurrencies[currency].finalFee; return (finalFee * 1e18) / burnedBondPercentage; }
3,859,453
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.6.12; // // _░▒███████ // ░██▓▒░░▒▓██ // ██▓▒░__░▒▓██___██████ // ██▓▒░____░▓███▓__░▒▓██ // ██▓▒░___░▓██▓_____░▒▓██ // ██▓▒░_______________░▒▓█...
Lookup any optional commission split set for the edition Both values will be zero if not present/
function editionOptionalCommission(uint256 _editionNumber) external view returns (uint256 _rate, address _recipient) { CommissionSplit storage commission = editionNumberToOptionalCommissionSplit[_editionNumber]; return (commission.rate, commission.recipient); }
6,043,752
pragma solidity ^0.6.0; import "../Initializable.sol"; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dea...
Grant rewards to a recipient. The recipient address receives an an NFT representing their rewards grant. They can present the NFT to `getReward()` to claim their rewards. Rewards vest over a schedule. If the given `vestingInterval` is 0, then `vestingInterval` will be equal to `vestingLength`. recipient The reci...
function grant( address recipient, uint256 amount, uint256 vestingLength, uint256 cliffLength, uint256 vestingInterval ) external override nonReentrant whenNotPaused onlyDistributor returns (uint256 tokenId) { return _grant(recipient, amount, vestingLength, cliffLength, vestingInterval); }...
602,593
./full_match/137/0x74E7ACAfC758caC65910e5C38E6Ef9ade5fA87A8/sources/contracts/SpotTradingRewardDistributor/SpotTradingRewardDistributor.sol
@inheritdoc ISpotTradingRewardDistributor/
function updateTraderActivity( address trader, address positionAsset, uint256 positionAmount ) external override onlyRole(PM_ROLE) { uint256 currentPeriod = _getCurrentPeriod(block.timestamp); PeriodInfo storage periodInfo = periods[currentPeriod]; if (periodInfo...
4,721,644
/** *Submitted for verification at Etherscan.io on 2021-03-19 */ // File: contracts\farming\util\DFOHub.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.6; interface IDoubleProxy { function proxy() external view returns (address); } interface IMVDProxy { function getMVDFunctionalitiesManagerAddres...
allows the DFO to update the double proxy address. newDoubleProxy new double proxy address./
function setDoubleProxy(address newDoubleProxy) public onlyDFO { _doubleProxy = newDoubleProxy; }
2,420,054
./full_match/5/0x98061d960c2EaA127cB1921a6f912A2Ebb981Db4/sources/src/DonationHandlerRoles.sol
Removes addresses from donation recipient role. Can only be called by an admin. _recipients Array of addresses to remove from donation recipient role.
function removeDonationRecipient(address[] calldata _recipients) external { _checkAdmin(msg.sender); _removeRoles(DONATION_RECIPIENT, _recipients); }
11,624,835
pragma solidity^0.5.0; /// @title Thuto smart contract /// @author Helda Mandlate /// @dev import contracts from openzeppelin related to ownable and ERC20, ERC721 tokens import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721Metadata.sol"; import "@openzeppelin/co...
This function creates a new request for a particular session _details for the session _session_Id is the index for the session Id lesson Id is added to list of requested sessions
function requestSession(uint256 _session_Id, string memory _details) public { require(sessions[_session_Id].tutor_Id != 0, "Session not enlisted."); require(sessions[_session_Id].isRunning, "Session is not running."); require(userAddresses[msg.sender] != 0, "Student address is not registered...
5,527,862
//Address: 0x076719c05961a0c3398e558e2199085d32717ca6 //Contract name: Compliance //Balance: 0 Ether //Verification Date: 1/30/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; /* Polymath compliance protocol is intended to ensure regulatory compliance in the jurisdictions that security to...
`addRole` allows the adding of new roles to be added to whitelist _allowedRoles User roles that can purchase the security/
function addRoles(uint8[] _allowedRoles) public { require(owner == msg.sender); require(!finalized); for (uint i = 0; i < _allowedRoles.length; ++i) { allowedRoles[_allowedRoles[i]] = true; } }
885,099
./full_match/11155111/0x5AF04cE1D7590070A7304D6691B708D81449fEe9/sources/src/contracts/Neo.sol
sells NEO in exchange for _stable token tokenAmount amount of NEO to sell _stable contract address of the stable we want to receive
function sell( uint256 tokenAmount, address _stable ) external nonReentrant returns (uint) { return _sell(tokenAmount, msg.sender, _stable); }
3,789,563
./full_match/1/0x980C680a90631c8Ea49fA37B47AbC3154219EC1a/sources/contracts/EthenaMinting.sol
Adds an asset to the supported assets list.
function addSupportedAsset(address asset) public onlyOwner { if (asset == address(0) || asset == address(usde) || _supportedAssets.contains(asset)) revert InvalidAssetAddress(); _supportedAssets.add(asset); emit AssetAdded(asset); }
17,057,145
pragma solidity 0.4.18; /* Author: www.inncretech.com Email: aasim AT inncretech.com vishal AT inncretech.com GLXCoin Token public sale contract For details, please visit: https://ico.glx.com/ */ // Math contract to avoid overflow and underflow of variables contract SafeMath { function saf...
it will change the ending date of ico and access by owner only _newBlock enter the future blocknumber return It will return the blocknumber/ it will let Owner withdrawn ether at any time during the ICO/
function drain() external onlyOwner { }
2,575,494
./full_match/5/0x698E686bfb8358Fd4ff3E1fe23892465eF24C945/sources/project:/contracts/TokenBridge.sol
Lock tokens in TokenLockerGoerli Burn wrapped tokens on Goerli
function bridgeToBSC(uint256 amount) public { require(msg.sender != address(0), "Invalid sender address"); require(amount > 0, "Amount must be greater than zero"); emit BridgeToBSCRequested(msg.sender, amount); uint256 initialBalance = IERC20(customToken).balanceOf(msg.sende...
11,587,406
pragma solidity ^0.5.12; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts/GSN/GSNRecipient.sol"; contract MicroLoan is GSNRecipient, Ownable { // borrower address => (loan hash => amount of ethers) mapping(address => mapping(bytes32 => uint256)) public loans; // loa...
Approve request loanID request id/
function approveRequest(bytes32 loanID) public onlyOwner payable { address borrower = requestedLoans[loanID].borrower; require(borrower != address(0), "MicroLoan: borrower address should be initialized"); require(msg.value > 0, "MicroLoan: amount should be non zero value"); loans[bo...
6,347,542
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/mat...
The buyer wants to buy the order and pledge his eusdt获得订单
function Buy(uint256 _identifier) public lock returns (bool) { require(Address.isContract(_msgSender())==false,"not hunman"); require(!TransactionBan[_msgSender()],"Transaction ban"); 1. The seller calls the sell function to generate an order. You can specify or not specify the buyer's address 2....
12,536,153
pragma solidity 0.5.12; library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtrac...
Stop any additional minting of tokens forever. Available only to the owner./
function finishMinting() external onlyOwner { mintingFinished = true; }
507,205
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
The amplification parameter equals: A n^(n-1) oneTokenSwapFee - polynomial equation to solve af = fee amount to calculate in one token bf = balance of fee token ...
function _calcDueTokenProtocolSwapFeeAmount( uint256 amplificationParameter, uint256[] memory balances, uint256 lastInvariant, uint256 tokenIndex, uint256 protocolSwapFeePercentage ) internal pure returns (uint256) { uint256 finalBalanceFeeToken = _getTokenBalan...
277,679
pragma solidity ^0.4.25; import {SafeMath} from "./SafeMath.sol"; import {ERC725} from './ERC725.sol'; import {Hub} from "./Hub.sol"; import {Holding} from "./Holding.sol"; import {Profile} from "./Profile.sol"; import {HoldingStorage} from "./HoldingStorage.sol"; import {ProfileStorage} from "./ProfileStorage.sol"; i...
Pay the previous holder Multiply the tokenAmountPerHolder by the time the the holder held the data Divide the tokenAmountPerHolder by the total time Pay the previous holder Increase previous holder Stake Decrease offer creator Stake Decrease offer creator Stake reserved Set previous holder paid amount Calculate the rem...
function startReplacement(bytes32 offerId, address holderIdentity, address litigatorIdentity, uint256 litigationRootHash) internal { HoldingStorage holdingStorage = HoldingStorage(hub.getContractAddress("HoldingStorage")); LitigationStorage litigationStorage = LitigationStorage(hub.getContractAddres...
14,055,703
./full_match/11155111/0x79C49737f6C7b7C0119316488812d6d4351d0a35/sources/contracts/Contract.sol
transfer nft to winner of raffle reset each participant's entry count to zero reset all values back to defaults
function selectWinner() public onlyOwner { uint256 winnerIndex = random() % playerSelector.length; address winner = playerSelector[winnerIndex]; emit WinnerSelected(winner); ERC721Base(nftAddress).transferFrom(owner, winner, nftId); resetEntryCounts(); delete playerSe...
3,800,113
pragma solidity 0.5.15; // import "./interfaces/IERC20.sol"; import "./interfaces/IAaveLendingPool.sol"; import "./interfaces/IADai.sol"; import "./interfaces/IPoolDeposits.sol"; import "@nomiclabs/buidler/console.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppeli...
// SETUP CONTRACT/ NOTE: Upgradable at the moment
function initialize(address depositContractAddress, uint256 _votingInterval) public initializer { depositContract = IPoolDeposits(depositContractAddress); admin = msg.sender; votingInterval = _votingInterval; emit IterationChanged(0, msg.sender, now); }
13,085,031
./partial_match/42/0xBAd4595D15462Dc187Ba8eFBd683f65fe6Fe670b/sources/StakingRewardsDecayHolder.sol
don't interfere with user to withdraw his money regardlessof potential rewarder's bug or hacksonly amounts map matters
function withdraw(uint256 amount, address gem) public { require(amount > 0, "Cannot withdraw 0"); (bool success, ) = address(rewarder).call( abi.encodeWithSelector(rewarder.withdraw.selector, msg.sender, amount, gem) ); if (!success) { emi...
8,949,323
./partial_match/1/0x50Cde910D1f8b6C787b7903d23082542593E0710/sources/FraxUnifiedFarm_ERC20_Convex_Generic.sol
COMMENTED OUT SO COMPILER DOESNT COMPLAIN. UNCOMMENT WHEN DEPLOYING Convex crvUSD/FRAX ============================================ { Half of the LP should be FRAX Using 0.50 virtual price for gas savings frax_per_lp_token = curvePool.get_virtual_price() / 2; } Convex triSDT =============================...
function fraxPerLPToken() public view override returns (uint256 frax_per_lp_token) { { frax_per_lp_token = curvePool.lp_price() / 3; } }
9,413,117
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.7.0; import "./lib/ReEncryptionValidator.sol"; import "./lib/SignatureVerifier.sol"; import "./StakingEscrow.sol"; import "./proxy/Upgradeable.sol"; import "../zeppelin/math/SafeMath.sol"; import "../zeppelin/math/Math.sol"; /** * @title Adjudicator *...
Get unsigned hash for revocation _policyId Policy id _node Node that will be excluded return Revocation hash, EIP191 version 0x45 ('E')/
function getRevocationHash(bytes16 _policyId, address _node) public view returns (bytes32) { return SignatureVerifier.hashEIP191(abi.encodePacked(_policyId, _node), byte(0x45)); }
1,393,395
./full_match/1/0x91C1842E87dE6fCc81b2a83e31Da00345e95059D/sources/contracts/PartyBidRA.sol
Public utility function to call internal exit functions based on bid state/ Ensure that caller is a DAO member If NFT has already been resold, allow post-sale exit If bid has been placed, allow exit on bid failure Else, allow exit when exit timeout window has passed
function exit() external payable { require(daoStakes[msg.sender] > 0, "PartyBid: Must first be a DAO member to exit DAO."); if (NFTResold) { _exitPostSale(); if (bidPlaced) { _exitIfBidFailed(); _exitIfTimeoutPassed(); } } }
3,220,158
./partial_match/1/0x99b57Abf76E69E52EfF39a5f876280d4B525119F/sources/contracts/cedar/drop/CedarERC721Drop.sol
====================================== ============= Claim logic ============ ====================================== Lets an account claim NFTs.
function claim( address _receiver, uint256 _quantity, address _currency, uint256 _pricePerToken, bytes32[] calldata _proofs, uint256 _proofMaxQuantityPerTransaction ) external payable override nonReentrant { address msgSender = _msgSender(); if (!(...
3,659,898
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "../bridge/ILayerZeroReceiver.sol"; import "../bridge/ILayerZeroEndpoint.sol"; /* mocking multi endpoint connection. - send() will short circuit to lzReceive() directly - no reentrancy guard. the real LayerZero endpoint on main net ha...
used to simulate messages received get stored as a payload
function blockNextMsg() external { nextMsgBLocked = true; }
12,678,210
//Address: 0xd223e8aed64bf8f2031e1c7b97bf391f1bf75451 //Contract name: PetitionFactory //Balance: 0.002 Ether //Verification Date: 5/31/2018 //Transacion Count: 5 // CODE STARTS HERE pragma solidity 0.4.21; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a,...
removed this because as petition.io we still have to claim owned shares % worth from the dividendpool. calc cut for Petition.iouint firstDiv = SafeMath.div(PetitionShareholders[PetitionShareholderMap[ownerShareAddress]].shares, sharesSold);uint petitionIoDivAmt = SafeMath.mul(totalPaid, firstDiv);availableForWithdraw =...
function cutToInvestorsDividendPool(uint totalPaid) internal { currentDividendPool = SafeMath.add(currentDividendPool, totalPaid); endDividendPool(); }
14,040,073
./full_match/1/0xCEf4286E4274433f167320dB9AE81073AccfC474/sources/src/LiquidityPool.sol
Disallow interactions with the eEth token
function closeEEthLiquidStaking() external onlyAdmin { eEthliquidStakingOpened = false; }
9,668,305
pragma solidity ^0.5.0; /* ABIEncoderV2 is needed to return an array from a function. */ pragma experimental ABIEncoderV2; contract Healthchain { /* Every user has a list of documents. */ mapping (address => string[]) public documents; /** * Add a medical record. * Returns the index of the medical record...
Every user has a list of documents. / Add a medical record. Returns the index of the medical record./ push returns the array length
function addDocument(string memory documentHash) public returns (uint) { address from = msg.sender; return documents[from].push(documentHash) - 1; }
5,527,831
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC7...
onlyWhitelists can buy. 3 token per whitelisted address
function whitelistBuy( uint256 qty, uint256 tokenId, bytes32[] calldata proof ) external payable { require(listPurchases[msg.sender] + qty <= 3, "max 3 per wallet"); require(tokensMinted + qty <= maxSupply, "out of stock"); require(pricePerPass * qty == msg.value,...
14,762,846
./partial_match/1/0xe3BE0054Da2F8da5002E8bdD8AA4c7fDf851E86D/sources/ERC721CreatorMaxMint.sol
See {CreatorCore-_setApproveTransferExtension}/
function _setApproveTransferExtension(address extension, bool enabled) internal override { if (ERC165Checker.supportsInterface(extension, type(IERC721CreatorExtensionApproveTransfer).interfaceId)) { _extensionApproveTransfers[extension] = enabled; emit ExtensionApproveTransferUpdated...
2,680,704
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the am...
calculate amount of ycrv to withdraw for amount of _want_ calculate amount of yycrv to withdraw for amount of _ycrv_
function _withdrawSome(uint256 _amount) internal returns (uint256) { uint256 _ycrv = _amount.mul(1e18).div(ICurveFi(curve).get_virtual_price()); uint256 _yycrv = _ycrv.mul(1e18).div(yERC20(yycrv).getPricePerFullShare()); uint256 _before = IERC20(ycrv).balanceOf(address(this)); yERC20...
1,516,865
pragma solidity ^0.4.22; import "./oraclizeAPI_0.4.sol"; /// @title Contract to bet Ether for a number and win randomly when the number of bets is met. /// @author Merunas Grincalaitis contract Casino is usingOraclize { address owner; // The minimum bet a user has to make to participate in the game uint pub...
Check if a player exists in the current game player The address of the player to check return bool Returns true is it exists or false if it doesn't
function checkPlayerExists(address player) returns(bool){ if(playerBetsNumber[player] > 0) return true; else return false; }
15,867,424
// SPDX-License-Identifier: MIT // An example of a consumer contract that also owns and manages the subscription pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contract...
Cancel the subscription and send the remaining LINK to a wallet address.
function cancelSubscription(address receivingWallet) external onlyOwner { COORDINATOR.cancelSubscription(s_subscriptionId, receivingWallet); s_subscriptionId = 0; }
14,029,770
pragma solidity 0.8.6; import "./IBondingCurve.sol"; contract BuySell { constructor( IErc20BondingCurve _usdc20BondingCurve, IETHBondingCurve _ethBondingCurve ) { usdc20BondingCurve = _usdc20BondingCurve; ethBondingCurve = _ethBondingCurve; } IErc20BondingCurve usdc20B...
Used for setting the total maximum amount that could be deposited into the pools contracts. Note that different total maximum amounts could be set for the hedged and unhedged — classic — liquidity tranches. total Maximum amount of assets in the pool in hedged and unhedged (classic) liquidity tranches combined/
function setMaxDepositAmount(uint256 total) external onlyRole(DEFAULT_ADMIN_ROLE) { maxDepositAmount = total; }
11,680,067
./partial_match/1/0xD34BB7119A26F416a79889baCC9159B2Bd2eB79e/sources/PaidToken.sol
Transfer control Control is scheduled wallet
function canTransfer(address sender, uint256 amount) public view returns (bool) { if (!frozenWallets[sender].scheduled) { return true; } if (!isStarted(frozenWallets[sender].startDay)) { return false; } uint256 balance = balanceOf(sender); ui...
3,695,010
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/IDealManager.sol"; import "./interfaces/IModuleBase.sol"; /** * @title PrimeDeals Dao Deposit Manager * @notice Smart contract to mana...
Initialize the DaoDepositManager _dao The DAO address to which this contract belongs/
function initialize(address _dao) external { require(dao == address(0), "DaoDepositManager: Error 001"); require( _dao != address(0) && _dao != address(this), "DaoDepositManager: Error 100" ); dao = _dao; dealManager = IDealManager(msg.sender); }
418,287
./partial_match/1/0xbc6a1af02c09fc1514B95eC98756ccAa95e8Af2e/sources/GEtherBridge.sol
Removes a gToken from the portfolio. The portfolio share of the token must be 0% before it can be removed. The underlying reserve is redeemed upon removal. _token The contract address of the gToken to be removed from the portfolio./
function removeToken(address _token) public override onlyOwner nonReentrant { prm.removeToken(_token); emit RemoveToken(_token); }
2,651,002
./full_match/11155111/0x1b502402EB8fD08e657a4a2Bd6424AEc899D3c38/sources/contracts/core/DiGiHub.sol
@inheritdoc IDiGiHub
function getFollowNFT(uint256 profileId) external view override returns (address) { return _profileById[profileId].followNFT; }
3,800,530
./full_match/42/0x74FeFc9b47aAea34240D8e015D7eA4201F00cFA4/sources/browser/MasterChef.sol
Deposit LP tokens to MasterChef for pigs allocation. we can't guarantee we have the tokens until after adapter.deposit()
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); uint256 otherPending = 0; if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accpigsPe...
16,259,553
pragma solidity 0.5.0; /* AmpleForthGold AAU Midas Distributor. ** ** (c) 2020. Developed by the AmpleForthGold Team. ** ** www.ampleforth.gold */ //import "openzeppelin-solidity/contracts/math/SafeMath.sol"; //pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations ...
Gets the amount that would be distributed to a specific agent if a distribution event happened now. /
function getAgentDistributionAmount(uint256 index) public view returns (uint256) { require(checkAgentPercentage() == true); require(index < agents.length); return getDistributionAmount() .mul(agents[index].share) .div(100); ...
207,248
/* * The MIT License * * Copyright (c) 2017-2018 , Akropolis Decentralised Ltd (Gibraltar), http://akropolis.io * */ pragma solidity ^0.4.24; pragma experimental "v0.5.0"; import "./Board.sol"; import "./Ticker.sol"; import "./NontransferableShare.sol"; import "./Registry.sol"; import "./interfaces/PensionFund.sol"; ...
TODO: Allow this to accept arbitrary contribution tokens. They will need to go in the membership request struct and recurring payment object. We may need to add separate structures for determining what tokens members may make contributions in and receive benefits in.
function requestMembership(address candidate, uint lockupDuration, uint payoutDuration, uint initialContribution, uint expectedShares, bool setupSchedule, uint scheduledContribution, uint scheduleDelay, uint scheduleDuration) public onlyR...
12,761,908
./partial_match/1/0xc48AE836768e52e1DCa7Ad1F6105b0a96D9CA9BA/sources/ShoriVault.sol
removes '_amount' stakes for already registered stakeholders deducts the unstaking tax from '_amount' transfers the sum of the remainder, stake rewards, referral rewards, and current eanrings to the sender deregisters stakeholder if all the stakes are removed Emits an {OnStake} event/makes sure _amount is not more than...
function unstake(uint _amount) external { require(_amount <= stakes[msg.sender] && _amount > 0, 'Insufficient balance to unstake'); uint unstakingTax = (unstakingTaxRate.mul(_amount)).div(1000); uint afterTax = _amount.sub(unstakingTax); stakeRewards[msg.sender] = (stakeRewards[msg.s...
9,345,746
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.6; import "@openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorSettingsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorVote...
See {IGovernorCompatibilityBravo-getReceipt}./
function getReceipt(uint256 proposalId, address voter) public view virtual override returns (Receipt memory) { return _proposalDetails[proposalId].receipts[voter]; }
637,015
./partial_match/1/0x8B4953DCCd3EE51DA1E146fd8FecA4C21458238C/sources/Vault.sol
Execute update of target allocation (with time delay enforced). Needs to be called after the update was prepraed. Fails if called before time delay is met. return New target allocation./
function executeTargetAllocation() external returns (uint256) { uint256 targetAllocation = _executeUInt256(_TARGET_ALLOCATION_KEY); _deposit(); return targetAllocation; }
4,339,098
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./openzeppelin/ERC20.sol"; import "./openzeppelin/AccessControlEnumerable.sol"; import "./BeezToken.sol"; contract WonToken is AccessControlEnumerable, ERC20{ constructor() ERC20('WON', 'WON') { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender(...
매달 초기화 함수금액 충전시 마지막으로 인센티브 충전된 날짜가 지난달인 경우 (block.timestamp >= month && =>이건 빼야됨)
function updateMonth(address _address, uint256 _date) private { if(chargeStructCheck[_address].lastChargeDate < month){ chargeStructCheck[_address].incentiveOfMonth = 0; }
2,478,656
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./OpenBooks.sol"; import "./EnumerablePrices.sol"; //Pausable Contract /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inherit...
Lets a buyer pay for the book with at least the specified price lets a buyer download the book after successful payment the transaction's value must not be less than the books price _bookId the bookId to be bought
function buy(uint _bookId) external payable onSale(_bookId) whenBuyNotPaused{ uint price = prices.get(_bookId); require( msg.value >= price, "BookShop: Price is higher"); address owner = openBooks.ownerOf(_bookId); balances[owner] += price; emit Buy(owner, _msgSender...
5,345,983
./full_match/137/0x2BD21aD1C2ae155EfEfEe7f579FEe3beCCC2529a/sources/contracts/coinflip.sol
return info about a game given valid index/
function get_game_info(uint256 _index) external view returns ( uint256 _i, address _player1, address _player2, uint256 _amount, address _winner, uint256 _timestamp ) { Game memory game = gameIndex[_in...
3,737,263
pragma solidity ^0.5.17; interface IERC20 { function TOTALSUPPLY3() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF367(address account) external view returns (uint256); //inject NONSTANDARD NAMING function TR...
inject NONSTANDARD NAMING
function URNALLOW976(address, uint) external;
12,996,821
./full_match/4/0x673667658E0dF94a63aE708eE66B7664D3C5Da3b/sources/browser/Untitled.sol
- Proposal: mark a proposal as processed in the DAO registry
function processProposal(uint256 _proposalId) external hasAccess(this, FlagHelper.Flag.PROCESS_PROPOSAL) { Proposal storage proposal = _setProposalFlag( _proposalId, FlagHelper.Flag.PROCESSED ); uint256 flags = proposal.flags; emit Process...
13,321,978
pragma solidity 0.8.2; abstract contract IERC20WithCheckpointing { function balanceOf(address _owner) public view virtual returns (uint256); function balanceOfAt(address _owner, uint256 _blockNumber) public view virtual returns (uint256); function totalSupply() public vie...
Directs rewards to a vault, and removes them from the old vault. Provided that old is active and the new vault is whitelisted. _old Address of the old vault that will no longer get boosted _new Address of the new vault that will get boosted _pokeNew Bool to say if we should poke the boost on the new vault/
function setDirection( address _old, address _new, bool _pokeNew ) external override { uint8 idOld = _vaults[_old]; uint8 idNew = _vaults[_new]; require(idOld > 0 && idNew > 0, "Vaults not whitelisted"); uint128 bitmap = _directedBitmap[msg.sender]; ...
13,444,226
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This pr...
_lock_ Bind does not lock because it jumps to `rebind`, which does
function bind(address token, uint balance, uint denorm) external _logs_ { require(msg.sender == controller, "!controller"); require(!_records[token].bound, "bound"); require(!finalized, "finalized"); require(_tokens.length < BConst.MAX_BOUND_TOKENS, ">maxTokens"); ...
2,076,646
// contracts/interfaces/IStrategy.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IStrategy { // Deposited token function depositToken() external view returns (address); // Total tokens managed by strategy function depositTotal() external view returns (uint256); // Sum of al...
Deposited token Total tokens managed by strategy Sum of all shares of users to depositTotal Main harvest function Transfer tokens BalleMaster -> strategy Transfer tokens strategy -> BalleMaster Pause strategy Unpause strategy Panic strategy Retire strategy
interface IStrategy { function depositToken() external view returns (address); function depositTotal() external view returns (uint256); function sharesTotal() external view returns (uint256); function harvest() external; function deposit(address _user, uint256 _amount) external returns (uint256)...
1,817,451
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
remove an address from the admin list addr address return true if the address was removed from the admin list, false if the address wasn't in the admin list in the first place/
function removeAddressFromAdmin(address addr) onlyOwner public returns(bool success) { if (admins[addr]) { admins[addr] = false; delete mintLimiter[addr]; delete burnLimiter[addr]; emit AdminAddressRemoved(addr); success = true; } }
12,908,033
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol"; import "../interfaces/IERC1155Minter.sol"; import "../utils/SignerValidator.sol"; /** * @dev An Godgadget airdropper for Godland. * U...
Check whether an account is claimed 'id' of airdrop or not/
function hasClaimed(address account, uint256 id) public view returns (bool) { return _claimed[id][account]; }
6,412,021