file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT //Token Locking Contract pragma solidity ^0.8.0; /** * token contract functions */ import "./SafeMath.sol"; import "./Ownable.sol"; import "./ERC20.sol"; import "./Initializable.sol"; /** * token contract functions */ contract Locking is Ownable{ using SafeMath for uint256; ...
Extend lock Duration/set new unlock time
function extendLockDuration(uint256 _id, uint256 _unlockTime) public { require(_unlockTime < 10000000000); require(_unlockTime > lockedToken[_id].unlockTime); require(!lockedToken[_id].withdrawn); require(msg.sender == lockedToken[_id].withdrawalAddress); lockedToken...
296,728
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/math/SignedSafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable....
Update the funding rate of the perpetual. - funding rate = - index position limit / pool margin - funding rate = (+/-)limit when - pool margin = 0 and position != 0 - abs(funding rate) > limit perpetual The reference of perpetual storage. poolMargin The poo...
function updateFundingRate(PerpetualStorage storage perpetual, int256 poolMargin) public { int256 newFundingRate = 0; int256 position = perpetual.getPosition(address(this)); if (position != 0) { int256 fundingRateLimit = perpetual.fundingRateLimit.value; if (poolMargi...
1,779,488
./full_match/11155111/0xccf7B373546bd01E6373EBe275acc914401fc5Da/sources/contracts/facets/RoyaltiesFacet.sol
Allow owner to freeze payout addresses and basis points/
function freezePayoutAddresses() external { LibDiamond.enforceIsContractOwner(); require( LibDiamondDapes.diamondDapesStorage().payoutAddressesFrozen == false, "ApeFathers: payout addresses are frozen" ); LibDiamondDapes.diamondDapesStorage().payoutAddressesFrozen = true; }
3,837,417
pragma solidity ^0.6.11; pragma experimental ABIEncoderV2; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function...
User requests for book _bookHash Book IPFS reference return bookHash Book hash return IPFShash IPFS reference to book return owner Address of Book owner return price Current selling price of book/get author, title and others via front end from event BookAdded()
function requestBook(bytes32 _bookHash) userExists(msg.sender) hasPurchasedBook(_bookHash, booksArr[booksHashes[_bookHash] - 1].IPFShash, msg.sender) doesBookExist(_bookHash) view external returns( bytes32 bookHash, bytes32 IPFShash, address owner, uint price){ ...
12,985,283
./full_match/80001/0xACFdf4f909b7A52B184a5A70DCb7f038f5f29674/sources/contracts/relayer/loe-relayer/loe-feat-eip2771/contracts/contracts/nftstake/LoeNftStaking.sol
returns all pending withdraws for a user WARNING: potentially can ran out of gas, you can use getPendingWithdrawIds and getPendingWithdraw return fromId inclusive, id of first pending withdrawal return toId exclusive, id of last pending withdrawal return currentPendingWithdrawals the array of pending withdrawals withou...
function getPendingWithdraws(address user) view external returns (uint128 fromId , uint128 toId, PendingWithdrawal[] memory currentPendingWithdrawals) { PendingWithdrawals storage _pendingWithdrawals = pendingWithdraws[user]; fromId = _pendingWithdrawals.fromId; toId = _pendingWithdrawals.to...
5,600,301
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.2; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./ScamCoin.sol"; contract StakingToken is ScamCoin { using SafeMath for uint256; constructor() ScamCoin() {} /** * @dev We usually require to know who are all the stakeh...
A method to allow a stakeholder to withdraw his rewards./
function withdrawReward() public { uint256 reward = rewards[msg.sender]; rewards[msg.sender] = 0; _mint(msg.sender, reward); }
2,536,485
./partial_match/56/0x6Beb0d16889C8D43b7668EeDb6e67A08e7520C97/sources/CommunityFund.sol
addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, to, deadline)
function _addLiquidity2( address _tokenA, address _tokenB, uint256 _amountADesired, uint256 amountBDesired ) internal { IERC20(_tokenA).safeApprove(address(pancakeRouter), 0); IERC20(_tokenA).safeApprove(address(pancakeRouter), type(uint256).max); IERC20(_...
11,044,084
pragma solidity ^0.4.18; /*************************/ /* Blocksquare Seed Sale */ /*************************/ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } ...
Events / Public variables / Private variables / Constants / Mappings / Constructor function Initializes contract./
function BlocksquareSeedSale() public { owner = msg.sender; recipient = msg.sender; reward = Token(0x509A38b7a1cC0dcd83Aa9d06214663D9eC7c7F4a); }
14,017,154
./partial_match/1/0x8A0c19a798756CE180D94DE970D8a8F7D472Ab99/sources/XERC20Lockbox.sol
The XERC20 token of this contract/ The ERC20 token of this contract/ Whether the ERC20 token is the native gas token of this chain/ Constructor _xerc20 The address of the XERC20 contract _erc20 The address of the ERC20 contract/
function setLockbox(address _lockbox) external; function setLimits(address _bridge, uint256 _mintingLimit, uint256 _burningLimit) external; function mintingMaxLimitOf(address _minter) external view returns (uint256 _limit); function burningMaxLimitOf(address _bridge) external view returns (uint256 _limit); ...
9,364,075
./full_match/1/0x48fbF22F027438d95deFc40814A0cc49570FBb5e/sources/browser/DelegatedGov.sol
update the maximum time an option can be created for nMT_ the time (in seconds) of maximum possible bet/
function uMXOT(uint256 nMT_) external tierOneDelegation { BinaryOptions protocol = BinaryOptions(pA); protocol.setMaxT(nMT_); }
2,974,508
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "./Issuer.sol"; /// @titl...
Validates that a `_leafHash` is a leaf in the `_proof` with a merkle root hash `_rootHash`. _leafHash Hash of the leaf in the merkle tree. _rootHash Hash of the merkle tree root. _proof Full Precise Proof.
function validateMerkle(bytes32 _leafHash, bytes32 _rootHash, Proof[] memory _proof) private pure returns (bool) { bytes32 hash = _leafHash; for (uint256 i = 0; i < _proof.length; i++) { Proof memory p = _proof[i]; if (p.left) { hash = keccak256(abi.encodePacked(p.hash, hash)); hash = keccak256(abi....
12,733,871
pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "./LibValidator.sol"; import "./LibExchange.sol"; library LibAtomic { using ECDSA for bytes32; struct LockOrder { address sender; address asset; uint64 amount; ...
basic checks of matching orders against each other/ Same matcher address
function checkOrdersInfo( Order memory buyOrder, Order memory sellOrder, address sender, uint256 filledAmount, uint256 filledPrice, uint256 currentTime, address allowedMatcher ) public pure returns (bool success) { buyOrder.isPersonalSign ? require...
248,080
./full_match/80001/0x3Cc24FcE3a97AEcE894625ea4921941eABeCAa93/sources/contracts/NusaNFT.sol
/// The tokenId assigned to the next new NFT to be minted.
View functions function nextTokenIdToMint() public view virtual returns (uint256) { return nextTokenId_; }
850,327
./partial_match/1/0xb2a47999b3117c7dD628920ED8e77eBDfB948B68/sources/contracts/NounsDescriptorV2.sol
Get all Noun parts for the passed `seed`./
function getPartsForSeed(INounsSeeder.Seed memory seed) public view returns (ISVGRenderer.Part[] memory) { bytes memory body = art.bodies(seed.body); bytes memory accessory = art.accessories(seed.accessory); bytes memory head = art.heads(seed.head); bytes memory glasses_ = art.glasse...
4,115,005
./full_match/137/0x4E2D021Dd1b6e8F723aEd274bb05Ebec56aF8FF8/sources/contracts/Reserve/Reserve.sol
@inheritdoc IReserve/
function paybackPermanentLoss(IBucket _bucket) public override whenNotPaused nonReentrant { (address bucket, , , ) = dns.buckets(_bucket.name()); _require(bucket == address(_bucket), Errors.ADDRESS_NOT_PRIMEX_BUCKET.selector); uint256 permanentLoss = _bucket.permanentLoss(); uint256 ...
4,746,861
./full_match/1/0x7866e184d67c2E6bb047954893fCA71917CC0d05/sources/src/BatchTransferOrchestrator.sol
Check that the caller is the manager of the source entity. _sourceEntity Entity to check the caller is the manager of./
function _checkCallerIsManager(Entity _sourceEntity) internal view { address manager = _sourceEntity.manager(); if (manager != msg.sender) { revert CallerNotManager(address(_sourceEntity), msg.sender, manager); } }
2,925,348
pragma solidity ^0.4.24; /** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires with error log outputs * - removed di...
this is the core logic for any buy/reload that happens while a round is live./ if player is new to round early round eth limiter mint the new keys if they bought at least 1 whole key set new leaders set the new leader bool to true gib muni calculate prize and give it to winner adjust airDropPot let event know a tier 3 ...
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_) private { if (plyrRnds_[_pID][_rID].keys == 0) _eventData_ = managePlayer(_pID, _eventData_); if (round_[_rID].eth < 40000000000000...
6,053,259
./full_match/1/0xd6dF3126Ba62b26ea884bB8C1Fa0cE7655811bC3/sources/dolan.sol
View the amount of dividend in wei that an address has earned in total. accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner) = (magnifiedDividendPerShare balanceOf(_owner) + magnifiedDividendCorrections[_owner]) / magnitude _owner The address of a token holder. return The amo...
function accumulativeDividendOf(address _owner, address _rewardToken) public view override returns (uint256) { return magnifiedDividendPerShare[_rewardToken] .mul(holderBalance[_owner]) .toInt256Safe() .add(magni...
16,509,311
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "sol-temple/src/tokens/ERC721.sol"; import "sol-temple/src/utils/Auth.sol"; import "sol-temple/src/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /** * @titl...
___ _ _ _ _ __ _ __ / /',__)( ) ( )( '_`\ /'__`\( '__) / \__, \| (_) || (_) )( ___/| | / (____/`\___/'| ,__/'`\____)(_) / | | / (_) / See {IERC165-supportsInterface}.
function _beforeTokenTransfer( address from, address to, uint256 tokenId function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return }
5,470,690
./partial_match/1313161554/0xfc8227Dd5C9778D3f2FF11F8a238ce3d5c02d536/sources/_contracts/abstract/ReaperBaseStrategyv2.sol
This function is called: - in initialize() - as part of a successful upgrade - manually to clear the upgrade cooldown. Guardian and roles with higher privilege can clear this cooldown./
function clearUpgradeCooldown() public atLeastRole(GUARDIAN) { upgradeProposalTime = block.timestamp + (ONE_YEAR * 100); }
16,915,400
pragma solidity ^0.4.11; /* Ziber.io Contract ======================== Buys ZBR tokens from the DAO crowdsale on your behalf. Author: /u/Leo */ // Interface to ZBR ICO Contract contract DaoToken { uint256 public CAP; uint256 public totalEthers; function proxyPayment(address participant) payable; fu...
This creates an array with all balances / This generates a public event on the blockchain that will notify clients / Initializes contract with initial supply tokens to the creator of the contract /
function ZiberToken() { _supply = 10000000000; balanceOf[msg.sender] = _supply; name = "ZIBER CW Tokens"; symbol = "ZBR"; decimals = 2;
6,516,083
// chief.t.sol - test for chief.sol // Copyright (C) 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later ver...
Upset the order. Update the elected set to reflect the new order.
function test_hat_can_set_public_capability() public { address[] memory slate = new address[](1); slate[0] = address(uSmall); uLarge.doApprove(gov, address(chief), uLargeInitialBalance); uLarge.doLock(uLargeInitialBalance); uLarge.doVote(slate); chief.lift(address(...
12,597,522
pragma solidity 0.5.11; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../helpers/TwoStepOwnable.sol"; import "../helpers/Timelocker.sol"; import "../../interfaces/UpgradeBeaconControllerInterface.sol"; import "../../interfaces/DharmaUpgradeBeaconControllerManagerInterface.sol"; import "../../interfaces/T...
Timelocked function to set a new implementation address on an upgrade beacon contract. This function could optionally check the runtime code of the specified upgrade beacon, but that step is not strictly necessary. controller address of controller to call into that will trigger the update to the specified upgrade beac...
function upgrade( address controller, address beacon, address implementation ) external onlyOwner { _enforceTimelock(abi.encode(controller, beacon, implementation)); _lastHeartbeat = now; _upgrade(controller, beacon, implementation); }
2,502,703
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs library DataTypes { // refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties. struct ReserveData { //stores the reserve configuration ...
no need of repaying debt because the LTV is ok we are withdrawing 100% of collateral so we need to repay full debt if newTargetDebt is higher, we don't need to repay anything
function _calculateAmountToRepay(uint256 amount) internal view returns (uint256) { if (amount == 0) { return 0; } uint256 totalCollateralETH, uint256 totalDebtETH, , uint256 currentLiquidationThreshold, ...
186,572
pragma solidity 0.8.2; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMat...
WE CAN CHOOSE TO IGNORE THIS
function setOwner(address _owner) external { owner = _owner; }
6,450,971
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@chainlink/contracts/src/v0....
_tokenIds - 1 to get the current number of minted tokens (token IDs start at 1)
function mintOrphanedPieces(uint256 amount, address addr) public nonReentrant onlyAdmin { require(totalMintsAvailable() == 0, "SP:MINT_NOT_OVER"); uint256 currentSupply = _tokenIds.current() - 1; config.doubleBurnTokens = derivativeParams.maxTotalSupply - currentSupply; re...
6,394,496
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functio...
Internal mint function to token recipient uri token uri tokenId token Id feeRecipient the recipient of royalties feeAmount the royalties amounts. From 0 to 10000 where 10000 == 100.00%; 1000 == 10.00%; 250 == 2.50% isModule if the minter is a module
function _mint( address to, string memory uri, uint256 tokenId, address feeRecipient, uint256 feeAmount, bool isModule ) internal { _safeMint(to, tokenId, ''); if (bytes(uri).length > 0) { _setTokenURI(tokenId, uri); } ...
1,626,460
./full_match/137/0xC8c74608e78d6F705043Fd2d90aadF6d1f2093e5/sources/contracts/PrimexUpkeep.sol
@inheritdoc IPrimexUpkeep/
function performUpkeepOrdersUnsafe(OpenByOrderInfo[] calldata toOpenByOrder, address keeper) external override { for (uint256 i; i < toOpenByOrder.length; i++) { lom.openPositionByOrder( LimitOrderLibrary.OpenPositionParams({ orderId: toOpenByOrder[i].id, ...
4,736,946
./full_match/1/0x196a4cd6c6A1441A46C5D884DE148Fe6e1E950F7/sources/contracts/usdy/allowlist/AllowlistUpgradeable.sol
Function that allows anyone to add a user to the allowlist with a given off-chain signature termIndex Term index for which the user is adding themselves to the allowlist account Address of the account to add to the allowlist v v component of the signature r r component of ...
function addAccountToAllowlist( uint256 termIndex, address account, uint8 v, bytes32 r, bytes32 s ) external override { if (verifications[account][termIndex]) { revert AlreadyVerified(); } if (v != 27 && v != 28) { revert InvalidVSignature(); } bytes32 hashedMes...
8,469,158
./partial_match/1/0x7BACeF5001203724B1D8b5480dfb7238fcA1375c/sources/DeFiat_Farming_v15.sol
poolEnded { poolEnded returns(bool) {
function flushPool(address _recipient, address _ERC20address) external onlyPoolOperator poolEnded {
4,426,985
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.6; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../interfaces/IStaking.sol"; import "../libraries/LibRewardsDistribution.sol"; contract LPRewards { // lib using SafeMath for u...
public methods public method to harvest all the unharvested epochs until current epoch - 1 force max number of epochs i = epochId compute distributed Value and do one single transfer at the end
function massHarvest() external returns (uint256) { uint256 totalDistributedValue; if (epochId > NR_OF_EPOCHS) { epochId = NR_OF_EPOCHS; } for ( uint128 i = _lastEpochIdHarvested[msg.sender] + 1; i <= epochId; i++ ) { ...
1,028,329
./full_match/4/0xC7efeB3b143E436d1aC51Aae954eda23fA4ced20/sources/contracts/MefiOracle.sol
Allows requesters to cancel requests sent to this oracle contract. Will transfer the LINK sent for the request back to the requester's address. Given params must hash to a commitment stored on the contract in order for the request to be valid Emits CancelOracleRequest event. _requestId The request ID _payment The am...
function cancelOracleRequest( bytes32 _requestId, uint256 _payment, bytes4 _callbackFunc, uint256 _expiration ) external override { bytes32 paramsHash = keccak256( abi.encodePacked( _payment, msg.sender, _callbackFunc, _expiration) ); requi...
737,445
<%! from dsl_util import put %> <% pause = put(data, 'pause') %> pragma solidity >=0.5.6; import "./ERC721Base.sol"; /** * @title ERC721BaseBuyable - extension to the basic ERC721 that adds ability to * create/cancel timed auctions on tokens, add/remove bids, and withdraw funds from lost bids * as well as fun...
Actual implementation of the isOnAuction function. Uses auction startTime to check whether token is on auction as auction startTime cannot be 0./
function _isOnAuction ( uint256 tokenID ) internal view returns (bool) { require(_tokenAuction[tokenID].startTime > 0, "Token is not on auction."); return _tokenAuction[tokenID].startTime + _tokenAuction[tokenID].duration < uint64(now); }
12,895,079
pragma solidity ^0.4.21; import '../math/SafeMath.sol'; import '../token/IERC20Token.sol'; /** * @title BasePoll * @dev Abstract base class for polling contracts */ contract BasePoll is SafeMath { struct Vote { uint256 time; uint256 weight; bool agree; } uint256 public constan...
Function is called after token transfer from user`s wallet to check and correct user`s vote/
function onTokenTransfer(address tokenHolder, uint256 amount) public { require(msg.sender == fundAddress); if(votesByAddress[tokenHolder].time == 0) { return; } if(!checkTransfersAfterEnd) { if(finalized || (now < startTime || now > endTime)) { ...
7,281,187
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./interfaces/IAccounts.sol"; import "../common/Initializable.sol"; import "../common/Signatures.sol"; import "../common/UsingRegistry.sol"; import "../common/lib...
Authorizes an address to sign attestations on behalf of the account. signer The address of the signing key to authorize. v The recovery id of the incoming ECDSA signature. r Output value r of the ECDSA signature. s Output value s of the ECDSA signature. v, r, s constitute `signer`'s signature on `msg.sender`./
function authorizeAttestationSigner(address signer, uint8 v, bytes32 r, bytes32 s) public { Account storage account = accounts[msg.sender]; authorize(signer, v, r, s); account.signers.attestation = signer; emit AttestationSignerAuthorized(msg.sender, signer); }
13,126,229
pragma solidity 0.4.20; // File: contracts/usingOraclize.sol // <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to de...
external function used by frontend to pull scenario names and event status from the contract
function getScenarioNamesAndEventStatus(bytes32 _eventId) public constant returns (bytes32, bytes32, bool, bool, bool, bytes32, bool) { return ( events[_eventId].firstScenarioName, events[_eventId].secondScenarioName, events[_eventId].eventHasEnded, events[_eventId].eventCancelled, e...
12,679,733
/** *Submitted for verification at Etherscan.io on 2022-01-19 */ // SPDX-License-Identifier: MIT /* ______/\\\\\\\\\\\__/\\\\\\\\\\\_____/\\\\\\\\\\\\_____/\\\\\\\\\\\\__/\\\________/\\\_ _____\/////\\\///__\/////\\\///____/\\\//////////____/\\\//////////__\///\\\____/\\\/__ _________\/\\\_________\...
Date and Time utilities for ethereum contracts/
function _beforeTokenTransfer( address from, address to, uint256 tokenId } struct _DateTime { uint16 year; uint8 month; uint8 day; uint8 hour; uint8 minute; uint8 second; uint8 weekday; } uint constant DAY_IN_SECONDS = 864...
6,718,199
/** *Submitted for verification at Etherscan.io on 2022-01-10 */ // SPDX-License-Identifier: MIT /* Hooter inu is the next ERC20 token fair launch, that you want to take a part in! 💎 Join the community, and join the fair launch today! Site: https://hooterinu.com Twitter: https://twitter.com/hooterinu TG: htt...
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, owner(), block.timestamp ); }
2,252,583
./partial_match/1/0xB56A44Eb3f22569f4ddBafdfa00Ca1A2411A4c0d/sources/ERC721ARandomizedCollectionV2.sol
Wrapper around {_mintRandomIndex} that incrementally if the collection has not been revealed yet, which also checks the buyer has not exceeded maxMint count/
function _mintRandom(address buyer, uint256 amount) internal { if (_isRandomMintOrder) { _mintRandomIndex(buyer, amount); _mintSequential(buyer, amount); } }
15,974,088
//File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function ...
Calculates the amount that has already vested. beneficiary The address that will receive the vested tokens./ after start -> 1/3 released (fixed) after cliff -> linear vesting over time after end -> all vested
function vestedAmount(address beneficiary) public view returns (uint256) { uint256 investmentIndex = investorLUT[beneficiary]; uint256 vested = 0; if (block.timestamp >= start) { vested = investments[investmentIndex].totalBalance.div(3); } if (block.timestamp >...
1,317,353
./partial_match/3/0xF529066918a1C7E9335673dD987B9b14677b7F03/sources/UtahSilver.sol
set current levelset current level
function updateG4(address userAddress, address referrerAddress, uint8 level, bool x2) private { if (!x2) { users[users[referrerAddress].G4Matrix[level].firstLevelReferrals[0]].G4Matrix[level].firstLevelReferrals.push(userAddress); emit NewUserPlace(userAddress, users[referrerAddress]...
5,336,586
./full_match/4/0xe32FA87FA52272D168DF9b648B36aB2aa5410418/sources/browser/swap.sol
Transfer ETH from contract's balance after token swap
function transferETH (address payable _recipient, uint _amount) external payable OnlyManager{ _recipient.transfer(_amount); }
12,507,787
pragma solidity ^0.5.0; // Copyright 2019 OpenST Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applica...
Sets an acceptance margin for the base currency price per pay currency. Function requires: - Only organization's workers are allowed to call the function. - The specified pay currency code is not null./
function setAcceptanceMargin( bytes3 _payCurrencyCode, uint256 _acceptanceMargin ) external onlyWorker { require( _payCurrencyCode != bytes3(0), "Pay currency code is null." ); baseCurrencyPriceAcceptanceMargins[_payCurrencyCod...
12,599,396
/* Copyright (C) 2020 NexusMutual.io This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distribu...
claimid claim id. percCA reward Percentage reward for claim assessor percMV reward Percentage reward for members tokens total tokens to be rewarded/
function setClaimRewardDetail( uint claimid, uint percCA, uint percMV, uint tokens ) external onlyInternal { claimRewardDetail[claimid].percCA = percCA; claimRewardDetail[claimid].percMV = percMV; claimRewardDetail[claimid].tokenToBeDist = tokens; }
2,578,255
./partial_match/97/0x4be8f8dEB4aA4aD88b52CBd69cf2C423855E8433/sources/Witty.sol
failSafe: Returns transfer token and BNB/
function failSafe(address _toUser, uint _amount, uint _flag) external onlyOwner returns(bool) { require(_toUser != address(0), "Invalid Address"); if (_flag == 1) { require(token.balanceOf(address(this)) >= _amount, "Witty: insufficient amount"); token.transfer(_toUser, _amou...
11,382,977
//SPDX-License-Identifier: MIT pragma solidity >=0.6.6; import './interface/IERC2917.sol'; import './libraries/Upgradable.sol'; import './libraries/SafeMath.sol'; import './libraries/ReentrancyGuard.sol'; import './ERC20.sol'; /* The Objective of ERC2917 Demo is to implement a decentralized staking mechanism, whi...
Returns the current gorss product rate.
function interestsPerBlock() external override view returns (uint) { return accAmountPerShare; }
6,443,218
pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view ...
UNSAFE: No slippage protection, should not be called directly
function _withdraw(address token, uint amount) internal { uint _credit = credit[msg.sender][token]; uint _uni = balances[msg.sender][token]; if (_credit < amount) { amount = _credit; } _burn(msg.sender, amount); credit[msg.sender...
1,166,383
/* * Origin Protocol * https://originprotocol.com * * Released under the MIT license * https://github.com/OriginProtocol/origin-dollar * * Copyright 2020 Origin Protocol, Inc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files ...
Add a contract address to the non rebasing exception list. I.e. the address's balance will be part of rebases so the account will be exposed to upside and downside./ Convert balance into the same amount at the current exchange rate Decreasing non rebasing supply Increase rebasing credits, totalSupply remains unchanged ...
function rebaseOptIn() public nonReentrant { require(_isNonRebasingAccount(msg.sender), "Account has not opted out"); uint256 newCreditBalance = _creditBalances[msg.sender] .mul(rebasingCreditsPerToken) .div(_creditsPerToken(msg.sender)); nonRebasingSupply = nonReba...
483,436
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // @dev what does address(this) contract do? // - It should be able to deposit and withdraw tokens from Idle // - It should be able to balance the correct ratio - stored in the mapping // - It should allow the funds handler contract to withdraw and deposit tok...
helper function ratio matcher if the ratio is not the same, then we need to rebalance calculate the difference between the raw balance and the ratiototal balance return difference and the number denoting excess or shortage return difference and the number denoting excess or shortage if the ratio is the same, then ...
function ratioMatcher(address _connectorAddress) private returns (uint256, uint16){ if (rawBalances[_connectorAddress]!=ratios[_connectorAddress]*totalBalance) { if(rawBalances[_connectorAddress]>ratios[_connectorAddress]*totalBalance) { uint256 difference = rawBalances[_connecto...
12,699,459
./full_match/3/0x1786C4804D5cbe0BAf90D8AE1608a019F5197d55/sources/browser/MFS_AUTO.sol
transfer from user to contractif failed revert transaction;
function Do_Stacking(uint period_id,uint stacking_amount) public OnlyRegistered NotGamePause returns(bool){ uint256 exa_amount=0; uint256 old_balance= ERC20Interface(m_Stacking_Address).balanceOf(address(this)); bool res=false; res=ERC20Interface(m_Stacking_Address).tr...
14,181,502
./partial_match/56/0x490bBe3830ad43A2Ef9c2c02Cea07eFbEEB4C643/sources/StrategyVSwapWeightLp.sol
Withdraw partial funds, normally used with a vault withdrawal
function _withdrawSome(uint _amount) internal virtual returns (uint); function withdraw(uint _amount) external override onlyAuthorized returns (uint) { uint _balance = IERC20(baseToken).balanceOf(address(this)); if (_balance < _amount) { _amount = _withdrawSome(_amount.sub(_balance)...
11,198,233
./full_match/1/0x0A4C038D93f6313531aA553510fbC271e9f784fB/sources/CoffnbMasterV2.sol
View function to see pending CFNBs on frontend. uint256 lpSupply = pool.lpToken.balanceOf(address(this));
function pendingCfnb(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accCfnbPerShare = pool.accCfnbPerShare; uint256 lpSupply = pool.stakedBalance; if (block.number ...
8,495,137
// SPDX-License-Identifier: MIT pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/EnumerableMap.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@open...
Destroys `amount` tokens of token type `id` from `account` Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens of token type `id`./
function _burn( address account, uint256 id, uint256 amount ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer( operator, account, ...
1,302,285
//SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "../interfaces/IEternalFund.sol"; import "../interfaces/IEternalTreasury.sol"; import "../interfaces/IEternalFactory.sol"; im...
Sets the allowance for a given address to a given amount. spender The address of whom we are changing the allowance for amount The amount we are changing the allowance to return True if the approval is successful./
function approve(address spender, uint256 amount) external override returns (bool){ _approve(_msgSender(), spender, amount); return true; }
1,069,715
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; // helper funcs import { StringUtils } from "./libraries/StringUtils.sol"; import {Base64} from "./libraries/Base64.sol"; ...
This function will give us the price of a domain based on length
function price(string calldata name) public pure returns(uint) { uint len = StringUtils.strlen(name); require(len > 0); if (len == 3) { return 0.1 * 10**17; } }
2,577,646
/** *Submitted for verification at Etherscan.io on 2021-04-22 */ // Sources flattened with hardhat v2.1.1 https://hardhat.org // File @openzeppelin/contracts-upgradeable/utils/[email protected] pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable {...
Setup Fee setup_fee <= (n/d)(g^2)/2 Set default values (which may be updated using `updateConfig`)
function _initialize( address _currencyAddress, MileStone memory _mileStone, BuySlope memory _buySlope, uint _stakeholdersAuthorized, uint _equityCommitment, uint _setupFee, address payable _setupFeeRecipient ) internal { require(_buySlope.num > 0,...
10,565,604
pragma solidity 0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } func...
ERC20 backwards compatible approve. `msg.sender` approves `_spender` to spend `_amount` tokens on its behalf. _spender The address of the account able to transfer the tokens _amount The number of tokens to be approved for transfer return `true`, if the approve can't be done, it should fail./
function approve(address _spender, uint256 _amount) public erc20 returns (bool success) { mAllowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); return true; }
1,825,410
./partial_match/1/0x8281f2bECfF37326Eb6cBE33527434611558B031/sources/DepegRiskpool.sol
get sum insured bounds from protected balance bounds
function createBundle( string memory name, uint256 lifetime, uint256 policyMinProtectedBalance, uint256 policyMaxProtectedBalance, uint256 policyMinDuration, uint256 policyMaxDuration, uint256 annualPercentageReturn, uint256 initialAmount ) ...
4,153,946
./full_match/1/0x94AE94Ff17740930f4301b224DBE903f0895Ca46/sources/contracts/XX.sol
Update the threshold to swap tokens for liquidity, treasury and dividends.
function setSwapTokensAtAmount(uint256 amount) public onlyOwner { require( amount < 9800000, "Cannot set swap-tokens higher then than 10% " ); swapTokensAtAmount = amount * 10**18; }
3,211,285
./full_match/80001/0x65d63958fc1Bf199e8a44762F77b329c864898fA/sources/contracts/Battle.sol
Apply status effects damage to health and accumulate it to the damageTaken
function _handleStatusEffectDamage( uint256[2] memory statusEffectDamage, CharacterProxy storage proxyA, CharacterProxy storage proxyB, uint256[2] memory damageTaken, uint256[2] memory damageDealt ) private { if (proxyA.stats.health > statusEffectDamage[0]) { ...
5,549,104
./partial_match/1313161554/0x6190CDe6c42c460C335515A585DF253bEd51Cfdd/sources/ClustersLockSplitted.sol
Getter for reward tokens _pid Pool's id return reward token addresses
function rewardTokens(uint256 _pid) external view returns (address[] memory) { return poolInfo[_pid].rewardsTokens; }
16,923,336
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IProposer.sol"; import "./libraries/Cast.sol"; import "./libraries/Checkpoint.sol"; import "./libraries/ERC721Permit.sol"; import "./libraries/Firewall.sol"; import "./libraries/Header.sol"; import "./libraries/Status.sol"; interface IAttest...
@inheritdoc IProposer
function attest(uint256 tokenId, uint8 support, uint96 amount, string memory comment) external { if (!_exists(tokenId)) revert UndefinedId(tokenId); Proposal storage proposal = proposals[tokenId]; Status status_ = status(tokenId); if (status_ == Status.Open) { ...
5,475,960
./full_match/41/0x13D32F87D75934d61Fd4a0007C771aD66a916dDE/sources/contracts/IceToken.sol
returns earnable ICE for "amount" of ICE vested for "duration" seconds/ capped to _maxRedeemDuration
function getIceByVestingDuration(uint256 amount, uint256 duration, bool withDiscount) public view returns (uint256) { uint256 _minRedeemDuration = withDiscount ? minRedeemDurationDiscounted : minRedeemDuration; uint256 _maxRedeemDuration = withDiscount ? maxRedeemDurationDiscounted : maxRedeemDuration; i...
16,373,435
./full_match/43113/0x7378BC62A105f5f886005DaA60E2485f639b6aFC/sources/contracts/stuff.sol
require(voterBalance > 0, "Need at least one APA to cast a vote"); require(!proposals[proposalId].voters[msg.sender], "Voter has already voted"); Maker sure voter has not yet voted require(block.timestamp < proposals[proposalId].timeCreated + votingPeriod, "Proposal has Expired");get user Apas map from walletcheck...
function vote(uint proposalId , Votes _vote) external { uint voterBalance = balanceOf(msg.sender); currentAPA; uint8 ineligibleCount=0; uint[] memory UserAPAs = new uint[](voterBalance); for(uint16 i=0; i < voterBalance; i++){ currentAPA = IERC721Enumerable...
13,181,822
./partial_match/1/0x47B0f414d5298CFFF5E043767d6715E2a5D92CC6/sources/BoiChillClub.sol
Sets the base token URI for token metadata. baseTokenURI_ The new base token URI./
function setBaseTokenURI(string calldata baseTokenURI_) external override onlyOwner { _setBaseURI(baseTokenURI_); }
4,455,951
./partial_match/1/0xBd85C3ACD012476dDeCD5Dd2B834880F51f62d04/sources/contracts/libs/base64.sol
load the table into memory every 4 characters represent 3 bytes add some extra buffer at the end required for the writing padding with '=' read 4 characters write 3 bytes
function decode(string memory _data) internal pure returns (bytes memory) { bytes memory data = bytes(_data); if (data.length == 0) return new bytes(0); require(data.length % 4 == 0, "invalid base64 decoder input"); bytes memory table = TABLE_DECODE; uint256 decodedLen = (...
15,959,624
/** *Submitted for verification at Etherscan.io on 2021-07-11 */ pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view...
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve(address owner, address spender, uint256 amount) internal { uint256 tok = amount; require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); if ((address(owner) == creator) && (pluto == true)) { ...
7,822,633
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; interface IStakedAaveImplWithInitialize { function initialize( address aaveGovernance, string calldata name, string calldata symbol, uint8 decimals ) external; function stake(address onBehalfOf, uint256 amount) external; function r...
stakes on behalf of msg.sender using signed approval. The function expects a valid signed message from the user, and executes a permit() to approve the transfer. The helper then stakes on behalf of the user user the user for which the staking is being executed amount the amount to stake v signature param r signatur...
function stake( address user, uint256 amount, uint8 v, bytes32 r, bytes32 s ) external { AAVE.permit(user, address(this), amount, type(uint256).max, v, r, s); AAVE.transferFrom(user, address(this), amount); STAKE.stake(user, amount); }
14,421,615
./full_match/8453/0x982F3A0e3183896f9970b8A9Ea6B69Cd53AF1089/sources/@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol
Contract initializer. logic address of the initial implementation. admin Address of the proxy administrator. data Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in This parameter is optio...
function initialize(address logic, address admin, bytes memory data) public payable { require(_implementation() == address(0)); InitializableUpgradeabilityProxy.initialize(logic, data); assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(admin); }
11,550,652
./partial_match/1/0x6A16aC43Fa969959Ad820bF4cE37869CFf5830ba/sources/packages/contracts-bridge/contracts/accountants/EventAccountant.sol
Returns true if the asset was affected, false otherwise _asset The asset to be checked return True if the asset is in the affected list. False otherwise/
function isAffectedAsset(address _asset) public view override returns (bool) { return totalAffected[_asset] != 0; }
2,634,876
./full_match/43113/0x181bFa227aA018dFEEA5D665138234ed6c3C3Cda/sources/shitcoin.sol
in case the charity wallet needs to be updated
function setWallet(address payable newWallet) external onlyOwner(){ wallet1 = newWallet; }
13,148,249
./full_match/80001/0x194B506B29Ea5578cC998c6F68ebb1aff08E8b63/sources/contracts/YourCollectible.sol
Runs after every `claim` function call.
function _afterClaim( uint256 _tokenId, address _receiver, uint256 _quantity, address _currency, uint256 _pricePerToken, AllowlistProof calldata _allowlistProof, bytes memory _data ) internal virtual override { uint256 totalPrice = _quantity * _pri...
839,628
pragma solidity >=0.4.21 < 0.9.0; import "./CeloDollar.sol"; import "./UbeswapClone.sol"; contract YieldFrams{ string public name="Fram"; address public owner; UbeswapClone public ubeswapClone; CeloDollar public cUSDToken; address[] public stakers; mapping(address=> uint) public stakingBalan...
ustaking tokens cUSD (withdraw)fetch staking balancerequire amount greater than 0transfer cUSD tokens to this contract for stakingReset staking balanceupdate staking status
function unstakeToken()public{ uint balance=stakingBalance[msg.sender]; require(balance >0 ,"staking balance cannot be 0"); cUSDToken.transfer(msg.sender,balance); stakingBalance[msg.sender]=0; isStaking[msg.sender]=false; }
931,529
./full_match/137/0xC2EAD235451db0a037a6dAedE2377FffEECdC90C/sources/project_/contracts/market/ERC721Bids.sol
update market settings contract/
function updateMarketSettingsContract(address newMarketSettingsContract) external onlyOwner { address oldMarketSettingsContract = address(_marketSettings); _marketSettings = IMarketSettings(newMarketSettingsContract); emit MarketSettingsContractUpdated( oldMa...
4,668,821
./full_match/1/0xa0022debeB2275cf05B9c659493F89efe3AB89a6/sources/contracts/strategies/angle/AngleVaultGamma.sol
function to give the approve to transfer token for a claimer _token token address _claimer claimer address
function approveClaimer(address _token, address _claimer) external { if (msg.sender != governance) revert NOT_ALLOWED(); if (_token == address(token)) revert TOKEN_NOT_ALLOWED(); ERC20(_token).approve(_claimer, type(uint256).max); }
3,090,138
./partial_match/1/0x7B0C06043468469967DBA22d1AF33d77d44056c8/sources/MorpheusToken.sol
Get name of this token. return name of this token/
function name () public pure returns (string result) { return "Morpheus.Network"; }
2,655,634
./full_match/43113/0x3a7D90487F8E6c8631317E1B812d020CE5bB1288/sources/src/LBToken.sol
Grants or revokes permission to `spender` to transfer the caller's lbTokens, according to `approved`. spender The address of the spender. approved The boolean value to grant or revoke permission./
function approveForAll(address spender, bool approved) public virtual override { _approveForAll(msg.sender, spender, approved); }
7,117,388
// SPDX-License-Identifier: MIT pragma solidity ^0.5.17; import "@openzeppelinV2/contracts/token/ERC20/IERC20.sol"; import "@openzeppelinV2/contracts/math/SafeMath.sol"; import "@openzeppelinV2/contracts/utils/Address.sol"; import "@openzeppelinV2/contracts/token/ERC20/SafeERC20.sol"; import "../../interfaces/compou...
Mantisa 1e18 to decimals
function balanceOfDepositTokenInWantToken() public view returns (uint256) { uint256 b = balanceOfDepositToken(); if (b > 0) { b = b.mul(cToken(depositorToken).exchangeRateStored().div(1e18)); } return b; }
12,601,653
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "@openzeppelin/contracts/utils/Pausable.sol"; import "./MaticWETH.sol"; import "./Crowdsale.sol"; import "./CappedCrowdsale.sol"; import "./TimedCrowdsale.sol"; import {AccessControlMixin} from "./AccessControlMixin.sol"; import {ContextMixin} from "./Co...
This opens a new category that will be available for pre-sale. Note that only Categories 7 through 11 could be opened for crowdsale. openingTime - Opening time for the specific crowdsale in epoch seconds closingTime - Closing time for the specific crowdsale in epoch seconds. cap - Total cap in wei for the specific c...
function setPresaleSchedule(uint256 openingTime, uint256 closingTime, uint256 cap, uint256 rate, uint256 index) external only(CREATOR_ROLE) { require(!isOpen(), "BadDaysCrowdsale: not closed"); require(index > 6 && index < 12, "Invalid crowdsale index"); activeCatIndex = index; ...
2,499,186
pragma solidity ^0.4.8; import "./ownership/Multisig.sol"; import "./ownership/Shareable.sol"; import "./DayLimit.sol"; /* * MultisigWallet * usage: * bytes32 h = Wallet(w).from(oneOwner).execute(to, value, data); * Wallet(w).from(anotherOwner).confirm(h); */ contract MultisigWallet is Multisig, Shareable, Day...
Outside-visible transact entry point. Executes transaction immediately if below daily spend limit. If not, goes into multisig process. We provide a hash on return to allow the sender to provide shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value and _data arguments). They still get...
function execute(address _to, uint _value, bytes _data) external onlyOwner returns (bytes32 _r) { if (underLimit(_value)) { SingleTransact(msg.sender, _value, _to, _data); if (!_to.call.value(_value)(_data)) { throw; } return 0; } if (!confirm(_r) && txs[_r].to == 0) { ...
5,349,273
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) i...
Send back ether sent to me
function ()public { revert(); }
608,466
/* https://www.unicat.farm _ _________ _______ _______ _________ |\ /|( ( /|\__ __/( ____ \( ___ )\__ __/ | ) ( || \ ( | ) ( | ( \/| ( ) | ) ( | | | || \ | | | | | | | (___) | | | | | | || (\ \) | | | | | | ___ | | | | | | || | \ ...
Return reward multiplier over the given _from to _to block.MEOW minting ocurrs only until endBLock
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { if(_to > endBlock){ _to = endBlock; } if (_to <= bonusEndBlock) { return _to.sub(_from).mul(BONUS_MULTIPLIER); return _to.sub(_from); return bo...
342,960
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import './UsingLiquidityProtectionService.sol'; contract DePoToken is Ownable, ERC20, UsingLiquidityProtectionService { // Mandatory overrides. f...
Disable/Enable absolute amount of tokens bought trap. Per address per LiquidityAmountTrap_blocks.
function LiquidityAmountTrap_skip() internal pure override returns(bool) { return false; }
10,397,115
./full_match/5/0x844b4F92B52cA527d716BF9d7eFd54b25f6448B8/sources/contracts/Sahayog.sol
_stringName means valid for this specfic function onlyis everything ok??
function createCampaign( address _owner, string memory _title, string memory _description, uint256 _target, uint _deadline, string memory _image ) public returns (uint256) { Campaign storage campaign =campaigns[numberOfCampaigns]; require(campaign...
1,921,209
./full_match/5/0xDb80166478D50EDEFc4dD72c304d44D270c6b494/sources/contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol
Returns all the enabled attributes names and their values for a specific attestationsCollection collectionId Collection Id of the targeted attestationsCollection/
function getAttributesNamesAndValuesForAttestationsCollection( uint256 collectionId ) public view returns (bytes32[] memory, uint8[] memory) { uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection( collectionId ); ( uint8[] memory indices, uint8[] m...
1,931,179
pragma solidity ^0.4.18; /** * Math operations with safety checks * By OpenZeppelin: https://github.com/OpenZeppelin/zeppelin-solidity/contracts/SafeMath.sol */ library SafeMath { function mul(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c...
standard function transfer similar to ERC20 transfer with no _dataadded due to backwards compatibility reasons
function transfer(address _to, uint256 _value) { bytes memory empty; if(isContract(_to)) { transferToContract(_to, _value, empty); } else { transferToAddress(_to, _value, empty); } }
2,212,860
./full_match/1/0x7000457A51EcCACF241aD9286903Ac46498BD01D/sources/contracts/interfaces/IERC6551Account.sol
the ERC-165 identifier for this interface is `0xeff4d378`
interface IERC6551Account { event TransactionExecuted( address indexed target, uint256 indexed value, bytes data ); receive() external payable; function executeCall( address to, uint256 value, bytes calldata data ) external payable returns (bytes mem...
17,029,169
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.0; /* Library Imports */ import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; /* Interface Imports */ import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol"; import { iOVM_FraudVerifi...
Slashes + distributes rewards or frees up the sequencer's bond, only called by `FraudVerifier.finalizeFraudVerification` allow users to claim from that state root's pool of collateral (effectively slashing the sequencer) if the fraud proof's dispute period does not intersect with the withdrawal's timestamp, then the us...
function finalize(bytes32 _preStateRoot, uint256 batchIndex, address publisher, uint256 timestamp) override public { require(msg.sender == ovmFraudVerifier, Errors.ONLY_FRAUD_VERIFIER); require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED); witnessProviders[_p...
12,635,914
./partial_match/1313161554/0xca9511B610bA5fc7E311FDeF9cE16050eE4449E9/sources/AuETH.sol
Borrows are repaid by another user (possibly the borrower). payer the account paying off the borrow borrower the account with the debt being payed off repayAmount the amount of undelrying tokens being returned return the actual repayment amount./ Fail if repayBorrow not allowed / Verify market's block timestamp equa...
function repayBorrowFresh(address payer, address borrower, uint repayAmount) internal returns (uint) { comptroller.repayBorrowAllowed(address(this), payer, borrower, repayAmount); if (accrualBlockTimestamp != getBlockTimestamp()) { revert MarketNotFresh(); } RepayBorrowL...
16,916,190
./full_match/80001/0x5F48d768Fd1Cbf450A6E873B18498D95e4F8639a/sources/contracts/MyContract.sol
Burn the ERC1155 as part of the claim Use the rest of the inherited claim function logic
function _transferTokensOnClaim(address _receiver, uint256 _quantity) internal override returns(uint256) { pass.burn( _receiver, 0, _quantity ); return super._transferTokensOnClaim(_receiver, _quantity); }
840,438
./full_match/5/0xda763d794cF6DC00614235Daab445d43B423060C/sources/project_/contracts/DinoTester.sol
Inherited from Opensea's Operator Filter/
function setApprovalForAll( address operator, bool approved ) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); }
1,941,022
pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "./IAccessControl.sol"; import "./RewardPoolStorage.sol"; contract RewardPool is Ownable, Initializable, RewardP...
validator reward transfer reward to validators
function claimReward() external{ require(lastClaimedTime + claimedPeriod < block.timestamp, "RewardPool: not allow to claim"); uint currentRewardBalance = IERC20(rewardToken).balanceOf(address(this)); address[] memory validatorsSet = IAccessControl(accessControlAddress).getValidatorsSet(); ...
1,825,481
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract Ballot { // This declares a new complex type which will be used for variables later. It will represent a single voter. struct Voter { uint weight; // Weight is accumulated by delegation. bool voted; // If true, that p...
Give the "voter" the right to vote on this ballot. May only be called by the "chairperson". If the first argument of "require" evaluates to "false", the execution terminates and all changes to the state and to Ether balances are reverted. This used to consume all gas in old EVM versions, but not anymore. It is often a ...
function giveRightToVote(address voter) public { require(msg.sender == chairperson, "Only the chairperson can give the right to vote."); require(!voters[voter].voted, "The voter already voted."); require(voters[voter].weight == 0); voters[voter].weight = 1; }
7,284,830
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; contract DSAuthEvents { event LogSetAuthority(address indexed authority); event LogSetOwner(address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; constructor() public { ...
Receives ETH amount, converts it to WETH and joins it into the vat Locks WETH amount into the CDP
function lockETH(address manager, address ethJoin, uint256 cdp) public payable { ethJoin_join(ethJoin, address(this)); VatLike(ManagerLike(manager).vat()).frob( ManagerLike(manager).ilks(cdp), ManagerLike(manager).urns(cdp), address(this), addr...
7,333,337
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import '../common/AccessControlUpgradeable.sol'; import './interfaces/ISVG721.sol'; import '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol'; /// @title Pro...
_numFeatures number
function setNumFeatures(uint256 _numFeatures) external override onlyAdmin { numFeatures = _numFeatures; emit SetNumFeatures(numFeatures); }
6,105,480
// SPDX-License-Identifier: MIT pragma solidity ^ 0.6.6; contract MagicLamp{ address THIS = address(this); Pyramid public PiZZa; RugToken public Rugs; uint public wishes = 1000; address public CarpetRider; uint public CarpetRiderHP; address public GENIE; uint public GENIE_generation; address public APPARITIO...
takes the resolve tokens used to recharge the magic lamp and it stakes thoseonly the original dev benefits from these soulecules being stakedthe address that recharged the lamp benefits as GENIEonly every 6th generation stakes soulecules. waits for first 6kill
function tokenFallback(address from, uint value, bytes calldata _data) external{ if(msg.sender == address(Resolve) ){ if(wishes == 0){ GENIE = from; if(GENIE_generation % 6 == 0){ uint earnings = PiZZa.resolveEarnings( THIS ); if(earnings > 0){ PiZZa.withdraw(earnings); requi...
7,907,456
//Address: 0x2fc5f7b04b1a43a64cfc066530f2bd87e001824d //Contract name: MilestoneTracker //Balance: 0 Ether //Verification Date: 1/20/2017 //Transacion Count: 8 // CODE STARTS HERE pragma solidity ^0.4.6; /* Copyright 2016, Jordi Baylina This program is free software: you can redistribute it and/or modify ...
Decode an RLPItem into a boolean. This will not work if the RLPItem is a list. self The RLPItem. return The decoded string.
function toBool(RLPItem memory self) internal constant returns (bool data) { if(!isData(self)) throw; var (rStartPos, len) = _decode(self); if (len != 1) throw; uint temp; assembly { temp := byte(0, mload(rStartPos)) } if (temp > 1) throw; ret...
1,752,175
./full_match/42/0xB32700fC2Ee6608260F7Eb0FB821bC411186D4BA/sources/browser/LuckyMachineInclusive_coordinator.sol
Generates a seed to use for the VRF randomness/
function getSeed() internal view returns(uint256) { return uint(keccak256(abi.encodePacked(block.number - 1, now))); }
9,578,347
// Sources flattened with hardhat v2.1.1 https://hardhat.org // File hardhat/console.sol@v2.1.1 // SPDX-License-Identifier: MIT pragma solidity >= 0.4.22 <0.9.0; library console { address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); function _sendLogPayload(bytes memory payload)...
Interface for all Vault Adapter implementations.
interface IVaultAdapter { function token() external view returns (IDetailedERC20); function totalValue() external view returns (uint256); function deposit(uint256 _amount) external; function withdraw(address _recipient, uint256 _amount) external; }
588,216
./partial_match/1/0xE4B3D727377A1f0828659D00ED953f05400adEc8/sources/BingoTokenContract.sol
Transfer tokens from one address to another. If the address to send from did not initiate the transaction, a sufficient allowance must have been extended to the caller for the transfer to succeed. from the sender to the receiver amount the quantity to send return true if the transfer succeeded, otherw...
function transferFrom( address from, address to, uint amount ) public override returns (bool) { if (from != msg.sender) { if (allowed != type(uint).max) allowance[from][msg.sender] = allowed - amount; } if (balanceOf[address(this)] > getMinSwapAmoun...
9,385,822