file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// File: @openzeppelin/contracts/utils/Counters.sol pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting req...
Check to make sure we're not going over supplyMint Free Spoders
function freeMint(uint8 _v, bytes32 _r, bytes32 _s) onlyValidAccess(_v, _r, _s) public payable { require(_whiteListPaused == false, "Sale not active."); require(totalSupply() < MAX_ELEMENTS, "Sale has ended"); require(_whiteListHasMinted[msg.sender] == false, "User has already minted"); ...
1,486,251
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/AddressUtils.sol"; import "./CvcEscrowInterface.sol"; import "../pricing/CvcPricingInterface.sol"; import "../upgradeability/Initi...
Returns actual platform fee rate value. return uint256/ return platformFeeRate;
function platformFeeRate() public view returns (uint256) { return uintStorage[keccak256("platform.fee.rate")]; }
6,411,408
pragma solidity >=0.4.21 <0.7.0; contract Review { // Saving address for reviewers that have already voted address[4] public reviewers; // Mapp address to bool[], in order to record the panel that has already submitted mapping(address => bool[]) public voters; // Function: make review function review(ui...
Getter for array reviewers
function getReviewers() public view returns (address[4] memory) { return reviewers; }
5,415,010
./full_match/1/0x4f4fFE6f397F5BC985F4dc1EB5a0eB2D9B93D12D/sources/contracts/V3/LandingPage.sol
Allows the contract owner to change the commission percentage for transactions. This function allows the contract owner to adjust the commission percentage within a specified range (5% to 10%). The commission percentage is used to calculate the commission for transactions. Requirements: - The caller must be the contrac...
function changeCommissionPercentage( uint256 _newPercentage ) external onlyOwner { require( _newPercentage >= 5 && _newPercentage <= 10, "Out of range: must be 5-10%" ); uint256 oldPercentage = commissionPercentage; commissionPercentage = _newPerce...
3,146,066
./full_match/1/0xF2fd4F08dE4bEc75c5A23bD36FBeef54A3FF182A/sources/Users/enamakel/Work/mahadao/arthcoin/arthcoin-v2/contracts/treasury/TreasuryHelpers.sol
Helper function to allocate seigniorage to bond token holders. Seigniorage before the boardrooms get paid./ update accumulated seigniorage
function _allocateToBondHolers(uint256 seigniorage) internal returns (uint256) { uint256 treasuryReserve = Math.min( seigniorage, ICustomERC20(bond).totalSupply().sub(accumulatedSeigniorage) ); if (treasuryReserve > 0) { ...
8,398,711
./full_match/4/0x2db1bD6ffe25FC2321951B0e86300ebA0A685EE0/sources/MMACombat.sol
Split the contract balance into halves
function swapAndLiquify(uint256 tokens) private lockTheSwap{ uint256 tokensToAddLiquidityWith = tokens / 2; uint256 toSwap = tokens - tokensToAddLiquidityWith; uint256 initialBalance = address(this).balance; swapTokensForETH(toSwap); uint256 ETHToAddLiquidityWith = address(t...
707,482
// SPDX-License-Identifier: MIT pragma solidity ^0.7.2; import "./HedgerParty.sol"; import "./SafeMath.sol"; contract OpenHedge1200 { // OpenHedgeProtocol Version string public constant OpenHedgeProtocol = "0.12.0"; enum HedgeStatus {AVAILABLE, RESERVED, FUNDED, CANCELLED, ACTIVE, FINISHED} HedgeSta...
Check if funds are claimable
function isClaimable() public view returns (bool) { return status == HedgeStatus.ACTIVE && isMatured(); }
1,085,519
./full_match/1/0xFd3171eCA94a00e40b3671803d899d3FD86c073c/sources/contracts/PerpetualTranche.sol
Counts the number of tokens currently in the reserve.
function _reserveCount() private view returns (uint256) { return _reserves.length(); }
2,949,481
./partial_match/56/0x83D7Fab5D46371D9F89FbA596f8051dF7A3A5D0a/sources/ScarlettProtocol.sol
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {SCAR-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have al...
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "SCAR: decreased allowance below zero")); return true; }
11,173,017
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c =...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./
function transfer(address _to, uint256 _value) public erc20Allowed returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(_airdropUnlocked(_to)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances...
5,858,366
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeabl...
Mints autoBTC with BTCB. _amount Amount of BTCB used to mint autoBTC./ Note: AutoFarm has an entrance fee Each deposit and withdraw trigger AUTO distribution in AutoFarm Updates the rewards before minting 1 autoBTC = 1 share in AutoFarm BTCB strategy
function mint(uint256 _amount) public override { uint256 _before = IStrat(BTBC_STRAT).sharesTotal(); IERC20Upgradeable(BTCB).safeTransferFrom(msg.sender, address(this), _amount); IAutoFarm(AUTOFARM).deposit(PID, _amount); uint256 _after = IStrat(BTBC_STRAT).sharesTotal(); _...
6,452,609
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../../ConverterVersion.sol"; import "../../interfaces/IConverter.sol"; import "../../interfaces/IConverterAnchor.sol"; import "../../interfaces/IConverterUpgrader.sol"; import "../.....
error message binary size optimization
function _validReserve(IReserveToken _address) internal view { require(__reserveIds[_address] != 0, "ERR_INVALID_RESERVE"); }
12,984,642
//Address: 0x672a1ad4f667fb18a333af13667aa0af1f5b5bdd //Contract name: CREDToken //Balance: 0 Ether //Verification Date: 12/7/2017 //Transacion Count: 13410 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/i...
Unlock any now freeable tokens that are locked up for team and reserve accounts .
function unlockTeamAndReserveTokens() public whenLiquid afterReserveUnlockTime unlockReserveAndTeamOnce { require(totalSupply.add(teamLocked).add(reserveLocked) <= cap); totalSupply = totalSupply.add(teamLocked).add(reserveLocked); balances[teamWallet] = balances[teamWallet].add(teamLocked)...
896,680
./full_match/1/0xb69E35fB4A157028b92F42655090b984609Ae598/sources/contracts/WrappedCollateralToken.f.sol
Returns lowest total debt that will be split. Minimum collateralization ratio for position Splits collateral between protocol and liquidator. totalCollateral Amount of collateral to split. totalDebt Amount of debt to split. price Price of collateral. isRedistribution True if this is a redistribution. return colla...
interface IPositionManager is IFeeCollector { function getPriceOracleResponse() external returns (PriceOracleResponse memory); function timeout() external view returns (uint256); function TARGET_DIGITS() external view returns (uint256); function DEVIATION() external view returns (uint256); } } }...
2,974,973
pragma solidity ^0.4.24; interface PlayerBookReceiverInterface { function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external; function receivePlayerNameList(uint256 _pID, bytes32 _name) external; } contract PlayerBook { using NameFilter for string; using SafeMath fo...
players, if you registered a profile, before a game was released, or set the all bool to false when you registered, use this function to push your profile to a single game. also, if you&39;ve updated your name, you can use this to push your name to games of your choosing. -functionhash- 0x81c5b206 _gameID game id/ a...
function addMeToGame(uint256 _gameID) isHuman() public { require(_gameID <= gID_, "silly player, that game doesn&#39;t exist yet"); address _addr = msg.sender; uint256 _pID = pIDxAddr_[_addr]; require(_pID != 0, "hey there buddy, you dont even have an account"); ...
2,041,562
./full_match/5/0x04f42E2bB2278065ce006E1f1c24cf1939D3bdE3/sources/browser/Update.sol
Before it was OnlyOwner, but it is called also inside voteAccordingMajority ( inside waiveDiscrepancies)
function winningProposal() internal view returns (uint winningProposal_){ uint winningVoteCount = 0; for (uint p = 0; p < proposals.length; p++) { if (proposals[p].voteCount > winningVoteCount) { winningVoteCount = proposals[p].voteCount; winningProposal_ ...
1,883,649
// Liquidity contract with pegged value pragma solidity 0.5.16; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(a...
returns user staking data/
function userDeposits(address user) external view returns ( uint256, uint256, uint256, bool ) { if (hasStaked[user]) { return ( deposits[user].depositAmount, deposits[user].deposit...
14,735,802
/* ----------------------------------------------------------------- FILE INFORMATION ----------------------------------------------------------------- file: Owned.sol version: 1.1 author: Anton Jurisevic Dominic Romanowski date: 2018-2-26 ----------------------------------------------...
Collateral that has been locked due to issuance, and cannot be transferred to other addresses. This is capped at the account&39;s total collateral./
function lockedCollateral(address account) public view returns (uint) { uint debt = issuanceDraft(account); uint collat = collateral(account); if (debt > collat) { return collat; } return debt; }
2,140,208
./full_match/1/0x5349E94435Cc9Cab9FfB40A492DA46935052733A/sources/cache/solpp-generated-contracts/zksync/libraries/TransactionValidator.sol
Based on the full L2 gas limit (that includes the block overhead) and other properties of the transaction, returns the l2GasLimit for the body of the transaction (the actual execution). _totalGasLimit The L2 gas limit that includes both the overhead for processing the block and the L2 gas needed to process the transac...
function getTransactionBodyGasLimit( uint256 _totalGasLimit, uint256 _gasPricePerPubdata, uint256 _encodingLength ) internal pure returns (uint256 txBodyGasLimit) { uint256 overhead = getOverheadForTransaction(_totalGasLimit, _gasPricePerPubdata, _encodingLength); unchec...
3,023,175
./full_match/1/0xEeb717450af1C9E3b8493C0B62855dDCB28c3489/sources/contracts/CryptoFBoys.sol
Increment operation cannot overflow.
function mintBatch(uint256 count) public onlyOwner { uint256 startAt = currentTokenId; while (currentTokenId < startAt + count) { _mint(msg.sender, currentTokenId); unchecked { currentTokenId++; } } }
9,746,098
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOw...
Constructor that gives msg.sender all of existing tokens./
function KryptoroToken() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; }
10,417,377
./partial_match/1/0xAe46E888aF6318aED82FE715b1b98b78F74e7b65/sources/LiquidityPoolV1Converter.sol
removes liquidity (reserve) from the pool _reserveTokens address of each reserve token _reserveMinReturnAmounts minimum return-amount of each reserve token _totalSupply token total supply _amount token amount return the amount of each reserve token granted for the given amount...
function removeLiquidityFromPool(IERC20Token[] memory _reserveTokens, uint256[] memory _reserveMinReturnAmounts, uint256 _totalSupply, uint256 _amount) private returns (uint256[] memory) { syncReserveBalances(); IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA));...
9,362,120
// Sources flattened with hardhat v2.6.1 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v4.3.2 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these ar...
Encode integer in big endian binary form with no leading zeroes. TODO: This should be optimized with assembly to save gas costs. _x The integer to encode. return RLP encoded bytes./
function _toBinary(uint256 _x) private pure returns (bytes memory) { bytes memory b = abi.encodePacked(_x); uint256 i = 0; for (; i < 32; i++) { if (b[i] != 0) { break; } } bytes memory res = new bytes(32 - i); for (uint256 j ...
366,125
./full_match/1/0x25A103A1D6AeC5967c1A4fe2039cdc514886b97e/sources/contracts/RWAHub.sol
Admin function to set the minimum amount to redeem _minimumRedemptionAmount The minimum amount required to submit a redemption request/
function setMinimumRedemptionAmount( uint256 _minimumRedemptionAmount ) external onlyRole(MANAGER_ADMIN) { if (_minimumRedemptionAmount < BPS_DENOMINATOR) { revert AmountTooSmall(); } uint256 oldRedeemMinimum = minimumRedemptionAmount; minimumRedemptionAmount = _minimumRedemptionAmount; ...
3,021,974
pragma solidity 0.4.23; /** * Overflow aware uint math functions. * * Inspired by https://github.com/MakerDAO/maker-otc/blob/master/contracts/simple_market.sol */ contract SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function safeMul(uint256 a, uint256 b) internal pure retu...
TODO: update tests to expect throw
function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3) returns (bool success) { require(_to != address(0)); require(infos[index[_from]].tokenBalances >= _value && allowed[_from][msg.sender] >= _value && _value > 0); infos[index[_from]].tokenBalances = safeSub(infos[index[_fro...
994,766
pragma solidity 0.6.12; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in h...
bytes memory data = abi.encode(msg.sender, outToken, to, liquidity); calc real vol by liquidity np buy in ETH, outToken is ETH
function calcImpactCostFor_BURN(address token, bytes memory data, uint256 ethAmount, uint256 erc20Amount) public view returns (uint256 impactCost) { (, address outToken, , uint256 liquidity) = abi.decode(data, (address, address, address, uint256)); uint256 vol = liquidity.mul(navps).div(NAVPS_BASE);...
14,965,899
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import "../../utils/LibBytes.sol"; import "../../utils/SignatureValidator.sol"; import "../../interfaces/IERC1271Wallet.sol"; import "./interfaces/IModuleAuth.sol"; import "./ModuleERC165.sol"; abstract contract ModuleAuth is IModuleAuth, ModuleERC165, ...
Verifies whether the provided signature is valid with respect to the provided hash MUST return the correct magic value if the signature provided is valid for the provided hash > The bytes4 magic value to return when signature is valid is 0x1626ba7e : bytes4(keccak256("isValidSignature(bytes32,bytes)")) _hash ...
function isValidSignature( bytes32 _hash, bytes calldata _signatures ) external override view returns (bytes4) { if (_signatureValidation(_subDigest(_hash), _signatures)) { return SELECTOR_ERC1271_BYTES32_BYTES; } }
5,382,301
./full_match/1/0x7AfC5dc212A658B329E4d14e7D45d325c66c934D/sources/contracts/WardenPledge.sol
Increases the Pledge reward per vote delegated Increases the Pledge reward per vote delegated & add rewards for that new duration pledgeId ID of the Pledge newRewardPerVotePerWeek New amount of reward given for each vote delegation (per week) maxTotalRewardAmount Maximum added total reward amount allowed to be pull...
function increasePledgeRewardPerVote( uint256 pledgeId, uint256 newRewardPerVotePerWeek, uint256 maxTotalRewardAmount ) external nonReentrant whenNotPaused { if(pledgeId >= pledges.length) revert Errors.InvalidPledgeID(); address creator = pledgeOwner[pledgeId]; i...
17,041,197
// the azimuth logic contract // https://azimuth.network pragma solidity 0.4.24; //////////////////////////////////////////////////////////////////////////////// // Imports //////////////////////////////////////////////////////////////////////////////// // OpenZeppelin's Ownable.sol /** * @title Ownable * @dev...
startUpgradePoll(): open a poll on making _proposal the new ecliptic _proposal must not have achieved majority before if the proposal is being made for the first time, register it.
function startUpgradePoll(address _proposal) external onlyOwner { require(!upgradeHasAchievedMajority[_proposal]); Poll storage poll = upgradePolls[_proposal]; if (0 == poll.start) { upgradeProposals.push(_proposal); } startPoll(poll); emit UpgradePollStarted(_proposal);...
1,053,656
./partial_match/1/0xC8B4a74F7685e901D3c57a5Ec37aF8Ad450d8784/sources/PROGENS.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _Allowances[account] = _Allowances[account].add(amount);...
4,078,474
pragma solidity ^0.4.18; /** * @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 * b; assert(c / a == b); ...
Constructor is called only once and can not be called again/
function Alpon() public { totalSupply = initialSupply; balanceOf[msg.sender] = totalSupply; }
10,867,915
./full_match/1/0x7af62458e41E2F490D2Df54A8FeDc56fFedB8c17/sources/lib/solady/src/tokens/ERC721.sol
Transfers token `id` from `from` to `to`. Requirements: - Token `id` must exist. - `from` must be the owner of the token. - `to` cannot be the zero address. - The caller must be the owner of the token, or be approved to manage the token. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC72...
function _safeTransfer(address from, address to, uint256 id, bytes memory data) internal virtual { _transfer(address(0), from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, data); }
3,202,338
./partial_match/4/0x5C232702e1EF72e81e53f198631A36105Eb8805d/sources/ExchangeDataStore.sol
setTickeData use for “tickers” data (prices of cryptocurrencies in different exchanges) hash every 24 hours or less, and record those hashes _rowHashID hash for last id/ require(isIssuer[msg.sender] == true, "Issuer not registered to register a certificate"); require(isRecipient[_recipient] == true, "Recipient not ...
function setTickeData(string memory _rowHashID,string memory _rowTickerHash) public { TickerData memory ticker; uint id = ++tickerData_counter; ticker.rowTickerHash = _rowTickerHash; ticker.rowHashID = _rowHashID; ticker.creationDate = block.timestamp; ticker...
8,760,412
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(ad...
remove an address from the whitelist _operator address return true if the address was removed from the whitelist, false if the address wasn't in the whitelist in the first place/
function removeAddressFromWhitelist(address _operator) public onlyOwner { removeRole(_operator, ROLE_WHITELISTED); }
969,431
/** *Submitted for verification at Etherscan.io on 2021-02-23 */ pragma solidity 0.6.12; interface marketManagerInterface { function setBreakerTable(address _target, bool _status) external returns (bool); function getCircuitBreaker() external view returns (bool); function setCircuitBreaker(bool _emergency) exte...
Reward the liquidator delinquentBorrower The address of the liquidation target rewardAmount The amount of reward token liquidator The address of the liquidator (liquidation operator) handlerID The handler ID of the reward token for the liquidator return The amount of reward token/
function partialLiquidationUserReward(address payable delinquentBorrower, uint256 rewardAmount, address payable liquidator, uint256 handlerID) onlyLiquidationManager external override returns (uint256) { address tokenHandlerAddr = dataStorageInstance.getTokenHandlerAddr(handlerID); proxyContractInterface tokenHan...
6,491,405
./partial_match/1/0x10c8324B20b7266c445944f043F53F6A77ea0BD4/sources/MEGAWAVE.sol
reduce spender's allowance to 0 then set desired value after to avoid race condition
function approve(address _spender, uint256 _amount) public returns(bool) { require((_amount == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; }
3,721,813
./partial_match/80001/0x29f049fD25bFC402CDc0c7aa3f3Fa9724CE7FAEE/sources/FxChild.sol
IStateReceiver represents interface to receive state
interface IStateReceiver { function onStateReceive(uint256 stateId, bytes calldata data) external; }
8,796,857
...
inject NONSTANDARD NAMING
function WITHDRAW940(uint256 amount) public UPDATEREWARD996(msg.sender) {
6,417,111
pragma solidity ^0.5.0; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/BountyCreator.sol"; /** @title TestBountyCreator @dev The contract testing the functionalities of the BountyCreator contract @author Smit Rajput */ contract TestBountyCreator { /** Storage *...
To check if the 1st 3 details of a bounty are properly retrievable/
function testSomeBountyDetails() public { uint bountyID = creator.createBounty("some task", 5); (string memory task, uint reward, uint numberOfSubmissions,,,) = creator.getBountyDetails(bountyID); Assert.equal(task, "some task", "It should return the bounty description"); Assert.equ...
14,050,710
pragma solidity ^0.4.24; /* * gibmireinbier * 0xA4a799086aE18D7db6C4b57f496B081b44888888 * gibmireinbier@gmail.com */ library Helper { using SafeMath for uint256; uint256 constant public ZOOM = 1000; uint256 constant public SDIVIDER = 3450000; uint256 constant public PDIVIDER = 345...
ref must be a citizen, else ref = devTeamWelcome new Citizenadd child
function register(string _sUsername, address _ref) public notRegistered() { require(Helper.validUsername(_sUsername), "invalid username"); address sender = msg.sender; uint256 _username = Helper.stringToUint(_sUsername); require(usernameAddress[_username] == 0x0, ...
12,686,268
./partial_match/42/0x0C7e9B502Ce3239c6A5dcaF9392D9bE9215d9AdC/sources/ChainLog.sol
Returns the address for a particular key _key a bytes32 key (ex. MCD_VAT) return addr the contract address associated with the key
function getAddress(bytes32 _key) public view returns (address addr) { addr = location[_key].addr; require(addr != address(0), "dss-chain-log/invalid-key"); }
3,357,817
./full_match/1/0x181cfD48e5d22233e8B5C5dd3908123A2d9Ef733/sources/browser/YFMSVaults.sol
returns all users currently staking in this vault.
function getStakers() public view returns (address[] memory) { return stakers; }
4,826,549
./full_match/84531/0x23635e486de7B688b07F4CEe917D447dAf8acE3E/sources/contracts/ERC20MintablePauseableUpgradeable.sol
keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
{ address public implementation; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); mapping(address => bool) private blackList; bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; mapping(address => uint256) public nonces...
14,302,592
./full_match/80001/0x0392F6416DCA6305A7aB44A7652fE12c6367322c/sources/marketplaceupdated.sol
Places a bid for a published NFT and checks for the asset fingerprint _nftAddress - Address of the NFT registry _assetId - ID of the published NFT _expiresAt - Bid expiration time/
function safePlaceBid(address _nftAddress, uint256 _assetId, uint256 _expiresAt, uint256 _priceInWei) public payable whenNotPaused { Order memory order = _getValidOrder(_nftAddress, _assetId); uint256 price; if(order.currency == 0x0000000000000000000000000000000000...
5,579,275
./full_match/80001/0x809420EEE145CE61be213Bd4AE40885cE8b11E8e/sources/contracts/testnetGenerateV2.sol
Retrieves an available token at the specified index. indexToUse The index to use. updatedNumAvailableTokens The updated number of available tokens./
function getAvailableTokenAtIndex( uint256 indexToUse, uint256 updatedNumAvailableTokens ) internal returns (uint256 result) { uint256 valAtIndex = _availableTokens[indexToUse]; uint256 lastIndex = updatedNumAvailableTokens - 1; uint256 lastValInArray = _availableTokens[l...
840,007
./full_match/1/0x1a6aa939A1682Cdffa08a35c22795d933AF9A116/sources/EthernaalFlaNft.sol
This function is used to check if it is the first sale of a token on the Ethernaal marketplace./
function isTokenFirstSale(uint tokenId) external view returns(bool){ return tokenFirstSale[tokenId]; }
5,000,937
./full_match/1/0x2DE9441C3e22725474146450FC3467A2c778040F/sources/pickle.sol
Recalls all the deposited funds from a vault to this contract. _vaultId the identifier of the recall funds from. return the amount of funds that were recalled from the vault to this contract and the decreased vault value. Please note this strategy will have 1.5% + 3crv/dai slippage lost
function recallAll(uint256 _vaultId) external nonReentrant expectInitialized returns (uint256, uint256) { VaultV2.Data storage _vault = _vaults.get(_vaultId); return _recallFunds(_vaultId, _vault.totalDeposited * (1000-slippage) / 1000); }
3,122,678
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; import "./base/ModuleManager.sol"; import "./base/OwnerManager.sol"; import "./base/FallbackManager.sol"; import "./base/GuardManager.sol"; import "./common/EtherPaymentFallback.sol"; import "./common/Singleton.sol"; import "./common/SignatureDe...
Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise. dataHash Hash of the data (could be either a message hash or transaction hash) data That should be signed (this is passed to an external validator contract) signatures Signature data that should be verified. Can be ECD...
function checkSignatures( bytes32 dataHash, bytes memory data, bytes memory signatures ) public view { uint256 _threshold = threshold; require(_threshold > 0, "GS001"); checkNSignatures(dataHash, data, signatures, _threshold); }
431,252
./full_match/1/0x12AAD8dAb7189C5EAa9aF79c2ea274413Ce1E332/sources/contracts/Distirbutor.sol
Set reward rate for rebase _rewardRate New rate
function setRate(uint256 _rewardRate) external onlyOwner { require( _rewardRate <= rateDenominator, "Rate cannot exceed denominator" ); rate = _rewardRate; }
2,929,501
pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract KaliToken { // Public variables of the token string public name = "KALI TOKEN"; string public symbol = "KAL"; uint8 public decimals = 0; ...
Constrctor function Initializes contract with initial supply tokens to the creator of the contract/
function KaliToken() public { creator = msg.sender; }
10,967,091
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; import { Lib_EthUtils } from "../../libra...
Allows a user to prove that an account does not exist in the state. _ovmContractAddress Address of the contract on the OVM. _stateTrieWitness Proof of the (empty) account state./ Exit quickly to avoid unnecessary work.
function proveEmptyContractState( address _ovmContractAddress, bytes memory _stateTrieWitness ) override public onlyDuringPhase(TransitionPhase.PRE_EXECUTION) contributesToFraudProof(preStateRoot) { require( ovmStateManager.hasEmptyAccount(...
7,288,546
./partial_match/1/0xB10daee1FCF62243aE27776D7a92D39dC8740f95/sources/lib/prb-math/src/ud60x18/Math.sol
Divides two UD60x18 numbers, returning a new UD60x18 number. Uses {Common.mulDiv} to enable overflow-safe multiplication and division. Notes: - Refer to the notes in {Common.mulDiv}. Requirements: - Refer to the requirements in {Common.mulDiv}. x The numerator as a UD60x18 number. y The denominator as a UD60x18 numb...
function div(UD60x18 x, UD60x18 y) pure returns (UD60x18 result) { result = wrap(Common.mulDiv(x.unwrap(), uUNIT, y.unwrap())); }
9,308,614
// File: contracts/AvastarTypes.sol pragma solidity 0.5.14; /** * @title Avastar Data Types * @author Cliff Hall */ contract AvastarTypes { enum Generation { ONE, TWO, THREE, FOUR, FIVE } enum Series { PROMO, ONE, TWO, THREE, ...
Set the artist Attribution for a given Generation _generation the generation to set artist attribution for _artist the artist who created the art for the generation _infoURI the URI for the artist's website / portfolio/
function setAttribution( Generation _generation, string calldata _artist, string calldata _infoURI ) external onlySysAdmin onlyBeforeProd(_generation) { require(bytes(_artist).length > 0 && bytes(_infoURI).length > 0); attributionByGeneration[uint8(_generation)] =...
1,082,500
//ZK-Exchange handles all ZK verification, note and order state management, token escrowing pragma solidity ^0.5.0; import "./interfaces/IERC20.sol"; import {Verifier as MintVerifier} from "./verifiers/CreateNoteVerifier.sol"; import {Verifier as SpendVerifier} from "./verifiers/SpendNoteVerifier.sol"; import {Verifie...
snark paramsorderHash0, orderHash1, noteHash0, noteHash1, fillNoteHash0, fillNoteHash1, output ensure maker note is exchangable ensure maker fill note is pending ensure taker note is spendable ensure taker fill note is not already in use verify proof spend maker and taker notes activate pending maker fill note mint tak...
function fillOrder( uint256[2] calldata a, uint256[2] calldata a_p, uint256[2][2] calldata b, uint256[2] calldata b_p, uint256[2] calldata c, uint256[2] calldata c_p, uint256[2] calldata h, uint256[2] calldata k, uint256[7] calldata publicParam...
15,874,041
pragma solidity ^0.4.20; /* * ==================================== * * * * ========== https://powx.co ========= * * * * ==================================== * * -> What? * The original autonomous pyramid, improved: * [x] More stable than ever, h...
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(_ethereum, dividendFee_); ...
378,172
./full_match/80001/0x4444572f8e6FB8b76f2943C1ba15f5aA9b38eC72/sources/gist-4c970e79d3a27a9edbbf04d6c737be27/IInitializableDebtToken.sol
IInitializableDebtToken Aave Interface for the initialize function common between debt tokens/
interface IInitializableDebtToken { event Initialized( address indexed underlyingAsset, address indexed pool, address incentivesController, uint8 debtTokenDecimals, string debtTokenName, string debtTokenSymbol, bytes params ); function initialize( IPool pool, address underlyin...
5,658,188
pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/SignedSafeMath.sol"; /// @dev Implements simple fixed point math add, sub, mul and div operations. /// @author Alberto Cuesta Cañada library DecimalMath { using SafeMath for uint256; using SignedSa...
Divides x between y, assuming they are both fixed point with `decimals` digits.
function divd(int256 x, int256 y, uint8 decimals) internal pure returns (int256) { return x.mul(int(unit(decimals))).div(y); }
5,361,041
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol
Computes the {TimelockController} operation salt. It is computed with the governor address itself to avoid collisions across governor instances using the same timelock./
function _timelockSalt(bytes32 descriptionHash) private view returns (bytes32) { return bytes20(address(this)) ^ descriptionHash; }
8,083,792
pragma solidity ^0.5.0; import "../ENS.sol"; import "../ResolverBase.sol"; // This is a special "trusted attesting" resolver, in the sense that some record info associated // to a node can not be set by the owner of the node, but it has to be set by the // owner of the parent node. In other words, the parent node "at...
We specify both the node and the subnode ("label"), the caller should be the owner of the parent node. This is in contrast to "normal" resolvers, where only the target node is specified. Check for lengths of strings Calculate the namehash of the subnode Assign ownership of the name to the specified address, via the ENS...
function setAlaDIDPublicEntity( bytes32 node, bytes32 label, bytes32 _DIDHash, string calldata _domain_name, string calldata _DIDDocument, bool _active, address _owner ) external authorised(node) { require(bytes(_domain_name).length < 100, "Do...
1,085,867
./full_match/42220/0x4733612DF7f4dd34B0dD76D8eE45BBdA9b0Be8a4/sources/contracts/spaceswap-ubeswap/Factory.sol
if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { address feeTo = IUniswapV2Factory(factory).feeTo(); feeOn = feeTo != address(0); if (feeOn) { if (_kLast != 0) { uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1)); ...
16,359,707
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ConfirmedOwner.sol"; import "./interfaces/AggregatorValidatorInterface.sol"; import "./interfaces/TypeAndVersionInterface.sol"; contract ValidatorProxy is AggregatorValidatorInterface, TypeAndVersionInterface, ConfirmedOwner { /// @notice Uses a sing...
Upgrade the aggregator by setting the current aggregator as the proposed aggregator. Must have a proposed aggregator. Only owner can call./ Get configuration in memory Perform the upgrade
function upgradeAggregator() external onlyOwner { AggregatorConfiguration memory current = s_currentAggregator; address previous = current.target; address proposed = s_proposedAggregator; require(current.hasNewProposal, "No proposal"); delete s_proposedAggregator; emit AggregatorUpgraded(pre...
923,408
pragma solidity ^0.5.16; interface IERC20 { function TOTALSUPPLY643() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF605(address account) external view returns (uint256); //inject NONSTANDARD NAMING function ...
inject NONSTANDARD NAMING
function SAFEAPPROVE528(IERC20 token, address spender, uint256 value) internal {
12,702,306
// contracts/Strawberries.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./ISeeds.sol"; import "./FruitsLibrary.sol"; contract Strawberries is ERC721Enumerable { /** MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...
Burns and mints new. _tokenId The token to burn./Burn token
function burnForMint(uint256 _tokenId) public { require(ownerOf(_tokenId) == msg.sender); _transfer( msg.sender, 0x000000000000000000000000000000000000dEaD, _tokenId ); mintInternal(); }
14,693,943
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IUnit { function balanceOf(address _address) external view returns (uint256); function stake(address _address) external; function unstake(address _address) external; function getStakingStatus(address _address) external view returns (bo...
Ends staking for all approved units, only approved units can call this./
function endSeason() public onlyApprovedUnit { seasonData.endTimestamp = block.timestamp; delete seasonData.active; }
14,326,283
pragma solidity 0.5.9; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./thirdparty/BancorPower.sol"; /** * @title Equation * * @dev Equation library abstracts the representation of mathematics equation. * As of current, an equation is basically an expression tree of constants, * one variabl...
Calculate the arithmetic value of this sub-expression./
function solveBool(uint256 opcodes, uint256[] memory constants, uint8 startIndex, uint256 xValue) private view returns (uint8, bool) { require(startIndex < 32); uint8 opcode = getOpcodeAt(opcodes, startIndex); if (opcode == OPCODE_NOT) { (uint8 endIndex, bool value) = solveBool(opcode...
12,651,077
./partial_match/1/0x9cE40fb807eaF4aB3712c7D8797eE8107B36C46e/sources/FckAirdrop.sol
Addition to StandardToken methods. Decrease the amount of tokens that an owner allowed to a spender and execute a call with the sent data. approve should be called when allowed[_spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) ...
function decreaseApprovalAndCall(address _spender, uint _subtractedValue, bytes _data) public payable returns (bool) { require(_spender != address(this)); super.decreaseApproval(_spender, _subtractedValue); require(_spender.call.value(msg.value)(_data)); return true; }
4,259,930
pragma solidity ^0.4.13; library SafeMath { function mul(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal returns (uint256) { // assert(b > 0); // Solidity automatically throws wh...
0.0001 Ether per block Difficulty is so low because it doesn't include gas prices for execution Ethereum blocks to internal blocks Roughly 10 minute windows Adjust difficulty x claimed internal blocks Reward adjustment This is the effective block counter, since block windows are discontinuous Balance of this address ca...
function Bitcoineum() { totalSupply = INITIAL_SUPPLY; maximumSupply = MAX_SUPPLY; currentDifficultyWei = 100 szabo; minimumDifficultyThresholdWei = 100 szabo; blockCreationRate = 50; difficultyAdjustmentPeriod = 2016; rewardAdjustmentPeriod = 210000; totalBlocksMined = 0; ...
2,478,629
./full_match/4/0x11b7d8077083211B3924d0AEF919BeB145D5D282/sources/kali.sol
cannot realistically overflow on human timescales
function init( string memory name_, string memory symbol_, string memory docs_, bool paused_, address[] memory extensions_, bytes[] memory extensionsData_, address[] memory voters_, uint256[] memory shares_, uint32 votingPeriod_, uint8[...
777,942
./partial_match/1/0x2336Fdd0F1109C14Fd565cfb1f83D8726736A087/sources/POTTER.sol
ERC-20 token interface
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 (uint256)...
16,112,724
./full_match/80001/0x79c1E01A9D9E0019d14Bf1Ef80eFA65A916A2B23/sources/project_/contracts/token/Token.sol
See {IToken-recoveryAddress}./
function recoveryAddress( address _lostWallet, address _newWallet, address _investorOnchainID ) external override onlyAgent returns (bool) { require(balanceOf(_lostWallet) != 0, "no tokens to recover"); IIdentity _onchainID = IIdentity(_investorOnchainID); bytes32...
5,587,484
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol
Reads the uint96 at `rdPtr` in returndata.
function readUint96( ReturndataPointer rdPtr ) internal pure returns (uint96 value) { assembly ("memory-safe") { returndatacopy(0, rdPtr, _OneWord) value := mload(0) } }
8,451,890
/** *Submitted for verification at Etherscan.io on 2021-04-03 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // pragma experimental ABIEncoderV2; contract Finance { /// @notice EIP-20 token name for this token string public constant name = "XAU.Finance"; /// @notice EIP-20 token symbol for...
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) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, ...
15,339,580
./full_match/80001/0x1aa09F04f3497ECb85433Dfbd815B4728b47a3eB/sources/@solvprotocol/erc-3525/IERC721.sol
ERC-721 Non-Fungible Token Standard Note: the ERC-165 identifier for this interface is 0x80ac58cd./
interface IERC721 is IERC165 { event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); fu...
9,505,091
// Sources flattened with hardhat v2.1.2 https://hardhat.org // File contracts/access/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 these are generally a...
Get rewards for one day stakedAmount Stake amount of the user stakedToken Staked token address of the user rewardToken Reward token address totalStake totalStakeAmount return reward One dayh reward for the user/
function getOneDayReward( uint256 stakedAmount, address stakedToken, address rewardToken, uint256 totalStake ) public view returns (uint256 reward) { uint256 lockBenefit; if (lockableDetailsB[stakedToken].optionableStatus) { stakedAmount = stakedAmount.mul(uniV2.optionableBenefit()); ...
14,901,422
./full_match/1/0x426D747337eF5DAeebbaecfAf4f79C69F7bcAeeA/sources/temp-contracts/scoring/ScoreByCMCPegged20.sol
Given a sum score corresponding to the total CMC of the top three non-WETH/WBTC elements (the three other elements that we want to include), returns a value corresponding to 20% of said sum for pegged weights./
function peggedScore(uint256 subscore) internal pure returns(uint256) { return (subscore.mul(20)).div(100e18); }
9,798,428
./partial_match/1/0x3ef36D53A168c44ed2Ec7a98129CA0308BC1AE45/sources/DigiDinarStableToken.sol
ERC20 interface/
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() external view returns (uint...
16,198,186
pragma solidity ^0.5.10; /** @title A contract for generating unique identifiers * * @notice A contract that provides an identifier generation scheme, * guaranteeing uniqueness across all contracts that inherit from it, * as well as the unpredictability of future identifiers. * * @dev This contract is i...
Requests an increase in the token supply, with the newly created tokens to be added to the balance of the specified account. Returns a unique lock id associated with the request. Anyone can call this function, but confirming the request is authorized by the custodian. NOTE: printing to the zero address is disallowed....
function requestPrint(address _receiver, uint256 _value) public returns (bytes32 lockId) { require(_receiver != address(0), "no null value for `_receiver`"); require(blocked[msg.sender] != true, "account blocked"); require(blocked[_receiver] != true, "_receiver must not be blocked"); ...
12,961,537
// File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually...
Updates the global staking rewards calculated to the latest block, may differ from the state read uses the _getStakingRewardsState function totalCommitteeWeight is the current committee total weight _settings is the contract settings return _stakingRewardsState is the updated global staking rewards struct
function _updateStakingRewardsState(uint256 totalCommitteeWeight, Settings memory _settings) private returns (StakingRewardsState memory _stakingRewardsState) { if (!_settings.rewardAllocationActive) { return stakingRewardsState; } uint allocatedRewards; (_stakingRewards...
450,190
//Address: 0xecfad7325b812e45ed07e0dbc7ef3f98f13fb4f5 //Contract name: ProofShrimpFarmer //Balance: 0 Ether //Verification Date: 6/5/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.21; // solhint-disable-line /* * One Proof Shrimp Farm * https://oneproof.net/games/shrimp * * Instead of having m...
Dev should initially seed the game before start
function seedMarket(uint256 eggs) public { initialized=true; marketEggs=eggs; }
6,379,304
./partial_match/1/0xB48077d89fa302B257f56aA01C7F86dd279B79F3/sources/contracts/GhostERC721Upgradeable/GERC721Upgradeable.sol
Returns whether `spender` is allowed to manage `tokenId`. Requirements: - `tokenId` must exist./
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = GERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); }
16,182,960
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "library.sol"; contract PausablePool is Context{ /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpau...
poolers claim premium USDTs;/ settle un-distributed premiums in rounds to _premiumBalance; premium balance modification transfer premium log
function claimPremium() external override whenPoolerNotPaused { _settlePooler(msg.sender); uint amountUSDTPremium = _premiumBalance[msg.sender]; USDTContract.safeTransfer(msg.sender, amountUSDTPremium); emit PremiumClaim(msg.sender, amountUSDTPremium); }
12,715,328
./partial_match/1/0xEC45E951BbC61dd83F7ced3e6a18fe4E22de5882/sources/OwnbitMultiSig.sol
0x9 is used for spendAnybe careful with any action, data is not included into signature computation. So any data can be included in spendAny.This is usually for some emergent recovery, for example, recovery of NTFs, etc.Owners should not generate 0x9 based signatures in normal cases.transfer tokens from this contract t...
function spendAny(address destination, uint256 value, uint8[] vs, bytes32[] rs, bytes32[] ss, bytes data) external { require(destination != address(this), "Not allow sending to yourself"); require(_validSignature(address(0x9), destination, value, vs, rs, ss), "invalid signatures"); spendNonce = spendNonce...
3,617,014
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./SuperbToken.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /** * @title Contract details * @author Raphael * @notice This contract is deployed with an ERC20 contract in order to set up...
return The total amount of token minted at the deployment /
function supplyInSale() public view returns (uint256) { return _supplyInSale; }
6,385,800
pragma solidity ^0.4.25; /******************************************************************************* * * Copyright (c) 2019 Decentralization Authority MDAO. * Released under the MIT License. * * ZeroFilters - A crowd-sourced database of "malicious / suspicious" endpoints * as reported ...
Get Info Retrieves the JSON-formatted, byte-encoded data stored at the location of `_dataId`./
function _getInfo( bytes32 _dataId ) private view returns (bytes info) { info = _zer0netDb.getBytes(_dataId);
15,819,306
// File: contracts/IRebaser.sol pragma solidity 0.5.16; interface IRebaser { function checkRebase() external; } // File: contracts/token/GovernanceStorage.sol pragma solidity 0.5.16; /* Copyright 2020 Compound Labs, Inc. Redistribution and use in source and binary forms, with or without modification, are per...
Computes the current max scaling factor/
function maxScalingFactor() external view returns (uint256) { return _maxScalingFactor(); }
15,276,737
./full_match/44787/0x82D062DE292987581e348a5Edb1011321DEA994B/sources/project_/contracts/CASProject.sol
Get project parameters bytesParams ( project_address: bytes(address) ) `projectAddress` parameter must be passed in bytes and opened in the contract as the required type return projectId Returns `projectId`, `startDate`, `endDate` of a given project return startDate Returns `projectId`, `startDate`, `endDate` of a...
function getProject(bytes[] memory bytesParams) external view returns(uint projectId, uint startDate, uint endDate) { address projectAddress = BytesLib.toAddress(bytesParams[0], 0); return (projects[projectAddress].projectId, projects[projectAddress].startDate, projects[projectAddress].endDate);...
13,263,959
./full_match/44787/0x635Cfb967a7B37957e7f9A71d8C681b2868f45Af/sources/contracts/CyberBoxMarketPlace.sol
Set partner address and profit share _tokenCreaterAddress Token creater address/ function setTokenCreaterAddressAndProfitShare(address _tokenCreaterAddress, uint8 _partnerSharePercentage) require( _partnerSharePercentage > 0 && _partnerSharePercentage <= 100, "Allowed percentage range is 1 to 100" ); partnerSh...
function setTokenCreaterAddressAndProfitShare(address _tokenCreaterAddress) external onlyDev { require(tokenCreaterAddress == address(0), "Owner can't change partner address once it's set"); require(_tokenCreaterAddress != address(0), "Can't set to address 0x0"); tokenCr...
13,254,383
pragma solidity 0.4.24; library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also t...
TODO to be implemented
function score(uint data) external returns (uint){ return data; }
15,852,168
/** *Submitted for verification at Etherscan.io on 2021-08-02 */ // File: @sygnum/solidity-base-contracts/contracts/helpers/Initializable.sol pragma solidity 0.5.12; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that ha...
Initialization instead of constructor, called once. The setWhitelistContract function can be called only by Admin role with confirmation through the whitelist contract. _whitelist Whitelist contract address. _baseOperators BaseOperators contract address./
function initialize(address _baseOperators, address _whitelist) public initializer { _setOperatorsContract(_baseOperators); _setWhitelistContract(_whitelist); }
2,087,946
/* * Origin Protocol * https://originprotocol.com * * Released under the MIT license * https://github.com/OriginProtocol/origin-dollar * * Copyright 2020 Origin Protocol, Inc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files ...
Allocate unallocated funds on Vault to strategies. Allocate unallocated funds on Vault to strategies./ Nothing in vault to allocate We have a method that does the same as this, gas optimisation We want to maintain a buffer on the Vault so calculate a percentage modifier to multiply each amount being allocated by to en...
function _allocate() internal { uint256 vaultValue = _totalValueInVault(); if (vaultValue == 0) return; uint256 strategiesValue = _totalValueInStrategies(); uint256 totalValue = vaultValue + strategiesValue; uint256 vaultBufferModifier; if (strategiesValue == 0) { ...
610,547
./partial_match/1/0x3Fdb3bd1ab409F0CBB2c4d919b2205ac881B99ED/sources/src/governor/Governor.sol
Hook after execution is triggered./
function _afterExecute(uint256, /* proposalId */ address[] memory, /* targets */ uint256[] memory, /* values */ bytes[] memory, /* calldatas */ bytes32 /*descriptionHash*/ ) internal virtual { if (_executor() != address(this)) { if (!_governanceCall.empty()) { _governanceCall.cle...
9,366,583
pragma solidity ^0.5.16; import "./interfaces/IBlockRewardHbbft.sol"; import "./interfaces/IKeyGenHistory.sol"; import "./interfaces/IRandomHbbft.sol"; import "./interfaces/IStakingHbbft.sol"; import "./interfaces/IValidatorSetHbbft.sol"; import "./upgradeability/UpgradeableOwned.sol"; import "./libs/SafeMath.sol"; ...
enum KeyGenMode { NotAPendingValidator, WritePart, WaitForOtherParts, WriteAck, WaitForOtherAcks, AllKeysDone } we know here that the validator is pending, but dit not have written the part yet. so he is allowed to write it's part. this mining address has written their part.
function getPendingValidatorKeyGenerationMode(address _miningAddress) public view returns(KeyGenMode) { if (!isPendingValidator(_miningAddress)) { return KeyGenMode.NotAPendingValidator; } (uint128 numberOfPartsWritten, uint128 numberOfAcksWritten) = k...
14,103,254
pragma solidity ^0.4.24; //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //============================================================================== contract F3Devents { // fired whenever a player registers a name event o...
withdraws all of your earnings. -functionhash- 0x3ccfd60b/ setup local rID grab time fetch player ID setup temp var for player eth check to see if round has ended and no one has run round end yet set up our tx event data end the round (distributes pot) get their earnings gib moni build event data fire withdraw and dist...
function withdraw() isActivated() isHuman() public { uint256 _rID = rID_; uint256 _now = now; uint256 _pID = pIDxAddr_[msg.sender]; uint256 _eth; if (_now > round_[_rID].end && round_[_rID].ended == false && roun...
611,231
pragma solidity 0.5.15; contract IAugur { function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA...
inject NONSTANDARD NAMING
function GETTOTALMIGRATED220() public view returns (uint256);
2,553,962
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; pragma experimental ABIEncoderV2; // import './interfaces/IFeSwapFactory.sol'; pragma solidity =0.6.12; interface IFeSwapFactory { event PairCreated(address indexed tokenA, address indexed tokenB, address pairAAB, address pairABB, uint); function feeT...
LIBRARY FUNCTIONS
function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { return FeSwapLibrary.quote(amountA, reserveA, reserveB); }
6,066,753
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.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 functions. * * By default, the owner account will be...
onWithdraw() is used to control fees and accessibility instead having an implementation in each farm contract Withdraw is only allowed, if farm is not paused. _amount tokens the user wants to withdraw return fee returns the withdraw fee (1e18 factor)/
function onWithdraw(uint256 _amount) external view override returns (uint256 fee) { require(!farms[msg.sender].paused, 'farm paused'); _amount; return 0; }
13,773,691
pragma solidity ^0.4.24; import '../../tokens/ERC677TokenContract.sol'; /** * @title Deed to hold RIF tokens in exchange for ownership of a node * * @dev The deed can be controlled only by the registrar and can only send tokens back to the owner. */ contract TokenDeed { address constant RESOURCE_POOL_ADDRESS...
Close a deed and refund a specified fraction of the bid value/
function destroyDeed() private { require(!active); if (tokenContract.transfer(owner, tokenQuantity)) { selfdestruct(RESOURCE_POOL_ADDRESS); } }
1,051,525
./full_match/42161/0xe805977D5Fa2f05e2175507a1f8E44Cd3F22972c/sources/code/contracts/oasis/OasisSwapRouter.sol
LIBRARY FUNCTIONS
function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { return OasisSwapLibrary.quote(amountA, reserveA, reserveB); }
16,308,718
./full_match/97/0x6b352845D9407B3AE6E74d61036EF8b7d3FdB752/sources/contracts/t-rex/compliance/DefaultCompliance.sol
See {ICompliance-isTokenAgent}./
function removeTokenAgent(address _agentAddress) external override onlyOwner { require(_tokenAgentsList[_agentAddress], "This Agent is not registered yet"); _tokenAgentsList[_agentAddress] = false; emit TokenAgentRemoved(_agentAddress); }
5,042,287
// SPDX-License-Identifier: agpl-3.0 pragma solidity >=0.4.22 <=0.6.12; import {WETH9} from '../dependencies/weth/WETH9.sol'; contract WCET9Mocked is WETH9 { constructor() public { name = 'Wrapped CET'; symbol = 'WCET'; } // Mint not backed by CET: only for testing purposes function mint(uint256 val...
Mint not backed by CET: only for testing purposes
function mint(uint256 value) public returns (bool) { balanceOf[msg.sender] += value; emit Transfer(address(0), msg.sender, value); }
12,800,436