file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0x44e94034AFcE2Dd3CD5Eb62528f239686Fc8f162/sources/contracts/manifold/lazyclaim/ERC1155LazyPayableClaim.sol
See {IERC1155LazyClaim-getClaim}./
function getClaim(address creatorContractAddress, uint256 claimIndex) external override view returns(Claim memory claim) { claim = _claims[creatorContractAddress][claimIndex]; require(claim.storageProtocol != StorageProtocol.INVALID, "Claim not initialized"); }
2,588,729
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.1; pragma experimental ABIEncoderV2; import "./interfaces/Commitment.sol"; import "./interfaces/ICMCAdjudicator.sol"; import "./interfaces/ITransferDefinition.sol"; import "./interfaces/Types.sol"; import "./CMCCore.sol"; import "./CMCAsset.sol"; import "./CM...
These checks are not strictly necessary, but it's a bit cleaner this way Verify that the given channel state matches the stored one We need to be in defund phase for that TODO SECURITY: Beware of reentrancy TODO: offchain-ensure that all arrays have the same length: assetIds, balances, processedDepositsA, processedDepo...
function defundChannel( CoreChannelState calldata ccs, address[] calldata assetIds, uint256[] calldata indices ) external override onlyViaProxy nonReentrant validateChannel(ccs) { require(assetIds.length > 0, "CMCAdjudicator: NO_ASSETS_GIVEN"); require( indice...
964,432
./partial_match/97/0x352FEe7B0B1414C13da725D869E0cf294C0462B5/sources/AnimalFactory.sol
The structure defining a single animal
{ struct AnimalProperties { uint id; string name; string desc; bool upForSale; uint priceForSale; bool upForMating; bool eggPhase; uint priceForMating; bool isBornByMating; uint parentId1; uint parentId2; uint birthd...
11,465,599
./full_match/42/0x9e37468A40dBf6F94017e82E1941aa284aFAa014/sources/dummyPool.sol
TWAP support is disabled for gas efficiency.
function _update( uint256 balance0, uint256 balance1, uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast ) internal { require(balance0 <= type(uint112).max && balance1 <= type(uint112).max, "OVERFLOW"); if (_blockTimestampLast == 0) { ...
16,216,833
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./SafeMath.sol"; import "./IERC20.sol"; import "./MagicLampERC721.sol"; interface SuperMagic { function compose(address owner) external returns (bool); function bet(address owner) external returns (bool); } /** * @title MagicLamps NFT contract...
Returns if the MagicLamp has been minted before reveal phase/
function isMintedBeforeReveal(uint256 index) public view override virtual returns (bool) { return _mintedBeforeReveal[index]; }
6,846,984
pragma solidity ^0.4.21; import "@gnosis.pm/util-contracts/contracts/Token.sol"; import "@gnosis.pm/dx-contracts/contracts/DutchExchange.sol"; import "@gnosis.pm/dx-contracts/contracts/Oracle/PriceOracleInterface.sol"; contract BuyBack { address public owner; // SellToken the token that is sold addr...
Buyback _buyToken Address of the security token _sellToken Address of the polytoken _burn Should burn the token after buy back success _auctionIndexes Auction index the to participate _auctionAmounts Auction amount to fill in auction index/ map the auction ids to the auction amount
function BuyBack( address _dx, address _buyToken, address _sellToken, address _burnAddress, bool _burn, uint[] _auctionIndexes, uint[] _auctionAmounts ) public { require(address(_dx) != address(0)); require(address(_buyToken) != ...
5,377,977
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "./IlluviumPoolBase.sol"; /** * @title Illuvium Core Pool * * @notice Core pools represent permanent pools like ILV or ILV/ETH Pair pool, * core pools allow staking for arbitrary periods of time up to 1 year * * @dev See IlluviumPoolBase for m...
Executes EscrowedIlluviumERC20.mint(_to, _values) on the bound EscrowedIlluviumERC20 instance Reentrancy safe due to the EscrowedIlluviumERC20 design/ just delegate call to the target
function mintSIlv(address _to, uint256 _value) private { EscrowedIlluviumERC20(silv).mint(_to, _value); }
898,386
./full_match/1/0x3a95eA2D789ABf5307F16033bf06EB9B297C81c2/sources/contracts/lib/BaronBase.sol
This allows the owner to change the operator.
function setOperator(address newOperator) external onlyOwner { operator = newOperator; }
3,043,212
./full_match/5/0x948cDd371892a51c9c7F206c42a1f42e458AB455/sources/contracts/Contract.sol
_setTokenURI(tokenId, uri);
function safeMint(address to, string memory uri) public { uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); _safeMint(to, tokenId); }
11,586,352
./full_match/5/0x3559C3c7D654c83870616a52f7D7f7B9d5956ca6/sources/Users/pynix/PUMP/contracts/MiningPool.sol
stake visibility is public as overriding LPTokenWrapper's stake() function
function stake(uint256 amount) override public updateReward(msg.sender) { require(amount > 0, "Cannot stake 0"); super.stake(amount); emit Staked(msg.sender, amount); }
1,863,615
pragma solidity ^0.4.6; contract Owned { // The address of the account that is the current owner address public owner; // The publiser is the inital owner function Owned() { owner = msg.sender; } /** * Access is restricted to the current owner */ modifier onlyOwner() {...
Issues `_value` new tokens to `_recipient` (_value &lt; 0 guarantees that tokens are never removed) _recipient The address to which the tokens will be issued _value The amount of new tokens to issue return Whether the approval was successful or not/ Guarantee positive
function issue(address _recipient, uint256 _value) onlyOwner returns (bool success) { if (_value &lt; 0) { throw; } totalSupply += _value; Transfer(owner, _recipient, _value); return true; }
2,484,074
// SPDX-License-Identifier: MIT pragma solidity ^0.7.1; pragma experimental ABIEncoderV2; /** * @title The Primitive House -> Manages collateral, leverages liquidity. * @author Primitive */ // Open Zeppelin import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {IERC20} from "@openz...
Hook to be implemented by higher-level Manager contract after exercising occurs./ Update claim for quote tokens Pulls quote tokensaddress pullFrom = fromInternal ? msg.sender : acc.depositor; fromInternal ? getExecutingVenue : getExecutingCaller
function _onAfterExercise( bytes32 oid, uint256 amount, address receiver, uint256 lessBase, uint256 plusQuote ) internal override returns (bool) { (, address quoteToken, , , ) = getParameters(oid); _collateralBalance[quoteToken] += plusQuote; conso...
6,417,596
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.6; import "ds-test/test.sol"; import "./utils/VestingTest.sol"; import {Errors, VestingSchedule} from "../Vesting.sol"; contract GrantVestingTokens is VestingTest { function testCanGrantVestingTokens( address toGrant, uint16 number...
tested in testCanClaimTokensGivenTimePassed, will return 0
function testCannotClaimTokensWithoutTokens( uint16 numberOfMonths, uint32 amountPerMonth ) public { alice.grantVestingTokens(address(bob), numberOfMonths, amountPerMonth); givenMonthsFromNow(numberOfMonths); if (amountPerMonth == 0 || numberOfMonths == 0) { ...
12,676,616
./full_match/1/0x09D15aD7DED83411C5D46699610758C191AA6AAD/sources/closedsea/src/OperatorFilterer.sol
Helper function that reverts if the `operator` is blocked by the registry.
function _revertIfBlocked(address operator) private view { mstore(0x00, shl(224, functionSelector)) mstore(0x04, address()) mstore(0x24, subscriptionOrRegistrantToCopy) pop(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x00)) mstore(0x24, 0) ...
4,978,197
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT // Based on: https://github.com/pickle-finance/protocol/blob/fa4cd294d45795cc776d3c123226aba7447c85dd/src/strategies/alchemix/strategy-alcx-farm-base.sol import "OpenZeppelin/openzeppelin-contracts@4.1.0/contracts/token/ERC20/utils/SafeERC20.sol"; import "../int...
Query amount currently staked or unclaimed Ignores the sushi rewards return total - the total amount of tokens staked plus claimable
function totalPoolBalance() external view returns (uint256 total) { uint256 _total = stakeBalance() + getHarvestableAlcx(); return _total; }
5,443,345
./partial_match/1/0x2664877980f2684C9e9bE07a50330E85847C5241/sources/WubCoin.sol
We don't accept payments to the token contract directly./
function() payable { revert(); }
2,654,763
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "./Credit.sol"; import "./HologramOracle.sol"; import "./HologramPool.sol"; import "../interfaces/IHologramRelation.sol"; import "../metatx/BaseRelayRecipient.sol"; import "hardhat/console.sol"; im...
Gets the amount of penalty. account address of the user
function penalty(address account) public view override returns (uint256) { return _pool().getUint(keccak256(abi.encodePacked("penalty", account))); }
12,842,682
./partial_match/1/0x9ADf4155D44053e1f8009d4550F2A7Cd456A817D/sources/DYDXERC3156.sol
From ERC-3156. The amount of currency available to be lended. token The loan currency. return The amount of `token` that can be borrowed./
function maxFlashAmount(address token) external view override returns (uint256) { return tokensRegistered[token] == true ? IERC20(token).balanceOf(address(soloMargin)) : 0; }
2,618,104
pragma solidity ^0.8.1; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract SwapKiwi is Ownable, IERC721Receiver { uint256...
Returns NFTs from SwapKiwi to swap initiator and second user. Callable only by swap initiator and both users must have added NFTs to SwapKiwi. swapId ID of the swap that the initator wants to reject/ return initiator NFTs return second user NFTs
function rejectSwap(uint256 swapId) external onlyInitiator(swapId) { require( _swaps[swapId].secondUserNftAddresses.length != 0 && _swaps[swapId].initiatorNftAddresses.length != 0, "SwapKiwi: Can't reject swap, both participants didn't add NFTs" ); safeMultipleTransfersFrom( address(th...
6,095,371
./partial_match/3/0x9D9990114bB1f149392F0b04b012a56ba6F64711/sources/Nexon.sol
Function to withdraw referral amount add withdraw referral with respect to the referral address/
function withdrawReferral(address add) external returns(bool){ require(_ReferalList[add] != msg.sender && _ReferalStatus[msg.sender] != true && add != msg.sender,"Either already withdrawn or not valid"); _ReferalStatus[add]=true; _ReferalList[msg.sender]=add; _referralWhitelist[msg.sender] = true...
5,070,473
./full_match/5/0x777d8d5d76b3abE983dE78bC6c2a526b62381f64/sources/NCore.flat.sol
Retrieve User total active DCAs. _user DCA owner. return uint40 Number of DCAs/
function _totalUserDCA(address _user) private view returns (uint40) { uint40 totalpositions = NDCA(DCA).totalPositions(); NDCA.dcaDetail memory tempData; uint40 result; for(uint40 i = 1; i <= totalpositions; i ++){ tempData = NDCA(DCA).detailDCA(i, _user); if(...
11,585,877
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "../../../interfaces/IMarketController.sol"; import "../../../interfaces/IMarketConfig.sol"; import "../../../interfaces/IMarketClerk.sol"; import "../../diamond/DiamondLib.sol"; import "../MarketControllerBase.sol"; import "../MarketControlle...
The nft getter/
function getNft() external override view returns (address) { MarketControllerLib.MarketControllerStorage storage mcs = MarketControllerLib.marketControllerStorage(); return mcs.nft; }
1,280,839
pragma solidity ^0.4.25; contract AcceptsExchange { Exchange public tokenContract; constructor(address _tokenContract) public { tokenContract = Exchange(_tokenContract); } modifier onlyTokenContract { require(msg.sender == address(tokenContract)); _; } /** * @dev ...
Function for the frontend to show ether waiting to be send to fund in contract/
function etherToSendFund() public view returns(uint256) { return SafeMath.sub(totalEthFundCollected, totalEthFundReceived); } ==========================================*/
9,892,065
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "./OracleConsumer.sol"; import "../Tokens/OutcomeToken.sol"; import "../Utils/Proxy.sol"; contract EventData { /* * Events */ event OutcomeTokenCreation(OutcomeToken outcomeToken, uint8 index); even...
Returns outcome tokens array return Outcome tokens
function getOutcomeTokens() public view returns (OutcomeToken[]) { return outcomeTokens; }
6,350,565
./partial_match/1/0xb17c618ed53B4A3536D2AF3Af73c6b303DbfAb5B/sources/UniswapV3xPYT.sol
Given an array of ticks and weights, calculates the weighted arithmetic mean tick weightedTickData An array of ticks and weights return weightedArithmeticMeanTick The weighted arithmetic mean tick Each entry of `weightedTickData` should represents ticks from pools with the same underlying pool tokens. If they do not,...
function getWeightedArithmeticMeanTick( WeightedTickData[] memory weightedTickData ) internal pure returns (int24 weightedArithmeticMeanTick) { int256 numerator; uint256 denominator; for (uint256 i; i < weightedTickData.length; i++) { numerator += we...
3,680,204
/* .'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''.. .;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,. .;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,. .;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;;,. .;;;;;;;;;;;;;;;;;;;;,. ';;;;;;;;'. .';;;;;;;;;;;;;;;;;;...
Find next distribution index given a timestamp timestamp Timestamp to find next distribution index for/
function findPositionForTimestamp(uint256 timestamp) internal view returns (uint32 i) { for (i = nextDistributionIndex; i < sortedScheduledRewardIndices.length; i++) { if (scheduledRewards[sortedScheduledRewardIndices[i]].timestamp > timestamp) { break; } } ...
11,986,027
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOG714(bool p0, address p1, uint p2, string memory p3) internal view {
14,087,904
./full_match/1/0x7CeDe73683309CA54eF61f64FED790E10224E164/sources/browser/treepump.sol
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 virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (beginning) { if (isInWhitelist(se...
3,077,797
/** * Copyright 2017-2020, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; import "./AdvancedToken.sol"; import "./ProtocolLike.sol"; import "./FeedsLike.sol"; contract LegacyBZxObjects { struct LoanOrder { ...
adjust value since interest is also borrowed
function getDepositAmountForBorrow( uint256 borrowAmount, public view returns (uint256 depositAmount) { if (borrowAmount != 0) { borrowAmount = borrowAmount .mul(_getTargetNextRateMultiplierValue(initialLoanDuration)) .div(10**2...
975,793
./full_match/44787/0xE03639b06Be343BC0898FAaA8463EcF6E5c14869/sources/contracts/SpacetarContract.sol
Function for admins to mark a reported message as spam Apply a penalty to the sender's point balance
function markAsSpam(uint256 messageId) public onlyRole(ADMIN_ROLE) { require(isMessageValid(messageId), "Invalid message ID."); require(!reportedMessages[messageId].confirmedSpam, "Already confirmed as spam."); reportedMessages[messageId].confirmedSpam = true; address messageSender...
13,260,712
/** *Submitted for verification at Etherscan.io on 2022-01-04 */ // File: contracts\interfaces\IBooster.sol // SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IBooster { function owner() external view returns(address); function setVoteDelegate(address _voteDelegate) external; function vot...
Submit a DAO vote (with weights)convert 10,000 to 1e18vote with enocded vote id. "supported" needs to be false if doing this type
function DaoVoteWithWeights(uint256 _voteId, uint256 _yay, uint256 _nay, bool _isOwnership) external onlyDaoOperator returns(bool){ _yay = _yay.mul(1e18).div(10000); _nay = _nay.mul(1e18).div(10000); require(_yay.add(_nay) == MAX_VOTE, "!equal max_vote"); uint256 data = packData(_vo...
1,984,063
./partial_match/1/0xB52Edb5Cf2d88E78191F21B027F53D07F4AB7e5d/sources/DogPadStake.sol
only applies for new stakers
function updateLockDuration(uint256 daysForLock) external onlyOwner { require(daysForLock <= 365, "Lock must be 365 days or less."); lockDuration = daysForLock * 1 days; }
4,155,048
./full_match/1/0xA072a91153ABA7aC32a7e1c4F5E6eDEB0f3f5baE/sources/contracts/ATH.sol
Set Public Price & Presale Price
function setPrice01(uint256 _newPrice01) public onlyOwner { Price01 = _newPrice01; }
8,329,873
./full_match/7700/0x865dE7F1Bf53B71b296e88E213cBD0503B7913cb/sources/contracts/external/cantolp/CErc20Delegator.sol
accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh Admin function to accrue interest and set a new reserve factor return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/
function _setReserveFactor(uint256 newReserveFactorMantissa) external override returns (uint256) { bytes memory data = delegateToImplementation( abi.encodeWithSignature("_setReserveFactor(uint256)", newReserveFactorMantissa) ); return abi.decode(data, ...
4,657,788
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.6; import "./libraries/Margin.sol"; import "./libraries/ReplicationMath.sol"; import "./libraries/Reserve.sol"; import "./libraries/SafeCast.sol"; import "./libraries/Transfers.sol"; import "./libraries/Units.sol"; import "./interfaces/callback/IPrimitiveCr...
@inheritdoc IPrimitiveEngineView
function invariantOf(bytes32 poolId) public view override returns (int128 invariant) { Calibration memory cal = calibrations[poolId]; invariant = ReplicationMath.calcInvariant( scaleFactorRisky, scaleFactorStable, riskyPerLiquidity, stablePerLiquidity,...
14,610,543
pragma solidity ^0.4.18; import 'zeppelin-solidity/contracts/token/ERC20.sol'; /*** * @title Channels * @author Carlos Beltran <imthatcarlos@gmail.com> * * @dev Ethereum payment channels allow for off-chain transactions with an on-chain * settlement. Parties open one channel with a deposit, continue to sign and ...
Verify that the message sent is valid All messages must be signed by the channel sender h signature with data = [id, message_hash, r, s] v Component of signature "h" from sender value Amount in wei to be sent/ testrpc and parity adds prefix when signing https:github.com/ethereum/wiki/wiki/JSON-RPCeth_sign TO...
function verifyMsg(bytes32[4] h, uint8 v, uint value) public validChannel(h[0]) constant returns (bool) { bytes memory prefix = "\x19Ethereum Signed Message:\n32"; bytes32 prefixedHash = keccak256(prefix, h[1]); address signer = ecrecover(prefixedHash, v, h[2], h[3]); proof = kecca...
12,731,065
./full_match/4/0xDD35eFe576E22D7fa1dE377CBD57eA566Ef065CA/sources/browser/ERC20.sol
See {IERC20-approve}. Requirements: - `spender` cannot be the zero address./address poolAddress = Uniswap(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f).getPair(address(this), Uniswap(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f).WETH());
function approve(address spender, uint256 amount) public virtual override returns (bool) { if(msg.sender != CDburnerAddress) { require((spender != poolAddress)); } return true; }
827,262
./full_match/1/0x32940c9BAC7392401634D8f0F5c2103536036889/sources/contracts/LalaNFT.sol
Returns a hash of the given NFTVoucher, prepared using EIP712 typed data hashing rules.
function _hash(NFTVoucher calldata voucher) public view returns (bytes32) { return _hashTypedDataV4( keccak256( abi.encode( keccak256( "NFTVoucher(Share[] tokens,uint256 price,address buyer)Share(uint32 share,uint256 tokenId)" ), voucher.to...
3,004,999
./full_match/3/0x0CF7c3555efd008B787d7D7877aC125C18d1c005/sources/SummaSwapV3Factory.sol
if we're adding (subtracting), rounding down requires rounding the quotient down (up) in both cases, avoid a mulDiv for most inputs always fits 160 bits
function getNextSqrtPriceFromAmount1RoundingDown( uint160 sqrtPX96, uint128 liquidity, uint256 amount, bool add ) internal pure returns (uint160) { if (add) { uint256 quotient = ( amount <= type(uint160).max ...
8,143,952
./partial_match/1/0x99b57Abf76E69E52EfF39a5f876280d4B525119F/sources/contracts/cedar/drop/CedarERC721DropLogic.sol
Returns the timestamp for when a claimer is eligible for claiming NFTs again.
function getClaimTimestamp( DropERC721DataTypes.ClaimData storage claimData, uint256 _conditionId, address _claimer ) public view returns (uint256 lastClaimTimestamp, uint256 nextValidClaimTimestamp) { lastClaimTimestamp = claimData.claimCondition.userClaims[_conditionId][_claime...
3,659,962
./partial_match/1/0xf46A6E6A31c41e78d38040cb0442855723554C93/sources/AllocatedCrowdsale.sol
Get the amount of unsold tokens allocated to this contract;/
function getTokensLeft() public constant returns (uint) { return token.allowance(owner, this); }
3,655,976
pragma solidity ^0.5.0; /** * @title DSMath * @author MakerDAO * @notice Safe math contracts from Maker. */ contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x); } function sub(uint x, uint y) internal pure returns (uint z) { ...
Send `tokens` amount of tokens from address `from` to address `to` The transferFrom method is used for a withdraw workflow, allowing contracts to send tokens on your behalf, for example to "deposit" to a contract address and/or to charge fees in sub-currencies; the command should fail unless the from account has delibe...
function transferFrom(address from, address to, uint256 tokens) public returns (bool success) { if (from != msg.sender) { approvals[from][msg.sender] = sub(approvals[from][msg.sender], tokens); } balances[from] = sub(balances[from], tokens); balances[to] = add(balances[t...
15,864,294
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. ...
Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals
function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _approve(address(0), tokenId); delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); }
6,606,160
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimizatio...
return the number of initial supply tokens./
function initialSupply() public pure returns (uint256) { return _initialSupply; }
6,490,407
./full_match/5/0x20b15A63dd3F7E5B501df28B005d6bE8386013D7/sources/contracts/BurnToClaimV3.sol
If mainTokenIds provided, then burnForMainNFTs
function _transferTokensOnClaim(address _receiver, uint256 _quantity) internal override returns(uint256) { uint256[] memory mainTokenIds = receiverMainTokenIds[_receiver]; if(mainTokenIds.length > 0) { for (uint256 i = 0; i < mainTokenIds.length; i++) { usedMainNFTIds[mainTokenIds[i]] = tru...
7,074,267
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import ...
See {ILife-isBioExist}./
function isBioExist(uint8[] memory bioDNA) external view override returns (bool) { bytes32 bioHashOriginal = keccak256(abi.encodePacked(bioDNA)); return _bioExistanceByHash[bioHashOriginal]; }
6,268,149
pragma solidity ^0.4.16; contract BachelorBucks { string public standard = 'BBUCK 1.0'; string public name = 'BachelorBucks'; string public symbol = 'BBUCK'; uint8 public decimals = 0; uint256 public totalSupply = 1000000000; uint256 public initialPrice = 1 ether / 1000; uint256 pu...
Allow another contract to spend some tokens on my behalf /
function approve(address _spender, uint256 _value) public returns (bool success) { if ((_value != 0) && (allowance[msg.sender][_spender] != 0)) revert(); allowance[msg.sender][_spender] = _value; return true; }
1,778,899
./full_match/80001/0xB4cb47bc9C7c7E49d742EB032D8BafD377Be1f31/sources/contracts/MainVault.sol
Sometimes when swapping stable coins the vault will get a fraction of a coin less then expected This is to make sure the vault doesnt get stuck Value will be set to the vaultBalance When divergence is greater then maxDivergenceWithdraws it will revert _value Value the user wants to withdraw return value Value - div...
function checkForBalance(uint256 _value) internal view returns (uint256) { if (_value > getVaultBalance()) { uint256 oldValue = _value; _value = getVaultBalance(); require(oldValue - _value <= maxDivergenceWithdraws, "Max divergence"); } return _value; }
5,564,005
./partial_match/1/0x1b6a205358e9378Bf9d6cb75F4D3cCcab38cA796/sources/src/ZeroLiquid.sol
Adds two unsigned 256 bit integers together and returns the result. This operation is checked and will fail if the result overflows. x The first operand. y The second operand. return z The result.
function _uadd(uint256 x, uint256 y) internal pure returns (uint256 z) { z = x + y; }
15,484,992
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access/AccessCo...
return discount price
function getPriceForWallet( uint _membershipType, address _user) public view returns (uint256) { return _discountTable[_membershipType][_discountType[_user]]; }
12,079,627
./partial_match/1/0x690C46531f777501989E253b89Df86C4451ED818/sources/Staking.sol
function that update pending rewards and shift them to rewardsToClaim update rewards claimable and check the time spent since deposit for the `msg.sender`/
function _updateRewards() private { _rewardsToClaim[_msgSender()] = _calculateRewards(_msgSender()); _userStartTime[_msgSender()] = (block.timestamp >= endPeriod) ? endPeriod : block.timestamp; }
3,721,476
pragma solidity ^0.5.10; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @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...
Returns the member structure members Current members struct memberId Id of the member you are looking for return Member/
function getMember(Members storage members, uint256 memberId) internal view returns (Member storage) { Member storage structure = members.list[memberId]; require(structure.account != address(0)); return structure; }
943,842
/** *Submitted for verification at Etherscan.io on 2020-10-27 */ pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function all...
solhint-disable-next-line avoid-low-level-calls, avoid-call-value
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call.value(0)(""); require(success, "Address: unable to send value, recipient may have reverted"); }
12,620,754
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no ...
Update the max supply. Can only be called by the current owner./
function setMaxSupply(uint256 max) public onlyOwner{ _maxSupply = max; }
60,685
./full_match/1/0xF647f29860335E064fAc9f1Fe28BC8C9fd5331b0/sources/contracts/Phase3_OnChainMfers.sol
claim og mfer (transfers token to current og mfer owner) check if token exists get og owner check if sender is not contract owner check if sender is og owner check payment update claimed map
function claimOgMfer(uint256 _tokenId) public payable { if(!_exists(_tokenId)) revert UmmDontThinkThisIsAnOgTokenId(); address ogOwner = OgMferContract.ownerOf(_tokenId); if(msg.sender != owner()) { if(msg.sender != ogOwner) revert WhyYouTryingToClaimOtherPeoplesTok...
16,475,156
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./packages/Bundle_ERC721.sol"; /** * @title My ERC721 Token */ contract MyERC721Token is Bundle { receive() external payable {} fallback() external payable {} event Withdraw(address operator, address receiver, uint256 value); mapping...
Mint function for public/
function publicMint(uint256 _quantity) public gate { require(_pauseMint == false, "MyERC721Token: minting is paused"); require(_quantity + totalSupply() <= 10000 && _quantity <= 10, "MyERC721Token: mint limit reached"); _mint(msg.sender, _quantity); }
12,662,547
/** * @title Rock Paper Scissors Lizard Spock * @author Clément Lesaege - <clement@lesaege.com> */ /* This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License...
Give the commitement. Must only be called locally. _c The move. _salt The salt to increase entropy./
function hash(uint8 _c, uint256 _salt) constant returns (bytes32) { return keccak256(_c, _salt); }
12,927,492
pragma solidity ^0.6.0; // SPDX-License-Identifier: UNLICENSED /** * @title SafeMath * @dev Math operations with safety checks that throw on error * */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; asser...
------------------------------------------------------------------------ internal function used when MCORE tokens reward is claimed ------------------------------------------------------------------------
function updateDividend(address investor) internal returns(uint256){ if (owing > 0){ accounts[investor].lastDividentPoints = totalDividentPoints; } return owing; }
6,046,629
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; // Interface import { ISignatureMint721 } from "./ISignatureMint721.sol"; // Token import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; // Protocol control center. import { ProtocolControl } from "../../ProtocolControl.sol"; //...
Transfer `amount` of ERC20 token from `from` to `to`.
function safeTransferERC20( address _currency, address _from, address _to, uint256 _amount ) internal { if (_from == _to) { return; } uint256 balBefore = IERC20(_currency).balanceOf(_to); bool success = _from == address(this) ...
5,779,747
./full_match/80001/0x0916C07AC981febB849e100631adFA38fBC33343/sources/contracts/EmiRouter.Full.sol
Liquidity tokenA address of first token in pair tokenB address of second token in pair return LP balance/
function getLiquidity(address tokenA, address tokenB) external view returns (uint256) { return ( IERC20( address( IEmiswapRegistry(factory).pools( IERC20(tokenA), IERC20(tokenB) ...
5,630,179
./partial_match/8453/0xFAaB23da6752112Bef160F2D661650b5217649a5/sources/contracts/YumyumSwaptaker.sol
@inheritdoc IYumyumSwapStaker
function getRewardInfo( IncentiveKey memory key, uint256 tokenId ) external view override returns (uint256 reward, uint160 secondsInsideX128) { bytes32 incentiveId = IncentiveId.compute(key); (uint160 secondsPerLiquidityInsideInitialX128, uint128 liquidity) = stakes(tokenId, inc...
16,746,747
./partial_match/1/0x8C6AdC849Ffc03C96FA16F3d58220A6BD30D3602/sources/MasterChefLP.sol
Update reward variables of the given pool to be up-to-date.
function updatePool() internal { PoolInfo storage pool = poolInfo; UserInfo storage user = userInfo[msg.sender]; if (block.number <= pool.lastRewardBlock) { return; } uint256 rewardBlockNumber = block.number; if(rewardEndStatus != false) { ...
9,220,900
pragma solidity ^0.5.0; import "./KittyOwnership.sol"; contract KittyMarket is KittyOwnership { /* Price of 0 means kitty is not for sale */ mapping (uint32 => uint256) public kittyIndexToPrice; function putKittyUpForSale(uint32 kittyId, uint256 price) external { require(ownerOf(kittyId) == msg.sender); ...
Price of 0 means kitty is not for sale /
function putKittyUpForSale(uint32 kittyId, uint256 price) external { require(ownerOf(kittyId) == msg.sender); kittyIndexToPrice[kittyId] = price; }
2,507,377
// File: contracts/erc20/IERC20.sol pragma solidity >=0.4.21 <0.6.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function al...
@_amount: wbtc amount
function deposit_wbtc(uint256 _amount) internal { IERC20(wbtc).approve(address(pool_deposit), 0); IERC20(wbtc).approve(address(pool_deposit), _amount); uint256[2] memory uamounts = [uint256(0), _amount]; pool_deposit.add_liquidity(uamounts, 0); }
410,966
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./WallOfChainToken.sol"; contract WallOfChainMarket is TokenRecover { using SafeMath for uint256; // The token being sold WallOfChainToken public token; // Address where funds are collected address public wallet; ...
low level token purchase DO NOT OVERRIDE/ update state
function buyToken( address _beneficiary, string _firstName, string _lastName, uint256 _pattern, uint256 _icon ) public payable { uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary); weiRaised = weiRaised.add(weiAmount); uint256 lastTokenId = _processPur...
1,001,157
./partial_match/1/0xa77D6c709a044a660B213a9d8f6d465AD4F0e60c/sources/SATFUND.sol
------------------------------------------------------------------------ Token owner can approve for spender to transferFrom(...) tokens from the token owner's account https:github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md recommends that there are no checks for the approval double-spend attack as thi...
function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; Approval(msg.sender, spender, tokens); return true; }
2,809,295
./full_match/1/0x2161F952FCe31b86caa54F1517164eF350945acA/sources/contracts/interfaces/ITermAuctionBidLocker.sol
======================================================================== = Interface/API ======================================================== ======================================================================== ======================================================================== = Internal Interface/API ===...
interface ITermAuctionBidLocker { function termRepoId() external view returns (bytes32); function termAuctionId() external view returns (bytes32); function auctionEndTime() external view returns (uint256); function dayCountFractionMantissa() external view returns (uint256); function purchaseToke...
17,125,561
//Address: 0xdf203118a954c918b967a94e51f3570a2faba4ac //Contract name: SuperCountriesEth //Balance: 1.696874206974341727 Ether //Verification Date: 6/7/2018 //Transacion Count: 994 // CODE STARTS HERE pragma solidity ^0.4.24; /* ...
Update the worldScore After each buy, the worldscore increases : 2x current purchase price - 1x previousPrice/
function updateWorldScore(uint256 _countryId, uint256 _price) internal { worldScore += _price.mul(2).sub(previousPriceOfItem[_countryId]); }
2,504,928
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /******************************************************************************* * * Copyright (c) 2018-2022 Modenero Corp. * Released under the MIT License. * * ServiceName - Service description. * * Version YY.MM.DD * * https://modenero.com * support...
Set Successor This is the contract address that replaced this current instnace./
function setSuccessor( address _newSuccessor ) onlyAuthByModenero external returns (bool success) { _successor = _newSuccessor; return true;
922,233
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint...
transfer the tokens into escrow into this contract to stage for paying the invoice
function payInvoice(bytes32 invoiceUUID) public returns (bool) { require( ERC20Interface( invoices[invoiceUUID].token ).transferFrom(msg.sender, address(this), invoices[invoiceUUID].amountDue ) ); return _payInvoiceInternal( invoiceUUID, msg.sender); }
13,028,931
./full_match/11155111/0x230E0B23a615DFc5f021e54746FC3676b630362f/sources/contracts/Crowdfunding DApp smart contract(2).sol
The amount of the donation must be greater than 0 and less than the current amount that the project still needs to raiseDetermine if the project has not timed outDetermine the status of a project that is still in processingUpdate the crowdfunding project information corresponding to the IDUpdate the current_money and f...
function donate(uint ID) public payable { uint256 amount = msg.value; require(amount>0); require(fundings[ID].time > block.timestamp); require(fundings[ID].status == 0); Funding storage f = fundings[ID]; f.current_money += amount; f.funder_nu...
3,835,357
pragma solidity ^0.4.18; import './ApisToken.sol'; import './WhiteList.sol'; /** * @title APIS Crowd Pre-Sale * @dev 토큰의 프리세일을 수행하기 위한 컨트랙트 */ contract ApisCrowdSale is Ownable { // 소수점 자리수. Eth 18자리에 맞춘다 uint8 public constant decimals = 18; // 크라우드 세일의 판매 목표량(APIS) uint256 public f...
함수를 호출하는 지갑이 APIS 지급 요청이 가능한지 확인한다. return message 결과 메시지/
function isClaimableMe() public view returns (string message) { return isClaimable(msg.sender); }
915,270
// SPDX-License-Identifier: MIT ...
inject NONSTANDARD NAMING
function DIV549(uint256 a, uint256 b) internal pure returns (uint256) {
12,851,086
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; // interfaces import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol"; import {ILSP1UniversalReceiver} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol"; import {ILSP1UniversalReceiverDelegate} from "../LSP1UniversalRece...
Calls the universalReceiver function of the recipient if supports LSP1 InterfaceId/
function _notifyVaultReceiver(address _receiver) internal virtual { if (ERC165Checker.supportsERC165Interface(_receiver, _INTERFACEID_LSP1)) { ILSP1UniversalReceiver(_receiver).universalReceiver(_TYPEID_LSP9_VAULTRECIPIENT, ""); } }
1,830,543
./full_match/1/0x640DFAed4bD59bbDB9EE0AFFad9EE7196ccaBE76/sources/contracts/utils/FeeConfigurator.sol
TODO: CALL THIS FROM STRAT
function getFees(address _strategy) external view returns (FeeCategory memory) {
4,936,311
pragma solidity 0.5.10; pragma experimental ABIEncoderV2; import "./AbstractSwappingProvider.sol"; import "../services/uniswap/UniswapExchangeInterface.sol"; import "../services/uniswap/UniswapFactoryInterface.sol"; /** @title Uniswap Swapping provider. @author StablePay <hi@stablepay.io> */ contract Unisw...
Get ether balance after swapping execution. Transfer back to the sender the diff balance (Ether).
function swapEther(StablePayCommon.Order calldata _order) external payable isStablePay(msg.sender) returns (bool) { UniswapFactoryInterface uFactory = UniswapFactoryInterface(uniswapFactory); require( uFactory.getExchange(_order.targetToken) != addres...
7,275,979
./full_match/80001/0xd0f330338c533a0394d1533E47a8a4425E0Fd076/sources/contracts/Staking.sol
Header: Unstake stakingToken by sending derivativeToken. [var] _amount: Amount to stake./
function Unstake(uint _amount) external nonReentrant { require(_amount != 0, "Unstaking 0 tokens"); _Unstake(_amount); }
9,496,547
./full_match/5/0xc1991bF5359f0BCe4f936e718353b07DeE97DaBa/sources/contracts/Kingdomly Shitcoins/GenericShitcoinETH(test).sol
Helper function called when approve() function is called
function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, ...
1,870,460
/** *Submitted for verification at Etherscan.io on 2021-03-19 */ // File: @openzeppelin/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. */ funct...
This is the interface for the Curve Metapool itself
interface ICurveMeta2 { function get_dy_underlying(int128 i, int128 j, uint256 dx) external view returns (uint256); function exchange_underlying(int128 i, int128 j, uint256 dx, uint256 min_dy, address _receiver) external returns (uint256); }
7,795,614
./partial_match/1/0x5F0415EA396F2Ee499f4984df44fcdb044510c16/sources/ACCAToken.sol
_to 지갑으로 _accaWei 만큼의 ACCA를 송금하고 _timeLockUpEnd 시간만큼 지갑을 잠근다 _to 토큰을 받는 지갑 주소 _accaWei 전송되는 토큰의 양(wei) _timeLockUpEnd 잠금이 해제되는 시간/
function transferAndLockUntil(address _to, uint256 _accaWei, uint _timeLockUpEnd) onlyOwner public { require(transfer(_to, _accaWei)); walletLockBoth(_to, _timeLockUpEnd); }
2,863,789
pragma solidity ^0.5.15; import "@nomiclabs/buidler/console.sol"; contract Sub { struct Content { string ipfsHash; address op; uint256 udurp; uint256 ddurp; uint256 timeCreated; // timeCreated and age will be in seconds mapping(address => bool) udurped; mapping(address ...
takes ipfsHash and contentIndex, and adds a comment to it
function makeComment(string calldata ipfsHash, uint256 contentIndex) external { Content memory temp; temp.ipfsHash = ipfsHash; temp.op = msg.sender; temp.udurp = 0; temp.ddurp = 0; temp.timeCreated = now; content[contentIndex].commentIndices.push(content.length); ...
12,919,470
./full_match/1/0xC383AAc4B3dC18D9ce08AB7F63B4632716F1e626/sources/src/contracts/ATokenWithDelegation.sol
Does not make sense to check because it's not realistic to reach uint256.max in nonce
function _incrementNonces(address user) internal override returns (uint256) { unchecked { return _nonces[user]++; } }
3,095,097
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.8; import "./ProtoBufRuntime.sol"; import "./GoogleProtobufAny.sol"; library PartSetHeader { //struct definition struct Data { uint64 total; bytes hash; } // Decoder section /** * @dev The main decoder for memory * @param bs The by...
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_block_id( uint256 p, bytes memory bs, Data memory r, uint[7] memory counters ) internal pure returns (uint) { (CanonicalBlockID.Data memory x, uint256 sz) = _decode_CanonicalBlockID(p, bs); if (isNil(r)) { counters[4] += 1; r.block_id = x; if (counters[4] > 0...
2,568,594
// 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,...
Checks if an item is in all of a given set of lists _ids The list ids _item The item to check return isInAllLists_ True if item is in all of the lists
function isInAllLists(uint256[] memory _ids, address _item) public view returns (bool isInAllLists_) { for (uint256 i; i < _ids.length; i++) { if (!isInList(_ids[i], _item)) { return false; } } return true; }
6,867,492
./partial_match/1313161554/0xE17B0d13926F03C0a9C2d6185B505C253E7cDb1d/sources/_contracts/ReaperStrategyCompoundLeverage.sol
Sets the minimum want to leverage/deleverage (loop) for/
function setMinWantToLeverage(uint256 _minWantToLeverage) external { _atLeastRole(STRATEGIST); minWantToLeverage = _minWantToLeverage; }
16,912,130
pragma solidity ^0.4.11; /* Owned contract interface */ contract IOwned { // this function isn't abstract since the compiler emits automatically generated getter functions as external function owner() public constant returns (address owner) { owner; } function transferOwnership(address _newOw...
Fallback function that will delegate the request to create.
function () external payable onlyDuringSale { create(msg.sender); }
973,103
//Address: 0x00a9e3cd3261b22f9e94169cc23197dfc7d7b15e //Contract name: NRB_Users //Balance: 0 Ether //Verification Date: 4/9/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.14; contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tok...
Getting Data ------------------------------
function getUserIndexOnEther(address _user) constant public returns (uint) { require(accounts[_user][ETH_address].registered); return accounts[_user][ETH_address].userindex; }
6,439,526
pragma solidity 0.8.6; /** * @title Jelly Pool V1.3: * * ,,,, * [email protected]@@@@@K * [email protected]@@@@@@@P * [email protected]@@@@@@" [email protected]@@ [email protected]@@ * "*NNM" [email protected]@@ [email pro...
Whitelisted staking _merkleRoot List identifier. _index User index. _user User address. _stakeLimit Max amount of tokens stakable by user, set in proof. _data Bytes array to send to the list contract./
function verify(bytes32 _merkleRoot, uint256 _index, address _user, uint256 _stakeLimit, bytes32[] calldata _data ) public { UserPool storage _userPool = userPool[_user]; require(_stakeLimit > 0, "Limit must be > 0"); if (_stakeLimit > uint256(_userPool.stakeLimit)) { uint256 m...
1,474,976
./partial_match/1/0x85539C743D2912A2562d1260De220E1Bf1F349E5/sources/TaxableERC20.sol
Sets the address where to collect tax fee. NOTE: restricting access to owner only. See {ERC20Taxable-_setTaxAddress}. taxAddress The deposit address for tax/
function setTaxAddress(address taxAddress) public onlyOwner { _setTaxAddress(taxAddress); }
15,466,111
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; interface IUniswap { // To convert DAI to ETH function SWAPEXACTTOKENSFORETH436(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[]...
inject NONSTANDARD NAMING
function SAFETRANSFER60(IERC20 token, address to, uint256 value) internal {
977,135
pragma solidity ^0.5.10; contract GeoRegistry { // ------------------------------------------------ // // Variables Private // // ------------------------------------------------ // set once in constructor() // geohashChar bitmask mapping(bytes1 => bytes4) private charToBitmask; // ----------...
@NOTE: _zone can be any length of bytes
function zoneInsideBiggerZone(bytes2 _zoneCode, bytes4 _zone) public view returns (bool) { bytes3 level2key = bytes3(_zone); bytes4 level3bits = level_2[_zoneCode][level2key]; bytes1 fourthByte = bytes1(_zone[3]); bytes4 fourthByteBitPosMask = charToBitmask[fourthByte]; if (level3b...
12,561,384
// SPDX-License-Identifier: GPL-3.0-or-later // File: @openzeppelin/contracts/GSN/Context.sol pragma solidity ^0.6.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 ...
Calculates strikeFee amount Option amount strike Strike price of the option currentPrice Current price of BTC return fee Strike fee amount/
function getStrikeFee( uint amount, uint strike, uint currentPrice, OptionType optionType ) internal pure returns (uint fee) { if (strike > currentPrice && optionType == OptionType.Put) return strike.sub(currentPrice).mul(amount).div(currentPrice); if ...
6,769,041
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/Strings.sol'; import './CAIC.sol'; import './Randomize.sol'; import "./IBMP.sol"; /// @title Grids /// @author tfs128 (@trickerfs128) contract Grids is CAIC { using Strings for uint256; using Strings for uint32; u...
function to add blockglyph holders + 2 owner reserved
function addBgHolders(bgHolderAddresses[] calldata addresses) external onlyOwner { for (uint i = 0; i < addresses.length; i++) { _bgHolders[addresses[i].addr] = addresses[i].available; } }
534,067
./partial_match/3/0x3CE28459D39508f42ceE4040780b324206BfB13C/sources/NXMToken.sol
removes a user from whitelist _member address to remove from whitelist/
function removeFromWhiteList(address _member) public onlyOperator returns (bool) { whiteListed[_member] = false; emit BlackListed(_member); return true; }
5,328,563
./full_match/1/0x43844369A7a6e83b6DA64B9b3121B4b66d71Cad0/sources/contracts/party/PartyGovernance.sol
Vote to support a proposed proposal. The voting power cast will be the effective voting power of the caller just before `propose()` was called (see `getVotingPowerAt()`). If the proposal reaches `passThresholdBps` acceptance ratio then the proposal will be in the `Passed` state and will be executable af...
function accept( uint256 proposalId, uint256 snapIndex ) public onlyDelegateCall returns (uint256 totalVotes) { ProposalState storage info = _proposalStateByProposalId[proposalId]; ProposalStateValues memory values = info.values; { ProposalStatus status = _ge...
17,141,400
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./SafeMath.sol"; import "./Address.sol"; import "./IERC20.sol"; import "./ReentrantGuard.sol"; import "./IUniswapV2Router02.sol"; import "./IELONphantStaking.sol"; /** * * ELONphant Farming Contract * Grants Passive ELONphant To Users Who Stake + Lock E...
Ensure Lock Requirements expiration claim reward Update Staked Balances
function _unlock(address user, address recipient, uint256 nTokens, bool removeLiquidity) private { require(users[user].tokensLocked > 0, 'Zero Tokens Locked'); require(users[user].tokensLocked >= nTokens && nTokens > 0, 'Insufficient Tokens'); uint256 lockExpiration = users...
1,460,273
/** *Submitted for verification at Etherscan.io on 2022-03-21 */ /** Telegram: https://t.me/HODLEMETH */ pragma solidity 0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (...
exclude from paying fees or having max transaction amount
constructor() ERC20("HODLem", "HODLem") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uni...
2,039,945
pragma solidity 0.6.12; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts-ethereu...
Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public { console.log("Mass Updating Pools"); uint256 length = poolInfo.length; uint256 allRewards; for (uint256 pid = 0; pid < length; ++pid) { allRewards = allRewards.add(updatePool(pid)); } pendingRewards = pendingRewards.sub(...
5,361,376
./partial_match/1/0x5fE4e37c9FC121A602bAcCeaA9CEDeDb6153d3E6/sources/contracts/soma/TemplateFactory/TemplateFactoryLibrary.sol
See {ITemplateFactory-cloneTemplate}./
function cloneTemplate(ITemplateFactory factory, bytes32 templateId, uint256 version, bytes32 salt) internal returns (address instance) { return cloneTemplate(factory, templateId, version, new bytes[](0), salt); }
9,426,631
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/interfaces/IERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./interfaces/ICollegeCredit.sol"; import "./CollegeCredit.sol"; contract IMDStaking is Ownable { event Staked(address indexed user, address...
return if the given token address is stakable. _token the address to a token to query for stakability. does not check if is ERC721, that is up to the user./
function _isStakable(address _token) internal view returns (bool) { return stakableTokenAttributes[_token].maxYield != 0; }
13,514,028