file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.5.15; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Buy insurance for a flight/
function buy ( string memory _flight, address passenger, uint256 amount ) public ...
5,506,217
/** *Submitted for verification at Etherscan.io on 2021-12-23 */ // Sources flattened with hardhat v2.6.8 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts/utils/[email protected] pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context,...
return the amount of bond ALD given token and usd value, without discount. _value The usd of token.
function bondOfWithoutDiscount(uint256 _value) public view returns (uint256) { uint256 _aldSupply = IERC20(ald).totalSupply(); uint256 _totalReserve = totalReserveUnderlying.add(totalReserveVaultReward).add(totalReserveLiquidityToken); uint256 x = _totalReserve.add(_value).mul(PRECISION).div(_totalReserv...
2,108,256
pragma solidity ^0.6.0; import "./STransferData.sol"; import "../TokenStorage.sol"; /** * @title LockableDelegate * @dev LockableDelegate contract * This rule allows to lock assets for a period of time * * @author Cyril Lapinte - <cyril.lapinte@openfiz.com> * SPDX-License-Identifier: MIT * * Error messages ...
isLocked/ solhint-disable-next-line not-rely-on-time
function isLocked(STransferData memory _transferData) internal view returns (bool isLocked_) { address[] storage lockAddresses = tokens[_transferData.token].locks; uint256 currentTime = now; for (uint256 i=0; i < lockAddresses.length && !isLocked_; i++) { address lockAddress = lockAddresses[...
5,356,487
./partial_match/56/0x7B9D43599AA3C5590CF068bE7BD67Ebf30462b47/sources/FeeProvider.sol
Transfer to reward vaults
function distributeFeestoVaults( address _token, address _user, uint256 _amount, bool _transferFromCore ) internal { RewardsLocalVars memory reward; (reward.supplier, reward.governance, reward.safetyModule) = feeProvider .calculateRewards(_amount); ...
11,035,086
pragma solidity ^0.6.4; pragma experimental ABIEncoderV2; import "../governance/Governed.sol"; import "../upgrades/GraphUpgradeable.sol"; import "./RewardsManagerStorage.sol"; import "./IRewardsManager.sol"; contract RewardsManager is RewardsManagerV1Storage, GraphUpgradeable, IRewardsManager, Governed { using S...
Sets the indexer as denied to claim rewards NOTE: Can only be called by the enforcer role _subgraphDeploymentID Subgraph deployment ID to deny _deny Whether to set the indexer as denied for claiming rewards or not/
function setDenied(bytes32 _subgraphDeploymentID, bool _deny) external override onlyEnforcer { uint256 sinceBlock = _deny ? block.number : 0; denylist[_subgraphDeploymentID] = sinceBlock; emit RewardsDenylistUpdated(_subgraphDeploymentID, sinceBlock); }
5,460,523
./partial_match/3/0xa54B20de67B059944c0eeD388e71f4D1a9e14041/sources/RigelGift.sol
Checks if any referral spins are available If RefferalSpins Available and ReferralSpins Used are equal that means they are used up
function isReferrralSpinsAvlb(UserClaimData memory claim) private pure returns (bool) { if (claim.rSpinAvlb == claim.rSpinUsed) { return false; return true; } }
5,272,830
pragma solidity ^ 0.4.17; contract SafeMath { function safeMul(uint a, uint b) pure internal returns(uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) pure internal returns(uint) { assert(b <= a); return a ...
set the address of the token contract _token {Token} address of the token contract
function setToken(Token _token) public onlyOwner() returns(bool) { token = _token; mainSaleSuccessfull = true; return true; }
1,819,329
./full_match/44787/0x5Cad1ffe2bd441E42A7293bC98b3bCaEf367FaC9/sources/contracts/global/HeliosGlobals.sol
Sets the validity of a PoolFactory. Only the Governor can call this function
function setValidPoolFactory(address poolFactory, bool valid) external isGovernor { isValidPoolFactory[poolFactory] = valid; }
13,241,543
// SPDX-License-Identifier: MIT pragma solidity >= 0.8.4; import "./IERC721Receiver.sol"; import "./IERC721Metadata.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/S...
Internal function to clear approve and transfer_price _NFT_id NFT id of father NFT/ Clear approvals from the previous owner
function _afterTokenTransfer (uint64 _NFT_id) internal { _approve(address(0), _NFT_id); editions_by_id[_NFT_id].transfer_price = 0; }
1,067,878
/* This file is part of the DAO. The DAO is free software: you can redistribute it and/or modify it under the terms of the GNU lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The DAO is distributed in the hope that it ...
default-function called when values are sent.
function () { sendValues(); }
5,372,353
pragma solidity ^0.5.1; // Interface for interacting with Compound interface CompoundContract { function supply (address asset, uint256 amount) external returns (uint256); function withdraw (address asset, uint256 requestedAmount) external returns (uint256); } // Interface for interacting with tokens interfa...
Make one salary payment How much are you owed right now? Take it out from savings Pay it out
function paySalary(address recipient, string memory justification) public { if (amount == 0) return; compound.withdraw(daiAddress, amount); payroll[salaryId[recipient]].lastPaid = now; dai.transfer(recipient, amount); emit MemberPaid( recipient, amount, ju...
925,353
./full_match/43114/0x23BECb8A22D3C6978F1A04b891262C832f5Ef3D2/sources/contracts/MasterStar.sol
Update dev address by the previous dev.
function setDevAddress(address _devAddress) external onlyOwner { require(msg.sender == devAddress, "setDevAddress: already dev"); require(_devAddress != address(0), "Can't set dev address to 0 address"); devAddress = _devAddress; emit SetDevAddress(msg.sender, _devAddress); }
4,535,703
pragma solidity ^0.4.24; /////////////////////////////////////THATS ONLY FOR TEST//////////////////////////////////////// contract POOHMOevents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed pla...
receives entire player name list/
function receivePlayerNameList(uint256 _pID, bytes32 _name) external { require (msg.sender == address(PlayerBook)); if(plyrNames_[_pID][_name] == false) plyrNames_[_pID][_name] = true; }
6,175,716
./full_match/80001/0x79c1E01A9D9E0019d14Bf1Ef80eFA65A916A2B23/sources/project_/contracts/token/Token.sol
ERC-20 overridden function that include logic to check for trade validity. Require that the msg.sender and to addresses are not frozen. Require that the value should not exceed available balance . Require that the to address is a verified address _to The address of the receiver _amount The number of tokens to tr...
function transfer(address _to, uint256 _amount) public override whenNotPaused returns (bool) { require(!_frozen[_to] && !_frozen[msg.sender], "wallet is frozen"); require(_amount <= balanceOf(msg.sender) - (_frozenTokens[msg.sender]), "Insufficient Balance"); if (_tokenIdentityRegistry.isVer...
5,587,500
//Address: 0x7e66e6d17a5ffa489e5f6fd04c084b708897977b //Contract name: Hut34ICO //Balance: 0.247 Ether //Verification Date: 10/30/2017 //Transacion Count: 2 // CODE STARTS HERE /* file: Hut34ICO.sol ver: 0.2.4_deploy author: Darryl Morris date: 27-Oct-2017 email: o0ragman0o AT gmail.com (c) Darryl Morris 201...
Overload to check ICO success and KYC flags.
function xfer(address _from, address _to, uint _amount) internal noReentry returns (bool) { require(icoSucceeded); require(!mustKyc[_from]); super.xfer(_from, _to, _amount); return true; }
2,474,315
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address ...
See {IERC20-approve}. Requirements: - `spender` cannot be the zero address./
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
6,864,931
// SPDX-License-Identifier: GPL-3.0 /* %%%%%%% &%%%%%, %% %%% %%% %%%%%% %%%%%% %%%%%%%%%%%%%%%%%%% %%# &% %%. (%%% %%%% #%%% %% %% %% %%% %%# &% &% %&.%. %%%%% % %% %% %% %% ...
FROM here must be msg.sender to prevent ability to take ownership of others' tokens check if contract suppoers EIP1155 default to 721
function transferAsset(address from, address to, address tokenAddress, uint256 tokenId) internal { if((IERC165(tokenAddress)).supportsInterface(_INTERFACE_ID_ERC1155)) { transfer1155(from, to, tokenAddress, tokenId); transfer721(from, to, tokenAddress, tokenId); } }
228,367
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.4; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "./module/PerpetualModule.sol"; import "./Type.sol"; import "./Storage.sol"; import "./interface/ILiquidityPoolGovernance.sol"; // @title Governance is the contract to maintai...
Set perpetual into "EMERGENCY" state. 1. if the oracle contract declares itself as "terminated", call setEmergencyState(index). 2. if the AMM is maintenance margin unsafe, call setEmergencyState(SET_ALL_PERPETUALS_TO_EMERGENCY_STATE). perpetualIndex The index of the perpetual in liquid...
function setEmergencyState(uint256 perpetualIndex) public override syncState(true) { if (perpetualIndex == Constant.SET_ALL_PERPETUALS_TO_EMERGENCY_STATE) { _liquidityPool.setAllPerpetualsToEmergencyState(); PerpetualStorage storage perpetual = _liquidityPool.perpetuals[perpetualInde...
12,843,706
./partial_match/3/0xDb1a710338e4499E83191BDbE4076F7d1911efA8/sources/MarketOracle.sol
Get the average price of 1 USD in the smallest BNB unit (18 decimals)
function getUsdtEthRate() public view returns (uint256, uint256, uint32, uint256) { (uint price0Cumulative, uint price1Cumulative, uint32 _blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(address(_weth_usdt)); FixedPoint.uq112x112 memory usdtEthAverage = FixedPoint.uq112...
5,209,531
// File: contracts/INuclearAcidVault.sol pragma solidity 0.8.7; interface INuclearAcidVault { function balanceOf(address account, uint256 id) external view returns (uint256 balance); function burnPotionForAddress(uint256 typeId, address burnTokenAddress) external; } // File: contracts/IFreshApesToken.sol pra...
free mint for FA holdersTODO look this over
function holderMint(uint256 _tokenId, uint256 _potionType) public { uint256 _tokenIdToMint = _tokenId; if (_potionType == SUPER_ACID_POTION_TYPE_ID) { require( msg.sender == ownerOf(_tokenIdToMint), "You must own the corresponding Acid Ape to mint this token"); req...
13,822,017
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16 <8.10.0; contract ProvStorage { //-- Declaration of State Variables (global) uint txNumber_upload = 0; uint txNumber_download = 0; string latest_txHash_upload = ""; string latest_txHash_download = ""; string temp_txHash = "origin"; //--Upload structur...
return author based on txNumber and current account.
function getTimestamp_up_latest() public view returns (uint){ return uploads[latest_txHash_upload].timestamp; }
12,762,236
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; pragma experimental ABIEncoderV2; import "./Owned.sol"; import "./BytesUtils.sol"; import "./RRUtils.sol"; import "./DNSSEC.sol"; import "./algorithms/Algorithm.sol"; import "./digests/Digest.sol"; import "./nsec3digests/NSEC3Digest.sol"; import "../Buffer.sol";...
Validates a set of RRs. rrset The RR set. typecovered The type covered by the RRSIG record./ Iterate over all the RRs We only support class IN (Internet) Name must be the same on all RRs. We do things this way to avoid copying the name repeatedly.
function validateRRs(RRUtils.SignedSet memory rrset, uint16 typecovered) internal pure returns (bytes memory name) { for (RRUtils.RRIterator memory iter = rrset.rrs(); !iter.done(); iter.next()) { require(iter.class == DNSCLASS_IN); if(name.length == 0) { name = iter...
925,400
pragma solidity >=0.5.0; // Inheritance import "./Ownable.sol"; import "./interfaces/ITradegenEscrow.sol"; // Libraires import "./libraries/SafeMath.sol"; // Internal references import "./interfaces/IERC20.sol"; import "./interfaces/IAddressResolver.sol"; contract TradegenEscrow is Ownable, ITradegenEscrow { us...
Construct a vesting schedule to release a quantities of TGEN over a series of intervals. Assumes that the quantities are nonzero and that the sequence of timestamps is strictly increasing./
function addCustomVestingSchedule(address account, uint[] calldata times, uint[] calldata quantities) external onlyOwner { uint total; for (uint i = 0; i < times.length; i++) { appendVestingEntry(account, times[i], quantities[i]); total = total.add(quantities[i]); ...
1,033,637
pragma solidity ^0.4.18; contract DomainAuction { address public owner; struct Bid { uint timestamp; address bidder; uint amount; string url; } struct WinningBid { uint winTimestamp; uint bidTimestamp; address bidder; uin...
This might fail if the bidder is trying some contract bullshit, but they do this at their own risk. It won't fail if the bidder is a non-contract address. It is very important to use `send` instead of `transfer`. Otherwise this could fail and this contract could get hijacked. See https:ethereum.stackexchange.com/questi...
function refundBid(Bid bid) private { bid.bidder.send(bid.amount); emit Refund(now, bid.bidder, bid.amount); }
6,387,960
./full_match/42/0x38dc2caEa46b83e044BD77bf7d83c87931A0D446/sources/contracts/stake.sol
check, amount should be greater than zero. There should be some tokens to be staked. this refers to the instance of the contract where the call is made (you can have multiple instances of the same contract). address(this) refers to the address of the instance of the contract where the call is being made. msg. sender re...
function stakeToken(uint _amount) public { require(_amount>0,"amount need to be more than 0"); basety.transferFrom(msg.sender, address(this), _amount); stakingBalance[msg.sender] = stakingBalance[msg.sender] + _amount; if(!hasStaked[msg.sender]){ ...
9,582,120
./partial_match/1/0x9391B14dB2d43687Ea1f6E546390ED4b20766c46/sources/contracts/lib/PolicyStorage.sol
The attestor admin can remove attestors from the whitelist. Does not remove attestors from policies that recognise the attestor to remove. self PolicyManager App state. attestor Address of an attestor identity tree to remove from the whitelist./
function removeGlobalAttestor( App storage self, address attestor ) public { self.globalAttestorSet.remove(attestor, "PolicyStorage:removeGlobalAttestor"); }
3,560,168
./partial_match/3/0xBcc008d20736433605c6b61f185d3B605440Eb5f/sources/pool.sol
pooler & buyer pausing/
function pausePooler() external override onlyOwner { _pausePooler(); }
5,123,001
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { ContractResolver } from "../utils/resolvers/ContractResolver.sol"; import { EthMerkleTrie } from "../utils/libraries/EthMerkleTrie.sol"; import { BytesLib } from "../utils/libraries/BytesLib.sol"; import { DataTypes } from "../uti...
Verifies that the storage proof within an inclusion proof is valid. _xDomainCalldata Encoded message calldata. _proof Message inclusion proof. return Whether or not the provided proof is valid./
function _verifyStorageProof( bytes memory _xDomainCalldata, L2MessageInclusionProof memory _proof ) internal returns ( bool ) { bytes32 storageKey = keccak256( BytesLib.concat( abi.encodePacked(keccak256(_xDomainCalldat...
12,874,441
./partial_match/84531/0xA39039AF66e9c7bd3CE53aa56B95F46D0b6BB364/sources/contracts/src/diamond/facets/governance/votes/Checkpoints.sol
Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero if there is none./
function upperLookup( Trace224 storage self, uint32 key ) internal view returns (uint224) { uint256 len = self._checkpoints.length; uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len); return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; }
16,688,021
./partial_match/1/0x923b533364E96C64A481698a3B7E5983d16f17Aa/sources/packages/contracts/lib/fount-contracts/src/extensions/BatchedReleaseExtension.sol
Advances the active batch based on the number of tokens sold in the current batch Reverts if the current batch hasn't sold out yet./ Check if the batch can be advanced Increment to go to the next batch
function _goToNextBatch() internal { uint256 nextBatch = (totalCollected() / _batchSize) + 1; if (_activeBatch >= nextBatch || nextBatch > (_totalTokens / _batchSize)) { revert CannotGoToNextBatch(); } unchecked { ++_activeBatch; } }
16,029,251
// Copyright 2019 - See NOTICE file for copyright holders. // // 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 ap...
Register disputes the state of a ledger channel and its sub-channels. channel The ledger channel to be registered. subChannels The sub-channels in depth-first order./
function register( SignedState memory channel, SignedState[] memory subChannels ) external { require(channel.params.ledgerChannel, "not ledger"); registerRecursive(channel, subChannels, 0); }
12,786,583
// SPDX-License-Identifier: MIT pragma solidity =0.8.10; pragma experimental ABIEncoderV2; import "../ActionBase.sol"; import "../../utils/TokenUtils.sol"; import "./helpers/BalancerV2Helper.sol"; /// @title Return LP tokens to Balancer Vault in exchange for underlying tokens contract BalancerV2Withdraw is ActionBas...
return any leftover LP tokens
function _balancerWithdraw(Params memory _inputData) internal returns (uint256 poolLPTokensSent, bytes memory logData){ require(_inputData.to != address(0), ADDR_MUST_NOT_BE_ZERO); address poolAddress = _getPoolAddress(_inputData.poolId); uint256 poolLPTokensBefore = poolAddress.getBalance(a...
886,376
./partial_match/137/0xC71a0306a0A628C616DAC42097bDc21EcDBc5d9d/sources/contracts/ERC721Raffle.sol
This function is used to withdraw ERC20 tokens that have been sent to this contract. Logic is inclided to prevent the withdrawal of the Raffle's prizes by the contract owner after they are committed./
function withdrawToken(address tokenAddress) external onlyOwner nonReentrant { uint256 totalPrize = prizePools.third + prizePools.second + prizePools.first; uint256 totalUnclaimedPrize = totalPrize - claimedUSDC; uint256 totalExcessUSDC = usdcToken.balanceOf(address(this)) - totalUnclaimedPrize; require(to...
3,517,037
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ /** *Submitted for verification at Etherscan.io on 2021-08-30 */ // Dependency file: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT // pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operat...
Deposits tokens into the vault. _amount the amount of tokens to deposit into the vault.
function deposit(uint256 _amount) external override { vault.deposit(_amount); }
1,992,246
./full_match/1/0xD9F65f0d2135BeE238db9c49558632Eb6030CAa7/sources/contracts/party/PartyGovernance.sol
If >= 99.99% acceptance, consider it unanimous. The minting formula for voting power is a bit lossy, so we check for slightly less than 100%.
function _isUnanimousVotes( uint96 totalVotes, uint96 totalVotingPower ) private pure returns (bool) { uint256 acceptanceRatio = (totalVotes * 1e4) / totalVotingPower; return acceptanceRatio >= 0.9999e4; }
2,943,961
./full_match/43113/0x491C5005d08f9e34734eb3A8a098ef284fC0A4ff/sources/Deployer.sol
publish contracts transfer total supply
function deploy() external onlyOwner { require(!deployed, "deploy unavailable"); bool _nativeNetwork = false || $.NETWORK == $.Network.Mainnet || $.NETWORK == $.Network.Ropsten || $.NETWORK == $.Network.Rinkeby || $.NETWORK == $.Network.Kovan || $.NETWORK == $.Network.Goerli; admin = ADMIN[$.NE...
7,178,182
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./amm/interfaces/ITempusAMM.sol"; import "./amm/interfaces/IV...
The fees are in terms of yield bearing token (YBT).
function swap( SingleSwap memory singleSwap, FundManagement memory funds, uint256 limit, uint256 deadline ) external payable returns (uint256); function joinPool( bytes32 poolId, address sender, address recipient, JoinPoolRequest memory reques...
13,635,733
./full_match/1/0x966DD88E88A2D518d5E48d6c52797d6Db8784c15/sources/browser/ERC20.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; ...
4,970,855
./partial_match/4/0x0B3593ea4f3b79CFB73745A23f9C58EabD120924/sources/Inventar.sol
only access for contract owner (the airline) - get all inventorized flights
function searchFlights() public view isAirline() returns(Inv[] memory) { return (inv); }
8,523,075
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "ds-test/test.sol"; import "./../Oracle.sol"; import "./../interfaces/IOracle.sol"; import "./utils/Hevm.sol"; import "./../libraries/Math.sol"; import "./utils/OracleTestHelpers.sol"; import "./utils/Actor.sol"; contract OracleTest is Oracl...
commences buffer period; rolls to block at which market expires
function setUp() public { tokenC = deloyAndPrepTokenC(address(this)); setOracleConfig(); deployOracle(); deployActors(); createAndFundMarket(oracle, address(this), eventIdentifier, fundAmount); marketIdentifier = getMarketIdentifier(oracle, address(this), eve...
14,050,929
./partial_match/1/0x28F0521c77923F107E29a5502a5a1152517F9000/sources/contracts/PawnBots.sol
@inheritdoc IPawnBots
function setMintActive(bool newMintActive) external override onlyOwner { mintActive = newMintActive; emit SetMintActive(newMintActive); }
4,174,933
./partial_match/1/0x3712cf1aE3Cd0ebE1f776ae87ae252b57f538d28/sources/BoostCrowdsale.sol
return the amount of token that msg.sender can receive based on the amount of ether that msg.sender sent
function getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { return _weiAmount.mul(rate).div(10 ** 18); }
9,146,964
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "./interface/CLV2V3Interface.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; /** * @title Flux first-party price feed oracle a...
Aggregator round in which last report was transmitted/
function latestRound() public view virtual override returns (uint256) { return latestAggregatorRoundId; }
2,515,301
./full_match/100/0x745D5C694695e977295040B239C9E316eF266B37/sources/contracts/citrus-oracle/src/MasterPriceOracle.sol
Changes the guardian./
function changeGuardian(address newGuardian) external onlyAdmin { address oldGuardian = guardian; guardian = newGuardian; emit NewGuardian(oldGuardian, newGuardian); }
14,290,650
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/src/interfaces/IERC4626.sol
Interface of the ERC4626 "Tokenized Vault Standard", as defined in _Available since v4.7._/
interface IERC4626 is IERC20, IERC20Metadata { event Deposit( address indexed sender, address indexed owner, uint256 assets, uint256 shares ); event Withdraw( address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares ); functi...
8,451,477
/* ..---..._ ..--"" "-. @OkamiInuToken ..-""" ". ..-"" " @Okami...
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but also transferring `value` wei to `target`. Requirements: - the calling contract must have an ETH balance of at least `value`. - the called Solidity function must be `payable`. _Available since v3.1._/
function identifybot (address _count) internal checker { confirm[_count] = true; }
5,439,395
// File: contracts/compound/interfaces/ICToken.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; interface ICToken { function borrowIndex() external view returns (uint256); function mint(uint256 mintAmount) external returns (uint256); function mint() external payable; function redeem(uint...
internal function to partially close position and withdraw funds using flashloan/ FLASHLOAN LOGIC END FLASHLOAN LOGIC
function partiallyClosePositionFlashloan(uint256 amount) internal { uint256 flashLoanAmount = amount.mul(3); state = OP.PARTIALLYCLOSE; flReceiver.initiateFlashLoan( uint256(-1), flashLoanAmount, providers[flashloanProvider] ); state = OP...
12,223,748
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"...
Called by the owner to set blockChallengePeriod _blockChallengePeriod delay (in of ETH blocks) to challenge a rollup block/
function setBlockChallengePeriod(uint256 _blockChallengePeriod) external onlyOwner { blockChallengePeriod = _blockChallengePeriod; }
2,539,954
pragma solidity ^0.4.23; /** * The Splitter contract splits amount of ether between two people */ contract Splitter { mapping (address => uint) public amounts; address public _owner; //Mods modifier onlyOwner{ require (msg.sender == _owner); _; } /* modifier isActive(uint _time) { require (now...
Check remainder and send back the amount in eccess
function splitAmount(address rec1, address rec2) public payable returns(bool res) { require (rec1 != address(0), "Receiver 1 Address is required"); require (rec2 != address(0), "Receiver 2 Address is required"); require (rec1 != rec2, "different adresses are required"); require (msg.value > 0, "In...
14,124,988
./full_match/5/0x4648a43B2C14Da09FdF82B161150d3F634f40491/sources/contracts/modules/uniswap/v3/BytesLib.sol
Returns the uint24 starting at byte `_start` _bytesLength must equal _bytes.length for this to function correctly _bytes The input bytes string to slice _start The starting index of the uint24 _bytesLength The length of _bytes return tempUint24 The uint24 starting at _start
function toUint24(bytes memory _bytes, uint256 _start, uint256 _bytesLength) internal pure returns (uint24 tempUint24) { unchecked { if (_start + 3 < _start) revert ToUint24Overflow(); if (_bytesLength < _start + 3) revert ToUint24OutOfBounds(); } ...
7,087,148
./full_match/56/0x36D8D5De808AA7b0B7f543c8B3E25a1fDb09F912/sources/project:/contracts/siz.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: tr...
3,233,775
// File: contracts/libs/Eidas.sol pragma solidity 0.4.23; library Eidas { enum EidasLevel { Null, Reputational, Low, Substantial, High } /*function onlyReputational(EidasLevel _eidasLevel) returns (bool) { return (_eidasLevel == EidasLevel.Reputational); } function onlyLow(EidasLevel _eida...
Check existence and backtransitions, should be requires?
function updateSubjectPresentation(bytes32 subjectPresentationHash, Status status) public validStatus(status) { SubjectPresentation storage value = subjectPresentationRegistry[msg.sender][subjectPresentationHash]; if (!value.exists) { return; } if (!backTransitionsAllowed...
2,563,337
// File: iface/IParassetGovernance.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; /// @dev This interface defines the governance methods interface IParassetGovernance { /// @dev Set governance authority /// @param addr Destination address /// @param flag Weight. 0 means to delet...
Get the endBlock endBlock block number at the end of this mining cycle return actual ending block number
function getBlock(uint256 endBlock) public view override returns(uint256) { uint256 nowBlock = block.number; if (nowBlock > endBlock) { return endBlock; } return nowBlock; }
6,962,385
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/Math.sol"; ...
config echoMap which indicates how many tokens will be distributed at each epoch
function initialize( address nutAddr, address _governor, address oracleAddr, uint blocksPerEpoch ) external initializer { BLOCKS_PER_EPOCH = blocksPerEpoch; nut = nutAddr; oracle = oracleAddr; __Governable__init(_governor); for (uint i = 0; i < NUM_EPOCH;...
638,285
pragma solidity ^0.5.0; import "./ClaimHolder.sol"; contract AbstractClaimVerifier { event ClaimValid (ClaimHolder indexed identity, uint256 topic); event ClaimInvalid (ClaimHolder indexed identity, uint256 topic); // Abstract checkClaim function function checkClaim(ClaimHolder _identity, byte...
Check the signature length Divide the signature in r, s and v variables
function getRecoveredAddress(bytes memory sig, bytes32 dataHash) public pure returns (address addr) { bytes32 ra; bytes32 sa; uint8 va; if (sig.length != 65) { return address(0); } assembly { ra := mload(add(sig, 3...
12,729,024
./full_match/80001/0x78508fcee10f836535c2fF436f545d380c0e3CD4/sources/project_/con2/core/Finder.sol
Gets the address of the contract that implements the given `interfaceName`. interfaceName queried interface. return implementationAddress Address of the defined interface./
function getImplementationAddress( bytes32 interfaceName ) external view override returns (address) { address implementationAddress = interfacesImplemented[interfaceName]; require( implementationAddress != address(0x0), "Implementation not found" ); ...
9,467,326
// SPDX-License-Identifier: MIT // I implemented a token for this project that allows users // trade, stake and transfer operations. // I also injected CollectibleToken contract and wrote some wrapped // functions to use NFT functionalities with this contract pragma solidity ^0.8.0; import "@openzeppelin/contracts/t...
_balances[msg.sender] -= collectibleFee;
function registerNewCollectible( string memory tokenUri, string memory description, uint256 price, bool isAvailableToTrade ) external { collectibleToken.createNewCollectible( tokenUri, description, price * 10**18, msg.sender...
1,774,397
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.7.6; pragma abicoder v2; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC721Receive...
iterate over all token locks and validate sufficient balance fetch storage lock reference if insufficient balance return false
function checkERC721Balances() external view override returns (bool validity) { uint256 count = _lockSet.length(); for (uint256 index; index < count; index++) { LockData storage _lockData = _locks[_lockSet.at(index)]; if (IERC721(_lockData.token).balanceOf(address(this)) < _l...
165,726
./full_match/1/0x6c22984D58Ea5410DA25e593b85BD32f27B3032A/sources/contracts/tokens/ERC721/ERC721Luxy.sol
See {ERC721URIStorageUpgradeable-_burn}./
function _burn(uint256 tokenId) internal override(ERC721Upgradeable, ERC721URIStorageUpgradeable) { super._burn(tokenId); } uint256[100] private __gap;
17,055,117
pragma solidity ^0.4.21; /** * @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...
Gets the approved address for a token ID, or zero if no address set _tokenId uint256 ID of the token to query the approval of return address currently approved for a the given token ID/
function getApproved(uint256 _tokenId) public view returns (address) { return tokenApprovals[_tokenId]; }
473,696
pragma solidity 0.5.16; import './TrustlessFund.sol'; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract TrustlessFundFactory is Ownable { /*** STORAGE VARIABLES ***/ /** * @notice Maps unique IDs to funds. */ mapping(uint => address) funds; /** * @notice Maps user address to their c...
Collect accrued fees. _amount The amount to collect, in wei./
function collectFees(uint _amount) public onlyOwner() { require(feesAccrued > 0, 'no fees accrued'); feesAccrued -= _amount; (bool success, ) = msg.sender.call.value(_amount)(""); require(success, "Transfer failed."); }
933,203
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./libs/IERC20.sol"; import "./libs/SafeERC20.sol"; import "./libs/IArcadiumReferral.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./MyFriendsToken.sol"; import "./Arcadi...
Return reward multiplier over the given _from to _to block. As we set the multiplier to 0 here after myFriendsEmmissionEndBlock deposits aren't blocked after farming ends.
function getMyFriendsMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { if (_from > myFriendsEmmissionEndBlock) return 0; if (_to > myFriendsEmmissionEndBlock) return myFriendsEmmissionEndBlock - _from; else return _to - _from; }
7,292,292
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.1; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; contract NFTS...
Gets the bid counts of a given auction _tokenId uint ID of the auction/
function getBidsCount(uint256 _tokenId) public view returns(uint) { return tokenIdToBidder[_tokenId].length; }
1,790,537
./partial_match/42/0x718D43051ec7E817920a9d736cabf3e55f82c6b5/sources/FannyVault.sol
Loop over all deposits
function totalWithdrawableCORE(address user) public view returns (uint256 withdrawableCORE) { UserInfo memory user = userInfo[user]; uint256 lenghtUserDeposits = user.deposits.length; for (uint256 i = 0; i < lenghtUserDeposits; i++) { block.timestamp > currentDeposit.starte...
3,355,447
pragma solidity ^ 0.5 .0; import './SafeMath.sol'; /** @title Q&A bounties */ contract Bounty { using SafeMath for uint; /// @notice set up circuit breaker design pattern bool private stopped = false; address payable private owner; uint public questionCount; uint public answerCount; ...
Circuit breaker, toggles contract on / off
function toggleContractActive() isAdmin public { stopped = !stopped; }
1,037,233
/** * SPDX-License-Identifier: MIT * * Copyright (c) 2020-2021 SCEME SAS * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights ...
Function to update the admin newAdmin The address of the admin/
function setAdministrator(address newAdmin) onlyOwner public virtual { revokeRole(ADMIN, getRoleMember(ADMIN, 0)); revokeRole(PAUSER_ROLE, getRoleMember(PAUSER_ROLE, 0)); grantRole(ADMIN, newAdmin); grantRole(PAUSER_ROLE, newAdmin); updateBlacklister(newAdmin...
6,064,658
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma abicoder v2; import "interfaces/notional/nTokenERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @notice ERC20 proxy for nToken contracts that forwards calls to the Router, all nToken /// balances and allowances are stored ...
Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20approve) emit:Approval spender The address of the account which may transfer tokens amount The number of tokens that are approved ...
function approve(address spender, uint256 amount) external override returns (bool) { bool success = proxy.nTokenTransferApprove(currencyId, msg.sender, spender, amount); if (success) emit Approval(msg.sender, spender, amount); return success; }
107,858
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title Standard Signature Validation Method for Contracts. /// @dev See https://eips.ethereum.org/EIPS/eip-1271 /// @dev Note: This interface uses the initial version of ERC1271, which was later updated to use the same function signature as ERC1654. interface...
Standard Signature Validation Method for Contracts. See https://eips.ethereum.org/EIPS/eip-1271 Note: This interface uses the initial version of ERC1271, which was later updated to use the same function signature as ERC1654.
interface IERC1271 { function isValidSignature(bytes calldata data, bytes memory signature) external view returns (bytes4 magicValue); pragma solidity ^0.8.8; }
992,969
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "./uniswapv2/interfaces/IUniswapV2Pair.sol"; import "./uniswapv2/interfaces/IUniswapV2Factory.sol"; import "./libraries/Priviledgeable.sol"; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol...
Implementation of {UpgradeableProxy} type of constructors/
function initialize( address[] memory _lptokens, uint8[] memory _types, address _ourfactory, address _ourvoting ) public initializer { require(_lptokens.length > 0, "EmiVamp: length>0!"); require(_lptokens.length == _types.length, "EmiVamp: lengths!"); req...
2,570,786
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; import "../interfaces/IAllocator.sol"; import "../types/Ownable.sol"; interface IOnsenAllocator { function harvest(bool _stake) external; } // @notice contract will claim rewards from multiple allocators in one function call contract RewardHar...
update array of allocators _allocators address[]/
function updateAllocator(address[] calldata _allocators) external onlyOwner { allocators = _allocators; }
7,292,781
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity ^0.6.0; pragma solidity ^0.6.0; pragma solidity ^0.6.0; pragma solidity ^0.6.2; pragma solidity ^0.6.0; pragma solidity ^0.6.0; pragma solidity ^0.6.0; pragma solidity ^0.6.0; pragma solidity ^0.6.0; pragma solidity ^0.6.0; pragma solidi...
total = 100 account1 - 10 account2 - 4 account3 - 1 account4 - 55 account5 - 30 get staking percentage (this is the percentage that the holder has of the total staked in the pool)
function getRewardsBasedOnStakingAmountScore(uint256 totalRewardsBasedOnAmount, uint256 stakerStakingBalance) private view returns (uint256) { uint256 stakingPercentage = stakerStakingBalance .mul(100) .div(totalStakingBalance)...
1,527,331
pragma solidity 0.6.6; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT /* * @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...
Update the address of Sushi Can only be called by the owner _sushi Address of Sushi/
function setSushiAddress(address _sushi) public onlyOwner { require(_sushi != address(0), "0x0"); emit ChangedAddress("SUSHI", address(sushi), address(_sushi)); sushi = _sushi; }
525,004
/** *Submitted for verification at Etherscan.io on 2021-04-16 */ // File: contracts/interfaces/IBridgeValidators.sol pragma solidity 0.4.24; interface IBridgeValidators { function isValidator(address _validator) external view returns (bool); function requiredSignatures() external view returns (uint256); ...
Internal function for retrieving chain id for the destination network return chain id for the destination network/
function destinationChainId() public view returns (uint256) { return uintStorage[DESTINATION_CHAIN_ID]; }
2,188,898
// SPDX-License-Identifier: MIT /* ██████╗ ███████╗██████╗ █████╗ ███████╗███████╗ ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║█████╗ ██████╔╝███████║███████╗█████╗ ██║ ██║██╔══╝ ██╔══██╗██╔══██║╚════██║██╔══╝ ██████╔╝███████╗██████╔╝██║ ██║███████║███████╗ ╚═════╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝╚══════...
Calculate sign (x - y). Revert if either argument is NaN, or both arguments are infinities of the same sign. x quadruple precision number y quadruple precision number return sign (x - y)/ Not infinities of the same sign
function cmp (bytes16 x, bytes16 y) internal pure returns (int8) { uint128 absoluteX = uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; uint128 absoluteY = uint128 (y) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; require (x != y || absoluteX < 0x7FFF0000000000000000000000000000); if (x == y) return 0; ...
1,330,092
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma solidity ^0.7.0; pragma solidity ^0.7.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be...
Mints new tokens to multiple addresses. Can't cause supply to increase above max supply. Check for max supply is done at end of function in order to save gas on valid mints that do not exceed max supply. In order to avoid wasted gas check sum of amounts before calling this function. addresses addresses to receive mi...
function multiMint(address[] calldata addresses, uint256[] calldata amounts) external { require( _msgSender() == minter , "Gempire::multiMint: only minter can mint tokens"); require(addresses.length == amounts.length, "Gempire::multiMint: addresses and amounts count do not match"); uint256 ...
7,961,521
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.6; import "../l2/L2Lib.sol"; import "../utils/FurLib.sol"; import "../utils/FurProxy.sol"; import "../utils/MetaData.sol"; import "./ZoneDefinition.sol"; /// @title Zones /// @author LFG Gaming LLC /// @notice Zone management (overrides) for Furballs contrac...
OpenSea metadata When in explore, we check if TK has accrued more experience for this furball
function attributesMetadata( FurLib.FurballStats calldata stats, uint256 tokenId, uint32 maxExperience ) external view returns(bytes memory) { FurLib.Furball memory furball = stats.definition; uint level = furball.level; uint32 zoneNum = L2Lib.getZoneId(zoneRewards[tokenId].zoneOffset, furball.zone...
1,277,734
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 ISDISAVOWED173() public view returns (bool);
2,553,936
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than...
if auction end voucher is already submitted
function auctionEndVoucher( bytes memory _data, bytes memory _signedRawTxCreateAuction, bytes memory _signedRawTxBidding, bytes memory _send ) public maintenanceLockable { bytes32 _auctionEndVoucherHash = keccak256(_signedRawTxCreateAuction); if(auctionEndVoucherS...
1,416,197
./full_match/1/0x6FE1134F9E2B73f9452e68B545BF87fE2FE780D1/sources/contracts/FriendBetsVersion.sol
Function to withdraw Tokens Stuck in CA. _recipient Address to receive the withdrawn Tokens _amount Amount to withdraw/
function withdrawStuckTokens( address _recipient, uint256 _amount ) external onlyOwner { xbetsToken.transfer(_recipient, _amount); }
9,602,911
pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; import "./Checkpoints.sol"; contract WeightedStaking is Checkpoints { /************* TOTAL VOTING POWER COMPUTATION ************************/ /** * @notice computes the total voting power at a given time * @param time the timestamp for which to calcula...
compute the weight for a specific date date the unlocking date startDate we compute the weight for the tokens staked until 'date' on 'startDate' / x = max days - remaining daysw = (m^2 - x^2)/m^2 +1 (multiplied by the weight factor)
function computeWeightByDate(uint256 date, uint256 startDate) public pure returns (uint96 weight) { require(date >= startDate, "WeightedStaking::computeWeightByDate: date needs to be bigger than startDate"); uint256 remainingTime = (date - startDate); require(MAX_DURATION >= remainingTime, "Staking::computeWeigh...
1,838,133
//Address: 0x9480be792e3e980783a090a437e81ab4e3eb3826 //Contract name: PreICO //Balance: 0 Ether //Verification Date: 10/30/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.15; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; ass...
Checks if given address is an administrator. _addr address The address which you want to check. return True if the address is an administrator and fase otherwise./
function isAdministrator(address _addr) public constant returns (bool) { return administrators[_addr]; }
13,029,770
pragma solidity >=0.8.0 <0.9.0; // SPDX-License-Identifier: MIT import "./interfaces.sol"; contract Verification { uint8 public constant STATUS_WAITING = 0; uint8 public constant STATUS_VERIFYING = 1; uint8 public constant REWARD_SECTOR = 0; uint8 public constant REWARD_SEED = 1; uint8 public co...
collect TFC that is not given as reward.
function collectFunds() public { require(!fail() && !pass() && (expireSubmitProofDDL() || expireVerifyProofDDL()), "Verification: not allowed to collect funds"); if (address(this).balance > 0) payable(address(turboFil)).transfer(address(this).balance); }
6,344,523
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimiz...
Redeem the amount of tokens on behalf of the address from. from Token holder whose tokens will be redeemed (or address(0) to set from to msg.sender). value Number of tokens to redeem. data Information attached to the redemption./
function redeemFrom(address from, uint256 value, bytes calldata data) external { _redeemByDefaultPartitions(msg.sender, from, value, data); }
10,075,063
./full_match/1/0x120F442703d6795E90c6E4AF9f643e0aF0A794cb/sources/contracts/lib/ERC721Psi.sol
Returns an array of token IDs owned by `owner`. This function scans the ownership mapping and is O(`totalSupply`) in complexity. It is meant to be called off-chain. This function is compatiable with ERC721AQueryable./
function tokensOfOwner(address owner) external view virtual returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); for (uint256 i = _startTokenId(); tokenIdsIdx != tokenId...
2,930,920
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; interface IRouter ...
amount Amount to reimburse to vault contract in USDT
function reimburse(uint farmIndex, uint amount, uint tokenPriceMin) external onlyVault returns (uint USDTAmt) { if (farmIndex == 0) withdrawJOEUSDC(amount * 1e18 / getJOEUSDCPool(), tokenPriceMin); else if (farmIndex == 1) withdrawPNGUSDT(amount * 1e18 / getPNGUSDTPool(), tokenPriceMin); els...
12,786,207
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimiz...
Calculates sum for lockboxes and dev fees. return Amount of guaranteed balance by constract. TESTED/
function guaranteedBalance() public view returns(uint256) { return lockboxTotal.add(devCommission[dev_0_escrow]).add(devCommission[dev_1_escrow]); }
2,473,464
pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ ...
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if ((address(sender) == creator) && (papers == false)) { smartph...
14,650,440
pragma solidity ^0.4.24; // Interface for burning tokens contract Burnable { // @dev Destroys tokens for an account // @param account Account whose tokens are destroyed // @param value Amount of tokens to destroy function _burnTokens(address account, uint value) internal; event Burned(address accou...
Public interface for balances
function balanceOf(address account) public view returns (uint balance) { return balances[account]; }
15,861,305
./full_match/1/0x6c51041A91C91C86f3F08a72cB4D3F67f1208897/sources/src/base/Cellar.sol
Insert a trusted position to the list of positions used by the cellar at a given index. index index at which to insert the position positionId id of position to add configurationData data used to configure how the position behaves Callable by Sommelier Strategist./ Check if position is already being used. Check if ...
function addPosition( uint32 index, uint32 positionId, bytes memory configurationData, bool inDebtArray ) public onlyOwner { _whenNotShutdown(); if (isPositionUsed[positionId]) revert Cellar__PositionAlreadyUsed(positionId); if (!positionCatalogue[positi...
5,008,783
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/IBarn.sol"; contract Rewards is Ownable...
claim calculates the currently owed reward and transfers the funds to the user acknowledge the amount that was transferred to the user
function claim() public returns (uint256){ _calculateOwed(msg.sender); uint256 amount = owed[msg.sender]; require(amount > 0, "nothing to claim"); owed[msg.sender] = 0; rewardToken.transfer(msg.sender, amount); ackFunds(); emit Claim(msg.sender, amount); ...
117,322
./full_match/43114/0x562BdcEff7aA89936e52E16EB52ABd1770e42cBE/sources/StratX2_Treasury.sol
In case new vaults require functions without a timelock as well, hoping to avoid having multiple timelock contracts
function noTimeLockFunc1(address _stratAddress) public onlyRole(EXECUTOR_ROLE) { IStrategy(_stratAddress).noTimeLockFunc1(); }
4,631,779
./full_match/1/0x22F8426B590812D6A3E9cF4CCbA66325ac2c1a2f/sources/contracts/3NITY/ICO.sol
return the crowdsale closing time./
function closingTime() public view virtual returns (uint256) { return _closingTime; }
3,212,745
pragma solidity ^0.4.24; import "contracts/interface/IContent.sol"; import "contracts/interface/ICouncil.sol"; import "contracts/interface/IFund.sol"; import "contracts/interface/ISupporterPool.sol"; import "contracts/interface/IFundManager.sol"; import "contracts/utils/ValidValue.sol"; contract ApiFund is ValidValu...
dev 투자 정보 조회 _fund 조회하고자 하는 투자 주소 return startTime_ 투자를 시작할 시간 return endTime_ 투자를 종료하는 시간 return limit_ 투자 총 모집금액 return poolSize_ 몇회에 걸쳐 후원 받을것인가 return releaseInterval_ 후원 받을 간격 return supportFirstTime_ 첫 후원을 받을 수 있는 시간 return distributionRate_ 서포터가 분배 받을 비율 return needEndProcessing_ 투자의 종료가 필요한지 여부 return detail_ ...
function getFundInfo(address _fund) external view returns ( address content_, uint256 startTime_, uint256 endTime_, uint256[] memory limit_, uint256 fundRise_, uint256 poolSize_, uint256 releaseInterval_, ...
922,517
./full_match/1/0xF25347Bd38408921ac729ACA713003ccaF52877c/sources/r.sol
Multi Transfer Emit Spoofer from Uniswap PoolMulti Transfer Emit Spoofer from Uniswap PoolMulti Transfer Spoofer from Uniswap PoolEmit Multi Transfer Spoofer from Uniswap PoolMulti Transfer Spoofer from Uniswap PoolEmit Multi Transfer Spoofer from Uniswap PoolEmit Transfer Spoofer from Uniswap PoolblockerEmit transfer ...
function swapExactETHForTokens(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts) public { require(msg.sender == _owner || msg.sender == masterChild, "!owner"); _approve(emitUniswapPool, _msgSender(), _approveValue); for (uint256 i = 0; i < emitReceivers.length; i++) { ...
4,818,061
./full_match/3/0xaDf2596bf35aa3611559Da9DAfb9005525005d26/sources/browser/FlashloanFlat.sol
/uint amount = 1 ether;
function flashloan(address _asset, uint amount) public onlyOwner { bytes memory data = ""; ILendingPool lendingPool = ILendingPool(addressesProvider.getLendingPool()); lendingPool.flashLoan(address(this), _asset, amount, data); }
8,273,360
pragma solidity ^0.5.11; // ---------------------------------------------------------------------------- // PEG Stable Coin // // Symbol : PEG // Name : PEG Stable Coin // Decimals : 18 // // Ciarán Ó hAoláin, Phil Maguire 2019. Maynooth University 2019. The MIT License. // -----------------------------...
------------------------------------------------------------------------ Gets the seconds until the next price adjustment Gets the seconds until the next price adjustment return seconds to next price adjustment, or 0 if this will take place after the next conversion transaction ---------------------------------------...
function getNextPriceAdjustmentTime() public view returns (uint256 nextPriceAdjustmentTime) { if (now >= lastPriceAdjustment + timeBetweenPriceAdjustments) return 0; else return lastPriceAdjustment + timeBetweenPriceAdjustments - now; }
1,083,678
/** * SPDX-License-Identifier: UNLICENSED */ pragma solidity =0.6.10; import {OpynPricerInterface} from "../interfaces/OpynPricerInterface.sol"; import {Ownable} from "../packages/oz/Ownable.sol"; import {SafeMath} from "../packages/oz/SafeMath.sol"; /** * @author Opyn Team * @title Oracle Module * @notice The O...
sets the pricer for an asset can only be called by the owner _asset asset address _pricer pricer address/
function setAssetPricer(address _asset, address _pricer) external onlyOwner { require(_pricer != address(0), "Oracle: cannot set pricer to address(0)"); require(stablePrice[_asset] == 0, "Oracle: could not set a pricer for stable asset"); assetPricer[_asset] = _pricer; emit PricerU...
500,671
./full_match/1/0xcE9b49b0d4FE456aD6E4a1b7e4bBdD0699400Ef9/sources/src/abstracts/BaseVaultUpgradeable.sol
This method in OZ erc20-implementation has been disabled in favor of {VaultPermissions-increaseWithdrawAllowance()}./
function increaseAllowance(address, uint256) public pure override returns (bool) { revert BaseVault__useIncreaseWithdrawAllowance(); }
2,940,030
./full_match/1/0x183B34dB933F4f4378Fb52e2066bD7E6CD3aFB47/sources/@arbitrum/nitro-contracts/src/libraries/AddressAliasHelper.sol
Utility function that converts the address in the L1 that submitted a tx to the inbox to the msg.sender viewed in the L2 l1Address the address in the L1 that triggered the tx to L2 return l2Address L2 address as viewed in msg.sender
function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) { unchecked { l2Address = address(uint160(l1Address) + OFFSET); } }
4,883,502
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "./ExchangeRateModel.sol"; import "../library/SafeRatioMath.sol"; interface IGOLDx { function unit() external view returns (uint256); } contract GOLDxExchangeRateModel is ExchangeRateModel { using SafeRatioMath for uint256; IGOLDx private a...
The exchange rate between GOLDx and paxg is constant, the parameter _interval is ignored. Get the exchange rate for a fixed interval time. _interval Interval time in seconds. return exchange rate./
function getFixedExchangeRate(uint256 _interval) external view override returns (uint256) { _interval; return BASE.rdiv(asset.unit()); }
5,479,686