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.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. ...
Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountB...
97,494
./partial_match/1/0x4ea90065FFE6b28DE07B50046bff10370a0bf51A/sources/AntiBotBABYTOKEN.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20MetadataUpgradeable is IERC20Upgradeable { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } }
2,616,448
/** *Submitted for verification at Etherscan.io on 2021-07-18 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0 <0.9.0; contract HamsterTigerHype { // структура пользователя, куда заносится информация о депозите пользователя, времени его инвестов и проверка на участие в программе struct User {...
Добовляем инвестора в список
function addInvestor(address payable investor) internal returns (uint) { index = getIndex(1); investors[index] = investor; return index; }
7,859,986
/*** * 888b d888 8888888 * 8888b d8888 888 * 88888b.d88888 ...
remove limits after token is stable - 30-60 minutesgasLimitActive = false;
function removeLimits() external onlyOwner returns (bool){ limitsInEffect = false; transferDelayEnabled = false; return true; }
230,951
./full_match/44787/0x912350276e12eB7aa8d3f60eF9525bd5f4620825/sources/project_/contracts/swappa/PairUniswapV3.sol
get the populated ticks at, above, and below the current word
function getSpotTicks2(IUniswapV3Pool pool) public view returns ( uint160 sqrtPriceX96, int24 tick, uint128 liquidity, int16 tickBitmapIndex, TickLens.PopulatedTick[] memory populatedTicksAbove2, TickLens.PopulatedTick[]...
13,289,985
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "./b...
@inheritdoc ITransmuterV2
function deposit(uint256 amount, address owner) external override nonReentrant { _onlyWhitelisted(); _updateAccount( UpdateAccountParams({ owner: owner, unexchangedDelta: SafeCast.toInt256(amount), exchangedDelta: 0 }) ); TokenUtils.safeTransferFrom(syntheticToken, ...
157,535
pragma solidity 0.4.18; // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGro...
Add new order Update next order to point back to added order
function addAfterValidId( address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId ) private returns(bool) { Order storage prevOrder = orders[prevId]; orders[orderId].maker = maker; orders[orderId].pre...
6,811,524
./partial_match/1/0xDb21022608879Dc1E41f21fEB3f0019137A05Db8/sources/RealitioArbitratorProxy.sol
A timeout of 0 makes no sense, and we will use this to check existence The arbitrator can set a fee for asking a question. This is intended as an anti-spam defence. The fee is waived if the arbitrator is asking the question. This allows them to set an impossibly high fee and make users proxy the question through them. ...
function _askQuestion(bytes32 question_id, bytes32 content_hash, address arbitrator, uint32 timeout, uint32 opening_ts) stateNotCreated(question_id) internal { require(timeout > 0, "timeout must be positive"); require(timeout < 365 days, "timeout must be less than 365 days"); ...
4,396,995
pragma solidity ^0.5.11; import "./DonateTokenInterface.sol"; import "./EIP20Interface.sol"; import "./CTokenInterface.sol"; import "./UniswapFactoryInterface.sol"; import "./KyberNetworkProxyInterface.sol"; import "./TokenswapInterface.sol"; /** * @dev Implementation of Growdrop. from creating growdrop to starting,...
Investor refunds ERC20 token to Growdrop by Growdrop's identifier. Refunding CToken amount should be bigger than 0. Refunding amount calculated as CToken should be smaller than investor's funded amount calculated as CToken by Growdrop's identifier. Can refund only after started and before ended. Emits {GrowdropAction} ...
function Redeem(uint256 _GrowdropCount, uint256 Amount) public { require(GrowdropStart[_GrowdropCount], "not started"); require(now<GrowdropEndTime[_GrowdropCount], "already ended"); uint256 _exchangeRateCurrent = CToken[_GrowdropCount].exchangeRateCurrent(); uint256 _ctoken; ...
7,299,678
./full_match/5/0x393f13d4A7A82c71d0926751CF897E1a1c588C35/sources/contracts/data/DataStore.sol
delete the uint value for the given key key the key of the value
function removeUint(bytes32 key) external onlyController { delete uintValues[key]; }
11,589,348
./partial_match/3/0x863534bDC6e93d0D0e5a67293CBf1636E1Fc984d/sources/UtilityTokenETHOnly.sol
overall balance (in this case - eth)/
function _reserveTokenBalance() internal view virtual override returns(uint256) { return address(this).balance; }
5,247,335
./full_match/1/0x94D9326Dc82D36895Bb9ED498e611587CbD07253/sources/contracts/NFTStaking.sol
Unstake function, user claims the rewards as he/she unstakes tokenIds List of token IDs to unstake/ Additional check to ensure transfer does not fail and user gets balance rewards if shortage
function withdraw(uint256[] calldata tokenIds) external nonReentrant { _creditRewards(); StakesMeta storage stakesMeta = stakeMap[_msgSender()]; require(stakesMeta.stakes.length > 0, "N: No stakes"); uint256 rewardsPen; uint256 rewards; uint256 nowTS = block.timestam...
9,632,455
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract TestStaking is Ownable { ...
must be staker transfer NFT out reward user remove NFT
function unstakeNFT(uint256 _stakeID) external { NFTInfo storage nft = nftStakingList[_stakeID]; UserInfo storage user = userList[msg.sender]; require(nft.staker == msg.sender, "not owner"); NFT.transferFrom(address(this), msg.sender, nft.tokenID); user.rewardAmount += _re...
1,761,958
pragma solidity ^0.5.16; import "./AToken.sol"; import "./PriceOracle.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./XAIControllerStorage.sol"; import "./XAIUnitroller.sol"; import "./XAI/XAI.sol"; interface ComptrollerImplInterface { function protocolPaused() external view returns (boo...
The sender liquidates the xai minters collateral. The collateral seized is transferred to the liquidator. borrower The borrower of xai to be liquidated aTokenCollateral The market in which to seize collateral from the borrower repayAmount The amount of the underlying borrowed asset to repay return (uint, uint) An e...
function liquidateXAI(address borrower, uint repayAmount, ATokenInterface aTokenCollateral) external nonReentrant returns (uint, uint) { require(!ComptrollerImplInterface(address(comptroller)).protocolPaused(), "protocol is paused"); uint error = aTokenCollateral.accrueInterest(); if (error...
14,096,036
./full_match/1/0x86cf5A90aDFF0E5d8B817989A47c36F3F56134ED/sources/contracts/tokens/BaseToken.sol
to help users who accidentally send their tokens to this contract
function withdrawToken(address _token, address _account, uint256 _amount) external override onlyGov { IERC20(_token).safeTransfer(_account, _amount); }
3,170,905
pragma solidity >=0.4.22 <0.6.0; import './SafeMath.sol'; interface ERC20Interface { function allowance(address, address) external view returns (uint); function balanceOf(address) external view returns (uint); function approve(address, uint) external; function transfer(address, uint) external returns ...
get uniswap DAI exchange/ ude = 0x09cabEC1eAd1c0Ba254B09efb3EE13841712bE14; Proxy Address
function getUniswapDAIExchange() public pure returns (address ude) { }
6,450,531
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "hardhat/console.sol"; contract TimeTravellersNFT is ERC721URIS...
IdToTweet[currentId] = Tweet(currentId, _tokenURI, _account);
function mintTweet(address _account, string memory _tokenURI) external onlyRole(MINTER_ROLE) returns (uint256) { _tokenCounter.increment(); uint16 currentId = uint16(_tokenCounter.current()); _setTokenURI(currentId, _tokenURI); arrayOffAllTweets.push(Tweet...
12,961,916
./partial_match/1/0x3c9554Cd41290B7e660e2B21f0e815eCF34CE406/sources/DividendsTokenCustomAntiBotLaunchBlockBurnVotes.sol
OpenZeppelin Contracts (last updated v4.5.0) (governance/utils/IVotes.sol) Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts. _Available since v4.5._/
interface IVotes { event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); function getVotes(address account) external view returns (uint256); functio...
2,778,738
//SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./CommitmintToken.sol"; contract TokenOfFriendship is CommitmintToken { // Counter. using Counters for Counters.Counter; Counters.Co...
Public offer.
function offer(address to) external nonReentrant { _tokens.increment(); uint256 tokenId = _tokens.current(); _offers[tokenId] = to; _safeMint(_msgSender(), tokenId); emit Offer(_msgSender(), to, tokenId); }
5,503,028
// SPDX-License-Identifier: MIT pragma solidity >=0.8.6 <0.9.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./libs/String.sol"; import "./libs/Bytes32.sol"; /** * @dev NFT Regi...
Executes external contract call. Returns data returned from the external contract if the call was successful, otherwise reverts. to - The address of the external contract being called value - The value of Ether to transfer gasTo - The amount gas allowed for the external contract data - The call data/ call exter...
function _executeCall( address to, uint256 value, uint256 gasTo, bytes memory data ) private { assembly { let result := call(gasTo, to, value, add(data, 0x20), mload(data), 0, 0) let pos := mload(0x40) let len := returndatasize() mstore(0x40, add(pos, len)) returnd...
6,358,103
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract FunctionContract { // public external internal private // view pure uint public walletBalance; string message = "Basic text"; // call function getBalance() public view returns(uint) { return address(this).balan...
transactionreturn message; transaction func not return data!
function setMessage(string memory newMessage) external { message = newMessage; }
1,777,986
./full_match/1/0xa205D797243126F312aE63bB0A5EA9A32FB14f41/sources/browser/NEW_LAUNCH_MAINNET.sol
Function to get the balance to claim of user in TOKEN. account - user address. return balance to claim./
function getBalanceToClaimTokens(address account) public view returns (uint256) { return _balancesToClaimTokens[account]; }
3,084,285
// SPDX-License-Identifier: Apache-2.0 /* * Copyright 2021, Offchain Labs, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * *...
Can only force-include after the Sequencer-only window has expired. Verify that message hash represents the last message sequence of delayed message to be included
function forceInclusion( uint256 _totalDelayedMessagesRead, uint8 kind, uint256[2] calldata l1BlockAndTimestamp, uint256 inboxSeqNum, uint256 gasPriceL1, address sender, bytes32 messageDataHash, bytes32 delayedAcc ) external { require(_tota...
12,105,080
./full_match/5/0x1209F47b4b2fc869DfC1600d4CAb29F9eB87a112/sources/contracts/discovery/SubgraphNFT.sol
Internal: Set the token descriptor contract used to create the ERC-721 metadata URI. _tokenDescriptor Address of the contract that creates the NFT token URI/
function _setTokenDescriptor(address _tokenDescriptor) internal { require( _tokenDescriptor == address(0) || Address.isContract(_tokenDescriptor), "NFT: Invalid token descriptor" ); tokenDescriptor = ISubgraphNFTDescriptor(_tokenDescriptor); emit TokenDescript...
11,607,103
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * @title OVM_DeployerWhitelist * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts * which are allowed to depl...
Updates the owner of this contract. _owner Address of the new owner./ Prevent users from setting the whitelist owner to address(0) except via enableArbitraryContractDeployment. If you want to burn the whitelist owner, send it to any other address that doesn't have a corresponding knowable private key.
function setOwner(address _owner) public onlyOwner { require( _owner != address(0), 'OVM_DeployerWhitelist: whitelist can only be disabled via enableArbitraryContractDeployment' ); emit OwnerChanged(owner, _owner); owner = _owner; }
12,598,670
./partial_match/1/0x21fC96B8C0d429820bcD03872083Bf8B1A0970eb/sources/TokenSale.sol
Get the total USDT raised return The total USDT raised/
function getTotalRaisedUSDT() public view returns (uint256) { return totalRaisedUSDT; }
9,408,741
// SPDX-License-Identifier: MIT pragma solidity ^0.6.10; interface IProviderModuleGnosisSafeProxy{ event LogProvideProxyExtcodehash(bytes32 indexed extcodehash); event LogUnprovideProxyExtcodehash(bytes32 indexed extcodehash); event LogProvideMastercopy(address indexed mastercopy); event LogUnprovideM...
GnosisSafeProxy Batch (un-)provide
interface IProviderModuleGnosisSafeProxy{ event LogProvideProxyExtcodehash(bytes32 indexed extcodehash); event LogUnprovideProxyExtcodehash(bytes32 indexed extcodehash); event LogProvideMastercopy(address indexed mastercopy); event LogUnprovideMastercopy(address indexed mastercopy); function provi...
1,004,608
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.6; import "@openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorSettingsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorVote...
Read the voting weight from the token's built in snapshot mechanism (see {IGovernor-getVotes})./
function getVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) { return token.getPriorVotes(account, blockNumber); } uint256[50] private __gap;
636,946
/** *Submitted for verification at Etherscan.io on 2022-02-26 */ pragma solidity ^0.8.12; pragma experimental ABIEncoderV2; // SPDX-License-Identifier:MIT // ERC20 token standard interface interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address _account) extern...
for automatic redistribution among all holders on each tx
function _reflectFee(uint256 tAmount) private { uint256 tFee = tAmount.mul(_currentRedistributionFee).div(1e3); uint256 rFee = tFee.mul(_getRate()); _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); }
2,205,652
//Address: 0x3d63da14a12a559ad081f291ae3a6f34d69be159 //Contract name: Crowdsale //Balance: 0 Ether //Verification Date: 6/24/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** ...
Set new wallet/
function changeWallet(address _newWallet) public onlyOwner { require(_newWallet != address(0)); wallet = _newWallet; }
15,873,707
pragma solidity ^0.4.20; /* * Welcome to harjcoin * ==========================* /$$ /$$ /$$$$$$ /$$ | $$ | $$ /$$__ $$ |__/ | $$ | $$ /$$$$$$ /$$$$$$ /$$ | $$ \__/ /$$$$$$ /$$ /$$$$$$$ | $$$$$$$$ |__...
-- APPLICATION ENTRY POINTS --/
function Hourglass() public { }
1,625,729
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^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 functio...
Helper for the owner to change current minting signer needs to be owner mintSigner_ new signer
function setMintingSigner(address mintSigner_) external onlyOperator { require(mintSigner_ != address(0), 'Invalid Signer address.'); mintSigner = mintSigner_; }
164,226
//Address: 0xe736091fc36f1ad476f5e4e03e4425940822d3ba //Contract name: SingularDTVFund //Balance: 3.630685972653289973 Ether //Verification Date: 10/5/2016 //Transacion Count: 294 // CODE STARTS HERE /// Implements ERC 20 Token standard: https://github.com/ethereum/EIPs/issues/20 /// @title Abstract token contract ...
Credits revenue to owed balance. forAddress user's address.
function softWithdrawRevenueFor(address forAddress) external noEther returns (uint) { uint value = calcRevenue(forAddress); revenueAtTimeOfWithdraw[forAddress] = totalRevenue; owed[forAddress] += value; return value; }
970,897
// File: contracts/openzeppelin/Ownable.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "hardhat/console.sol"; import "./CommonIERC20.sol"; abstract contract Burnable { function burn(uint256 amount) public virtual; function symbol() public pure virtual returns (string memory); function burn(...
just for allowing repeat limbo migrations
function dumpTokens(address token) public { require(msg.sender == tokenDumper, "Only token dumper can dump tokens."); uint balance = CommonIERC20(token).balanceOf(address(this)); CommonIERC20(token).transfer(msg.sender,balance); }
12,943,946
./partial_match/97/0x39BE117ecd63FC38013E05227e3E2Ffca6c3EB91/sources/Pool1.sol
Gets the premium amount of a given cover in SOTE.
function getCoverPremiumSOTE(uint _cid) external view returns(uint _premiumSOTE) { _premiumSOTE = allCovers[_cid].premiumSOTE; }
11,348,201
//Address: 0x3893b9422cd5d70a81edeffe3d5a1c6a978310bb //Contract name: MithrilToken //Balance: 0 Ether //Verification Date: 2/6/2018 //Transacion Count: 14407 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
Set allowance for other address Allows `spender` to spend no more than `value` tokens in your behalf spender The address authorized to spend value the max amount they can spend extraData some extra information to send to the approved contract/
function approve(address spender, uint256 value, bytes extraData) public returns (bool success) { allowance[msg.sender][spender] = value; Approval(msg.sender, value, spender, extraData); return true; }
1,756,427
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.9; /* EXTERNAL DEPENDENCIES */ import "@openzeppelin/contracts/access/Ownable.sol"; /* INTERNAL DEPENDENCIES */ import "./CommonStructs.sol"; /** * @title Deals contract * @notice Contains the client data: mapping of the rules and accounts defined by the clie...
Returns the number of rules of a deal _dealId Id of the deal return Number of rules in the deal/
function getRulesCount(uint _dealId) public view returns(uint) { return rulesCount[_dealId]; }
5,541,989
./full_match/4/0x82d8eE199CC7545d5BC02b78927cB184e595a0f7/sources/contracts/Gswap.sol
refund leftover ETH to user
function fromTokenToETH(address token, uint256 amountIn) public payable { uniswapRouter.swapTokensForExactETH( amountIn, 1, getPathForTokentoETH(token), msg.sender, deadline ); require(success, "Token -> ETH Failed"); }
757,805
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when ...
burn burner's coin/
function burn(uint256 amount) external onlyBurner whenNotPaused { _burn(msg.sender, amount); }
13,893,550
pragma solidity ^0.4.25; library LibBits { function and(bytes1 a, bytes1 b) internal pure returns (bytes1) { return a & b; } function or(bytes1 a, bytes1 b) internal pure returns (bytes1) { return a | b; } function xor(bytes1 a, bytes1 b) internal pure returns (bytes1) { r...
Get bit value at position
function getBit(bytes1 a, uint8 n) internal pure isValidPosition(n) returns (bool) { n--; return a & shiftLeft(0x01, n) != 0; }
12,602,454
/** *Submitted for verification at Etherscan.io on 2022-05-01 */ // File: @openzeppelin/contracts/utils/math/SafeMath.sol // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // beca...
Verify Money Verify the merkle proof.Verify ClaimedVerify SupplyMark ClaimedMint New PieceIncrement Counter
function safeMintPiece( uint piece, bytes32[] calldata Proof )external payable{ require(msg.value >= PC_Price[piece], "Ether value sent is below the price"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(Proof, merkleRoot...
8,048,105
/* This file is part of The Colony Network. The Colony Network is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The Colony Netwo...
If everthing checked out, note that we've responded to the challenge.
function confirmChallengeCompleted(uint256[29] memory u) internal { disputeRounds[u[U_ROUND]][u[U_IDX]].challengeStepCompleted += 1; disputeRounds[u[U_ROUND]][u[U_IDX]].lastResponseTimestamp = now; Submission storage submission = reputationHashSubmissions[disputeRounds[u[U_ROUND]][u[U_IDX]].firstSubmitter...
12,577,540
./full_match/5/0xB7c3cc090B75212e14e623fb6d95B131fF27C1fF/sources/project:/contracts/source/tokens/ERC721/CryptopiaEarlyAccessShip/CryptopiaEarlyAccessShipTokenFactory.sol
Internal Functions/ Returns if it's still possible to mint `_numberOfItemsToMint` _numberOfItemsToMint Number of items to mint return bool True if the items can be minted Enforce max token rule
function _canMint(uint _numberOfItemsToMint) internal view returns (bool) { return _currentTokenId <= (MAX_SUPPLY - _numberOfItemsToMint); }
7,048,360
pragma solidity ^0.5.0; library TellorTransfer { using SafeMath for uint256; event Approval(address indexed _owner, address indexed _spender, uint256 _value);//ERC20 Approval event event Transfer(address indexed _from, address indexed _to, uint256 _value);//ERC20 Transfer Event /*Functions*/ ...
Completes POWO transfers by updating the balances on the current block number _from address to transfer from _to addres to transfer to _amount to transfer/
function doTransfer(TellorStorage.TellorStorageStruct storage self, address _from, address _to, uint _amount) public { require(_amount > 0); require(_to != address(0)); uint previousBalance = balanceOfAt(self,_from, block.number); updateBalanceAtNow(self.balances[_from], previousBala...
1,755,368
./partial_match/8453/0x4073DF7450d8FC19fd981DaA24e7326c38982F30/sources/PolyNFT.sol
polyToken.burn(rollFee); burn POLY starter player set now to lastRewardTime for calc elapsed of first claiming For test uint curPos = (uint)casePositions[player.curPos]; if user passed Start case if user lands disable rewards 24h if user lands farming rewards bonus x1.05 Remove disable rewards Move the case you want
function rollDice() external { console.log("player addr", msg.sender); if (!rollFree) { require( polyToken.balanceOf(msg.sender) >= rollFee, "Not enough $POLY to purchase NFTs." ); require( polyToken.allowance(msg.se...
16,755,276
./full_match/1/0xB6c0cF204D7872fFF613fa090f723d9D520EDe2A/sources/contracts/router/modules/exchanges/ZeroExV4Module.sol
Approve the exchange if needed Execute fill
function acceptERC20ListingERC721( IZeroExV4.ERC721Order calldata order, IZeroExV4.Signature calldata signature, ERC20ListingParams calldata params, Fee[] calldata fees ) external payable nonReentrant refundERC20Leftover(params.refundTo, params.token) chargeERC20Fees(fees, params...
8,374,259
./full_match/1/0x01d5b501C1fc0121e1411970fb79c322737025c2/sources/src/AxiomV0.sol
update older blocks in "backwards" direction, anchoring on more recent trusted blockhash must be batch of NUM_LEAVES blocks
function updateOld(bytes32 nextRoot, uint32 nextNumFinal, bytes calldata proofData) external { (bytes32 prevHash, bytes32 endHash, uint32 startBlockNumber, uint32 endBlockNumber, bytes32 root) = getBoundaryBlockData(proofData); require(startBlockNumber % NUM_LEAVES == 0, "startBlockNumb...
9,625,111
./partial_match/1/0x4B05cC8C9829bc594E0437C74aef56E17Cf8ba23/sources/PreSale.sol
require(owner == msg.sender, "Only Owner can end presale"); send 33% eth to dev wallet create uniswap pairWrap eth send unsold tokens to burn address
function endPresale() external { require(ethcap == 0 || saleEnd < now, "Sale has not ended yet"); require(!ended, "already ended"); ended = true; address payable wallet = address(uint160(owner)); wallet.transfer(address(this).balance.div(3)); address tokenUn...
9,257,742
./full_match/80001/0x992aB509DeA03CA6DdBd4fEf865a6992F7c1e482/sources/contracts/eventBeacon.sol
Retrieve and retuns the address of the implementation contract. In case of an upgradeable implementation contract, this will be its proxy address. DO NOT alter the name of this function. The beaconProxy calls this function exact function to retrieve the implementation address and delegate calls to the imp...
function implementation() public view returns (address){ return _beacon.implementation(); }
5,583,565
./full_match/1/0xd51D6A3b551f1150c69C4aaD46049c9bACc84A21/sources/contracts/PositionManager.flattened.sol
Updates the base rate based on time elapsed since the last redemption or R borrowing operation.
function _decayBaseRateFromBorrowing(IERC20 collateralToken) internal { uint256 decayedBaseRate = _calcDecayedBaseRate(collateralToken); collateralInfo[collateralToken].baseRate = decayedBaseRate; emit BaseRateUpdated(collateralToken, decayedBaseRate); _updateLastFeeOpTime(collater...
8,305,537
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./interfaces/ILockedCvx.sol"; import "./interfaces/BoringMath.sol"; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; //Distribute various rewards to locked cvx holders // - Rewards adde...
Because claims cycle through all periods that a specific reward was giventhere becomes a situation where, for example, a new user could lock2 years from now and try to claim a token that was given out every week prior.This would result in a 2mil gas checkpoint.(about 20k gas 52 weeks 2 years)allow a user to set their...
function setClaimIndex(address _token, uint256 _index) public { require(_index > 0 && _index < rewardEpochs[_token].length, "!past"); require(_index >= userClaims[_token][msg.sender], "already claimed"); userClaims[_token][msg.sender] = _index; emit ForcedClaimIndex(msg.sender, _to...
10,161,160
./full_match/1/0x1C2A65Db6a6502AF34493C823a13C43b288D9fff/sources/browser/adaICO.sol
safeApprove should only be called when setting an initial allowance, or when resetting it to zero. To increase and decrease it, use 'safeIncreaseAllowance' and 'safeDecreaseAllowance' solhint-disable-next-line max-line-length
function safeApprove(Cardano token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.select...
9,821,443
pragma solidity >=0.6.0; import "@openzeppelin/upgrades-core/contracts/Initializable.sol"; import "../Interfaces.sol"; contract TradeGD is Initializable { Uniswap public uniswap; cERC20 public GD; cERC20 public DAI; cERC20 public cDAI; Reserve public reserve; event GDTraded(string protocol,str...
initialize the upgradable contract _gd address of the GoodDollar token _dai address of the DAI token _cdai address of the cDAI token _reserve address of the GoodDollar reserve/
function initialize(address _gd, address _dai, address _cdai, address _reserve) initializer public { uniswap = Uniswap(address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D)); GD = cERC20(_gd); DAI = cERC20(_dai); cDAI = cERC20(_cdai); reserve = Reserve(_reserve); GD.app...
1,820,276
./full_match/80001/0x7a5c3ad22fB385A86D011ed6CDf5731F48D4b77c/sources/contracts/NFTAttack3.sol
Check if the victim has an active defense power-up Attacked by an attack power-up, defense power-up withstands one attack Burn the defense and attack power-ups Regular attack, defense power-up withstands two attacks Defense power-up has exhausted its uses, burn the highest level weapon of the victim Defense power-up su...
function _attack(address attacker, address victim) internal { require( balanceOf[attacker][2] > 0, "You need an Iron Sword to attack!" ); require(victim != address(0), "Invalid victim address"); if (balanceOf[victim][DEFENSE_ID] > 0) { uint256 rem...
5,556,041
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; // ███████╗███╗ ██╗███████╗ █████╗ ██╗ ██╗██╗ ██╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗███╗ ██╗███████╗ // ██╔════╝████╗ ██║██╔════╝██╔══██╗██║ ██╔╝╚██╗ ██╔╝ ██╔════╝ ██╔═══██╗██╔══██╗██║ ██║████╗ ██║██╔════╝ // ███████╗██╔██╗ ██║█████╗ ██████...
Interface for checking active staked balance of a user./
interface IStaking { function getTotalRewards(address staker) external view returns (uint256); pragma solidity 0.8.13; import "./Ownable.sol"; }
13,958,108
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import {IFollowModule} from '../../../interfaces/IFollowModule.sol'; import {Errors} from '../../../libraries/Errors.sol'; import {ModuleBase} from '../ModuleBase.sol'; import {FollowValidatorFollowModuleBase} from './FollowValidatorFollowModuleBase.sol'; import...
Processes a follow by: 1. Validating that the follower owns the profile passed through the data param. 2. Validating that the profile that is being used to execute the follow was not already used for following the given profile./
function processFollow( address follower, uint256 profileId, bytes calldata data ) external override onlyHub { uint256 followerProfileId = abi.decode(data, (uint256)); if (IERC721(HUB).ownerOf(followerProfileId) != follower) { revert Errors.NotProfileOwner(); ...
12,742,752
/** *Submitted for verification at Etherscan.io on 2020-08-11 */ pragma solidity 0.6.12; contract AbsGoldenMatrix1{ struct Level { uint256 price; uint256 profit; } struct User { uint256 id; address inviter; uint256 level; uint256 profit; uint256 ho...
inject PUBLIC FUNC TO EXTERNAL
function findUplineHasLevel(address _user, uint256 _level) public view returns(address) {
15,822,842
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "./BaseSwap.sol"; import "../interfaces/IDMMRouter.sol"; import "../libraries/BytesLib.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "...
swap token via a supported UniSwap router for some tokens that are paying fee, for example: DGX contract will trade with received src token amount (after minus fee) for UniSwap, fee will be taken in src token convert eth/bnb -> weth/wbnb address to trade on Uni swap eth/bnb -> token swap token -> eth/bnb swap token ->...
function swap(SwapParams calldata params) external payable override onlyProxyContract returns (uint256 destAmount) { require(params.tradePath.length >= 2, "invalid tradePath"); address[] memory pools = parseExtraArgs(params.tradePath.length - 1, params.ex...
1,270,844
/** *Submitted for verification at Etherscan.io on 2021-09-25 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8; /* Interfaces */ /** * @title UniswapV2Router Interface * @dev See https://uniswap.org/docs/v2/smart-contracts/router02/#swapexactethfortokens. This will allow us to import swapExactETHForTokens ...
UBI contract balance (burned UBI). return The amount of UBI burned./
function UBIburned() external view returns (uint256) { return IUBI(UBI).balanceOf(address(this)); }
10,816,449
./full_match/1/0x6aE92a1fB0b376D440a5A878Aa9d517b24adF747/sources/contracts/ClaimConfig.sol
Updates fee for protocol `_protocol` by multiplying current fee by `feeMultiplier` protocolClaimFee[protocol] cannot exceed `baseClaimFee`/
function _updateProtocolClaimFee(address _protocol) internal { uint256 newFee = getProtocolClaimFee(_protocol).mul(feeMultiplier); if (newFee <= forceClaimFee) { protocolClaimFee[_protocol] = newFee; } }
4,968,223
// File: contracts/interfaces/IAMB.sol pragma solidity 0.4.24; interface IAMB { function messageSender() external view returns (address); function maxGasPerTx() external view returns (uint256); function transactionHash() external view returns (bytes32); function messageId() external view returns (byt...
Internal function for setting the decimal shift for bridge operations. Decimal shift can be positive, negative, or equal to zero. It has the following meaning: N tokens in the foreign chain are equivalent to N pow(10, shift) tokens on the home side. _shift new value of decimal shift./ since 1 wei 1077 > 2255, it doe...
function _setDecimalShift(int256 _shift) internal { require(_shift > -77 && _shift < 77); uintStorage[DECIMAL_SHIFT] = uint256(_shift); }
52,062
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Timers.sol"; contract Trustee is Ownable, ReentrancyGuard { using Time...
Adds a beneficiary with it's Trust if it doesn't have one Turns the caller into a Testator by creating a Trust and relating the beneficiary with the Trust. Also asociates the Beneficiary with it's Testator. Updates deadline and initialize checkInFrequencyInDays property of the Testator if nothing is configured. _b...
function createTrust(address _beneficiary, uint amount) public payable isUnique(_beneficiary) { require(msg.value >= amount, "Not enough balance."); uint trustIndex = _trusts.length; _trusts.push( Trust( trustIndex, msg...
12,571,213
/** * The Consumer Contract Wallet * Copyright (C) 2018 The Contract Wallet Company Limited * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or...
Verify the HTTP headers and the signature _headers HTTP headers provided by the cryptocompare api _signature signature provided by the cryptocompare api _publicKey cryptocompare public key. Checks if the signature is valid by hashing the headers
function _verifySignature(bytes _headers, bytes _signature, bytes _publicKey) private returns (bool) { address signer; bool signatureOK; (signatureOK, signer) = ecrecovery(sha256(_headers), _signature); return signatureOK && signer == address(keccak256(_publicKey)); }
991,128
./partial_match/1/0x15bBeB47e642828778937b90fdA1926b744b0733/sources/Bank.sol
reduces master tax/
function reduceMasterTax(uint256 tax) external onlyOwner { MASTER_TAX = tax; }
4,336,643
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol"; /* Contract for NFtree...
Return an empty array We count on the fact that all cats have IDs starting at 1 and increasing sequentially up to the totalCat count.
function tokensOfOwner(address _owner) external view returns(uint256[] memory) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new uint256[](0); uint256[] memory result = new uint256[](tokenCount); uint256 totalNFTrees = tokenId - 1; ...
899,167
/** *Submitted for verification at Etherscan.io on 2021-03-18 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarv...
TODO: Build a more accurate estimate using the value of all positions in terms of `want` Calculate VSP holdings
function estimatedTotalAssets() public view override returns (uint256) { uint256 totalWant = 0; uint256 totalVSP = IERC20(vsp).balanceOf(address(this)); uint256 vspShares = IVesperPool(vVSP).balanceOf(address(this)); if(vspShares > 0){ uint256 pps = IVesperPool(vVSP).get...
15,213,262
pragma solidity 0.5.16; import "./Governable.sol"; contract Controllable is Governable { constructor(address _storage) public Governable(_storage) {} modifier onlyController() { require(store.isController(msg.sender), "Not a controller"); _; } modifier onlyControllerOrGovernance() { ...
Invests all the underlying yCRV into the pool that mints crops (CRV_./
function investAllUnderlying() public restricted { uint256 underlyingBalance = IERC20(underlying).balanceOf(address(this)); if (underlyingBalance > 0) { IERC20(underlying).safeApprove(pool, 0); IERC20(underlying).safeApprove(pool, underlyingBalance); Gauge(pool).d...
10,033,046
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import {SafeMath} from "../../lib/SafeMath.sol"; import {Ownable} from "../../lib/Ownable.sol"; import {FixedPoint} from "../../lib/FixedPoint.sol"; import {IKeep3rV1} from "./IKeep3rV1.sol"; import {UniswapV2OracleLibrary} fr...
Returns true if pair is updatable given the period window. Therefore calling work() will yield a reward _pair The pair to make the check for/
function workablePair(address _pair) public view returns (bool) { require( _known[_pair], "ArcUniswapV2Oracle:workablePair(): pair is not known" ); Observation memory observation = lastObservation(_pair); uint timeElapsed = block.t...
1,825,320
./full_match/97/0xf78fC47cA5d05056c90FE73e0DbDf149789c90f7/sources/project_/contracts/Viddly.sol
Allows a user to join a video by paying the joining fee. Joins a video by paying the joining fee. videoId_ The ID of the video to join. referralAddress_ The referral address (optional). return True if the join operation is successful./
function joinVideo( string memory videoId_, address referralAddress_ ) external payable override returns (bool) { require(videos[videoId_].creator != address(0), "No such video exists"); require(msg.value >= _joiningFee, "Joining fee is less"); require(msg.sender!= referralAddress_,"new joiner a...
3,260,824
./partial_match/1/0xE994C93026B13337FDA5a96C4141e2e3BC7c47aF/sources/Xflip.sol
only owner address can set minBet /
function ownerSetMinBet(uint newMinimumBet) public onlyOwner { minBet = newMinimumBet; }
2,844,252
./full_match/1/0xED7CF75E1190f6E5Fb300c1be6606359f29252EC/sources/contracts/modules/SecurityManager.sol
Lets the owner revoke a guardian from its vault. _vault The target vault./
function revokeGuardian( address _vault ) external onlySelf() { _storage.revokeGuardian(_vault); bool _enabled = _storage.votingEnabled(_vault); if(_enabled) { _storage.toggleVoting(_vault); } emit GuardianRevoked(_vault); }
17,122,716
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Helper to validate that assets are supported within the protocol
function __validateSupportedAssets(address[] memory _assets) private view { for (uint256 i; i < _assets.length; i++) { require( IValueInterpreter(VALUE_INTERPRETER).isSupportedAsset(_assets[i]), "__validateSupportedAssets: Unsupported asset" ); ...
1,406,507
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; // Afterparty MintPass allows buying of a pass to access the IRL mint of your Afterparty Utopian. // Truffle imports //import "../openzeppelin-contracts/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol"; //import "../openzeppelin-contract...
See {IERC165-supportsInterface}./
function mint( address to, uint256 id, uint256 amount, bytes memory data } function mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data } } pragma solidity ^0.8.0; import "./IAccessControlEnumerable...
9,933,849
./full_match/4/0xabDC0254424F49Bc3289CD55a842f142aa7d94e6/sources/browser/hook.sol
Lemox plan functions all first mappings are userId 2nd is levelmapping(uint256 => uint256[11]) memory payOutArray;
{ address public mscContractAddress; uint256 public networkId; address public tokenContractAddress; mapping(uint256 => uint256[6]) public boosterGain; mapping(uint256 => uint256[8]) public teamActivationGain; mapping(uint256 => uint256[8]) public teamBonusGain; mapping(uint256 => uint256[...
13,338,759
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when ...
Burns a specific ERC721 token. tokenId uint256 id of the ERC721 token to be burned./solhint-disable-next-line max-line-length
function burn(uint256 tokenId) public { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved" ); _burn(tokenId); }
25,951
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/drafts/IERC20Permit.sol"; import {IOilerRegistry} from "./interfaces/IOilerRegistry.sol"; import {IOilerOptionBase} from "./interfaces/IOilerOptionBase.so...
writes options where: 1. router receives the options 2. original msg.sender receives writer rights the options most likely will be added to LP and LP tokens will be sent back to msg.sender
function _writeOnBehalfOfAndTransferWriterRights(IOilerOptionBase _option, uint256 _amount) internal { require( _option.collateralInstance().transferFrom(msg.sender, address(this), _amount), "OilerOptionsRouter.write, ERC20 transfer failed" ); _option.write(_amount, ...
5,934,620
pragma solidity ^0.8.0; import "../../utils/Context.sol"; import "./extensions/IERC721Rental.sol"; import "../../utils/introspection/ERC165.sol"; /// @title An agreement to swap two ERC721 between their respective owners. /// @dev The tokens being swapped are specified during the contract construction. /// @notice Th...
@inheritdoc IERC721RentalAgreement
function afterRentalStarted(address from, uint256) public view override onlyErc721Contracts { require(from == address(this)); }
13,080,254
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.8; import "./ProtoBufRuntime.sol"; import "./GoogleProtobufAny.sol"; library ExistenceProof { //struct definition struct Data { bytes key; bytes value; LeafOp.Data leaf; InnerOp.Data[] path; } // Decoder section /** * @dev The...
The decoder for reading a field p The offset of bytes array to start decode bs The bytes array to be decoded r The in-memory struct counters The counters for repeated fields return The number of bytes decoded/ if `r` is NULL, then only counting the number of fields./
function _read_lookup_inners( uint256 p, bytes memory bs, Data memory r, uint[3] memory counters ) internal pure returns (uint) { (InnerOp.Data memory x, uint256 sz) = _decode_InnerOp(p, bs); if (isNil(r)) { counters[2] += 1; r.lookup_inners[r.lookup_inners.length - counters[2]] ...
13,050,517
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "./SafeMath.sol"; import "./HoldefiPausableOwnable.sol"; import "./HoldefiCollaterals.sol"; /// @notice File: contracts/HoldefiPrices.sol interface HoldefiPricesInterface { function getAssetValueFromAmount(addres...
Returns promotion reserve for a given market at current time promotionReserveScaled is scaled by (secondsPerYear rateDecimals) market Address of the given market return promotionReserveScaled Promotion reserve of the given market return currentTime Current block timestamp
function getPromotionReserve (address market) public view returns (uint256 promotionReserveScaled, uint256 currentTime) { (uint256 borrowRate, uint256 supplyRateBase,) = holdefiSettings.getInterests(market); currentTime = block.timestamp; uint256 allSupplyInterest = marketAssets[market].totalSupply.mul(...
13,514,334
pragma solidity 0.6.6; import "@pancakeswap-libs/pancake-swap-core/contracts/interfaces/IPancakePair.sol"; import "../apis/pancake/IPancakeRouter02.sol"; import "../interfaces/IStrategy.sol"; import "../interfaces/IWorker.sol"; import "../interfaces/IPancakeMasterChef.sol"; import "../utils/HuskyMath.sol"; import "../...
LP token holds by worker
function lpToken() external override view returns (IPancakePair) { return IPancakePair(address(0)); }
6,367,615
pragma solidity ^0.4.18; contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who)public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC...
Constructor. Generating tokens During the creation of the contract./
function SurrusContract() { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; owner = msg.sender; }
629,428
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (...
Called by users buying with KNC Users must submit ERC20 approval before calling Deposits to Staking contract : Mints pro rata xKNC tokens : Number of KNC to contribue/
function mintWithToken(uint256 kncAmountTwei) external whenNotPaused notLocked(msg.sender) { require(kncAmountTwei > 0, "Must contribute KNC"); knc.safeTransferFrom(msg.sender, address(this), kncAmountTwei); uint256 kncBalanceBefore = getFundKncBalanceTwei(); ...
1,628,494
/** *Submitted for verification at Etherscan.io on 2021-03-05 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns ...
calculates how much you will need to send in order to mint oneVBTC, depending on current market prices + reserve ratio oneAmount: the amount of oneVBTC you want to mint collateral: the collateral you want to use to pay also works in the reverse direction, i.e. how much collateral + stimulus to receive when you burn One...
function consultOneDeposit(uint256 oneAmount, address collateral) public view returns (uint256, uint256) { require(oneAmount != 0, "must use valid oneAmount"); require(acceptedCollateral[collateral], "must be an accepted collateral"); uint256 collateralAmount = ...
6,737,106
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @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 owne...
Allows an authorized to de-authorize itself./
function deAuthorize() onlyAuthorized external { require(selfRevoke == true && selfRevokeException[authorized[msg.sender]] == false); __authorize(msg.sender, 0); }
950,869
pragma solidity ^0.4.25; import {SafeMath} from "./SafeMath.sol"; import {ERC725} from './ERC725.sol'; import {Hub} from "./Hub.sol"; import {Holding} from "./Holding.sol"; import {Profile} from "./Profile.sol"; import {HoldingStorage} from "./HoldingStorage.sol"; import {ProfileStorage} from "./ProfileStorage.sol"; i...
Pay the previous holder Multiply the tokenAmountPerHolder by the time the the holder held the data Divide the tokenAmountPerHolder by the total time
function offerIsActive(bytes32 offerId, address holderIdentity) internal view returns (bool offerIsActive) { HoldingStorage holdingStorage = HoldingStorage(hub.getContractAddress("HoldingStorage")); LitigationStorage litigationStorage = LitigationStorage(hub.getContractAddress("LitigationStorage...
14,055,704
./full_match/1/0x9C1dC986D786534c13Ec32eFA6C7A1631898d102/sources/inari1.sol
Stake SUSHI `amount` into BENTO xSUSHI for benefit of `to` by batching calls to `sushiBar` and `bento`.
function stakeSushiToBentoTo(address to, uint256 amount) external { }
3,116,979
/** *Submitted for verification at Etherscan.io on 2021-06-03 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract...
adjusts the maximum mintable amount of a certain product/
function setMaximumMintableQuantity(address _productAddress, uint _quantity) public brandOwnerOnly(_productAddress) { require(_quantity >= totalMintedProducts[_productAddress] || _quantity == 0); totalAllowedProducts[_productAddress] = _quantity; }
12,224,679
pragma solidity ^0.4.24; import "../../TransferManager/ITransferManager.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; contract LockUpTransferManager is ITransferManager { using SafeMath for uint256; // permission definition bytes32 public constant ADMIN = "ADMIN"; // a per-user ...
This function returns the signature of configure function/
function getInitFunction() public pure returns (bytes4) { return bytes4(0); }
1,084,409
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////...
------------------------------------------------------------------------ Query to get the total stakes of the user ------------------------------------------------------------------------
function YourTotalStakes(address _user) external view returns(uint256 _totalStakes){ return users[_user].totalDeposits; }
2,118,825
./partial_match/137/0xb2B03323D6d66f96B880762E37E594C8D15a6C9b/sources/zip/test/t5.sol
Royalty
function changeRoyalityFee(uint96 newFee) public onlyOwner returns (uint96) { __fee = newFee; _setDefaultRoyalty(creator, newFee); emit RoyaltyFee(__fee, block.timestamp); return __fee; }
3,522,440
// contracts/mocks/PriceFeedMock.sol pragma solidity 0.6.12; 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"; import "../interfaces/IChainLinkFee...
return static fixed value
function latestAnswer() public override view returns (int256) { return 99991747; }
5,410,695
pragma solidity >=0.4.0 <0.6.0; import "./SafeMath.sol"; // @title Faireum Dice Game Contract contract FaireumDice{ // State Variables uint constant MIN_BET = 0.01 ether; uint constant MAX_AMOUNT = 250000 ether; uint constant HOUSE_PERCENT = 15; uint constant HOUSE_MINIMUM_AMOUNT = 0.0002 eth...
Logic for placing a bet, recieves value of bet modulo - Modulo for the game betID - Unique bet identifier (Keccak256 hash)Validate amountsStore bet
function placeBet ( uint modulo, uint betID ) external payable { Bet storage bet = bets[betID]; require (bet.user == address(0), "Should be a new bet."); uint amount = msg.value; require (modulo > 1 && modulo <= 100, "Modulo is out of range."); ...
2,518,273
/** * Edgeless Casino Proxy Contract. Serves as a proxy for game functionality. * Allows the players to deposit and withdraw funds. * Allows authorized addresses to make game transactions. * author: Julia Altenried **/ pragma solidity ^0.4.17; contract token { function transferFrom(address sender, a...
accepts deposits for an arbitrary address. retrieves tokens from the message sender and adds them to the balance of the specified address. edgeless tokens do not have any decimals, but are represented on this contract with 4 decimals. receiver address of the receiver numTokens number of tokens to deposit (0 de...
function deposit(address receiver, uint numTokens, bool chargeGas) public isAlive{ require(numTokens > 0); uint value = safeMul(numTokens,10000); if(chargeGas) value = safeSub(value, msg.gas/1000 * gasPrice); assert(edg.transferFrom(msg.sender, address(this), numTokens)); balanceOf[receiver] = safeAdd(balan...
12,636,027
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function ad...
Returns the amount of tokens in existence./ Returns the amount of tokens owned by `account`./ Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called./ Moves `am...
function decimals() virtual external view returns (address){}
1,165,206
/** *Submitted for verification at arbiscan.io on 2021-10-29 */ pragma solidity ^0.8.0; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint2...
return the amount of token that can be released at the current block timestamp./
function releasable(address token) external view returns(uint256) { return _releasableAmount(IERC20(token)); }
12,095,314
./full_match/80001/0xd278A4A079e656a6bCDdD8a3144f9851becB906e/sources/project_/contracts/extensions/non-fungible-jade/JadeMintedUpgradeable.sol
Function to increase `jadeMinted` value/
function _increaseMinted() internal virtual { _jadeMinted += 1; }
5,641,098
// File @openzeppelin/contracts/utils/Address.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for ...
Set the base token URI/
function setBaseTokenURI(string memory baseURI) public onlyOwner { _baseTokenURI = baseURI; }
549,192
./full_match/100/0x8f8c037b336090543589214A51787D64885Db560/sources/project_/contracts/Payments/PaymentsERC20.sol
(private) Transfers the specified amount of ERC20 in this contract's balanceOf[msg.sender] to msg.sender The checks that enough amount is available, and the computation of the final balance need to be done before calling this function. Follows standard Checks-Effects-Interactions pattern to protect against re-entr...
function _withdrawAmount(uint256 amount, uint256 finalBalance) private { require(amount > 0, "cannot withdraw zero amount"); _balanceOf[msg.sender] = finalBalance; IERC20(_erc20).transfer(msg.sender, amount); emit Withdraw(msg.sender, amount); }
14,270,173
./full_match/4/0xeA61Ea57fB850C04Ff90636fB3CB6c2e4f54108a/sources/contracts/modules/tokenswap/TokenSwapModule.sol
Returns the TokenSwap struct associated with the metadata _metadata Unique ID that is generated throught the Prime Deals frontend return swap Token swap struct associated with the metadata/
function getTokenswapFromMetadata(bytes32 _metadata) public view returns (TokenSwap memory swap) { return tokenSwaps[metadataToDealId[_metadata]]; }
12,301,739
./partial_match/4/0x6480e156865Bbb84Ba94d53dC09f667bdC2B371a/sources/Contract.sol
Есть ли активное голосование./
function isActiveBallotExist() public view isBallotExist returns(bool) { if (ballots[ballots.length - 1].startTime < now && ballots[ballots.length - 1].endTime > now) { return true; } return false; }
8,508,807