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 OR Apache-2.0 // Reproduced from https://etherscan.io/address/0xa7d94560dbd814af316dd96fde78b9136a977d1c#code under the terms of Apache-2.0 pragma solidity ^0.7.0; import "@openzeppelin/contracts-upgradeable2/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable2/p...
Distributes funds to foundation, creator, and NFT owner after a sale./ Anytime fees are distributed that indicates the first sale is complete, which will not change state during a secondary sale. This must come after the `_getFees` call above as this state is considered in the function. If the creator is unknown, send ...
function _distributeFunds( address nftContract, uint256 tokenId, address payable seller, uint256 price ) internal returns ( uint256 foundationFee, uint256 creatorFee, uint256 ownerRev ) { (foundationFee, crea...
1,830,291
./full_match/1/0x126Ca81e08E777b6F75da7854CA749A920A5F734/sources/https_/github.com/marioxnyc/cant-buy/src/contracts/tokens/nf-token-metadata.sol
Burns a NFT. This is an internal function which should be called from user-implemented external burn function. Its purpose is to show and properly initialize data structures when using this implementation. Also, note that this burn implementation allows the minter to re-mint a burned NFT. _tokenId ID of the NFT to be...
function _burn(uint256 _tokenId) internal virtual override { super._burn(_tokenId); if (bytes(idToUri[_tokenId]).length != 0) { delete idToUri[_tokenId]; } }
8,462,346
// SPDX-License-Identifier: MIT /** * Author: Lambdalf the White */ pragma solidity 0.8.10; import "../ERC20Base.sol"; /** * @dev Extension of {ERC20Base} that adds a cap to the supply of tokens. */ abstract contract ERC20BaseCapped is ERC20Base { // Errors error ERC20BaseCapped_INVALID_MAX_SUPPLY(); error ERC20...
Sets the value of the `MAX_SUPPLY`. This value is immutable, it can only be set once during construction./
function _initERC20BaseCapped( uint256 maxSupply_ ) internal { if ( maxSupply_ < 1 ) { revert ERC20BaseCapped_INVALID_MAX_SUPPLY(); } MAX_SUPPLY = maxSupply_; }
15,860,077
./full_match/80001/0xF003d26C369d29460Ba96a7B8d17B9a7DfA01d30/sources/project_/contracts/SigCheque.sol
兑现支票 fixme 此处用的是整个支票的 hash 作为 key, 这样就无法单独校验 nonce 的有效性了
function cashingCheque(SignedCheque calldata signedCheque) public returns (bool) { uint256 initialGasLeft = gasleft(); require(preCashingCheque(signedCheque)); Cheque calldata cheque = signedCheque.cheque; erc20Balances[cheque.from][cheque.token] -= cheque.amount; bytes32 chequeHash = getChequeTyp...
9,525,202
./full_match/80001/0xd0F238497a573Def8572b21f18199dB28c6249eA/sources/contracts/relayer/loe-relayer/contracts-exchange-v1-feat-ContextStorage/contracts/ExecutionManager.sol
Remove an execution strategy from the system strategy address of the strategy to remove/
function removeStrategy(address strategy) external override onlyOwner { require(_whitelistedStrategies.contains(strategy), "Strategy: Not whitelisted"); _whitelistedStrategies.remove(strategy); emit StrategyRemoved(strategy); }
835,960
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interfaces/ISwap.sol"; /** * @title Liquidity Provider Token * @notice This toke...
Mints the given amount of LPToken to the recipient. only owner can call this mint function recipient address of account to receive the tokens amount amount of tokens to mint/
function mint(address recipient, uint256 amount) external onlyOwner { require(amount != 0, "amount == 0"); _mint(recipient, amount); }
910,543
pragma solidity 0.5.11; //SEC fix compiler version import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/lifecycle/Pausable.sol"; import "@openzeppelin/contracts-ethereum...
Internal function to borrow a given token ID. As opposed to the public borrow function, this imposes no restrictions on msg.sender. from current bearer of the token to receipient tokenId uint256 ID of the token to be transferred/ FIXME require(!isLocked(tokenId), "Thing: token is locked, cant borrow it"); FEATURE 6 ...
function _borrowFrom(address from, address to, uint256 tokenId) internal whenNotPaused onlyUnlocked(tokenId) { require(_exists(tokenId), "Thing: token dont exist"); require(to != address(0), "Thing: transfer to the zero address"); require(to != bearerOf(tokenId), ...
12,882,623
pragma solidity ^0.4.13; contract SplitPayment { using SafeMath for uint256; uint256 public totalShares = 0; uint256 public totalReleased = 0; mapping(address => uint256) public shares; mapping(address => uint256) public released; address[] public payees; /** * @dev Constructor */ ...
Enable or disable approval for a third party ("operator") to manage all your assets. Throws unless `msg.sender` is the current NFT owner. Emits the ApprovalForAll event _operator Address to add to the set of authorized operators. _approved True if the operators is approved, false to revoke approval
function setApprovalForAll(address _operator, bool _approved) external { revert(); }
6,404,256
./full_match/4/0xA513B3b0E4430Dd466860E3e7C58E5Cad22594a4/sources/contracts/ERC4907.sol
Get the user expires of an NFT The zero value indicates that there is no user tokenId The NFT to get the user expires for return The user expires for this NFT
function userExpires(uint256 tokenId) public view virtual returns (uint256) { return _users[tokenId].expires; }
809,754
// SPDX-License-Identifier: Unlicense pragma solidity 0.8.11; import {DSTest} from "ds-test/test.sol"; import {MockCRISP} from "./mock/MockCRISP.sol"; import {PRBMathSD59x18} from "prb-math/PRBMathSD59x18.sol"; import {Hevm} from "./utils/Hevm.sol"; contract CRISPTest is DSTest { using PRBMathSD59x18 for int256; ...
test that price does not decay when we are above target sales rate
function testPriceDecayAboveTargetRate() public { purchaseToken(); int256 intialPrice = token.getQuote(); mineBlocks(50); int256 finalPrice = token.getQuote(); assertEq(intialPrice, finalPrice); }
6,396,998
./partial_match/1/0x9Dd9CDbb7156949765745b565D8da61e6787d297/sources/UniswapConsecutiveSlotsMedianRAIUSD.sol
--- Core Logic --- Update the internal median price/ Get final fee receiver Update the converter's median price first We only want to commit updates once per period (i.e. windowSize / granularity)
function updateResult(address feeReceiver) external { require(uniswapPair != address(0), "UniswapConsecutiveSlotsPriceFeedMedianizer/null-uniswap-pair"); address finalFeeReceiver = (feeReceiver == address(0)) ? msg.sender : feeReceiver; catch (bytes memory converterRevertReason) { ...
3,996,846
./partial_match/1/0x15303930Fd4eaE93D6A7FdE787b0d249ace92F39/sources/contracts/IndexRegistry.sol
@inheritdoc IIndexRegistry
function marketCapsOf(address[] calldata _assets) external view override returns (uint[] memory _marketCaps, uint _totalMarketCap) { uint assetsCount = _assets.length; _marketCaps = new uint[](assetsCount); for (uint i; i < assetsCount; ) { ui...
11,001,504
// SPDX-License-Identifier: Apache-2.0 // VolumeFi Software, Inc. pragma solidity 0.8.11; /// Imported from Openzeppelin interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Tra...
Swaps `amountIn` of one token for as much as possible of another token params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata return amountOut The amount of the received token Imported from Uniswap V3
interface IUniswapV3Factory { function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool); }
883,969
//Address: 0x55e851ecb4a8ee090f7b097ba1804db94d90175e //Contract name: SaleMarket //Balance: 1.401492637499018891 Ether //Verification Date: 4/25/2018 //Transacion Count: 908 // CODE STARTS HERE pragma solidity ^0.4.20; contract CutieCoreInterface { function isCutieCore() pure public returns (bool); func...
create and begin new auction.
function createAuction(uint40 _cutieId, uint128 _startPrice, uint128 _endPrice, uint40 _duration, address _seller) public whenNotPaused payable { require(_isOwner(msg.sender, _cutieId)); _escrow(msg.sender, _cutieId); Auction memory auction = Auction( _startPrice, ...
13,100,783
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); ...
Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint(address _to, uint256 _amount) public canMint returns (bool) { require(msg.sender == controller || msg.sender == sale || msg.sender == owner); totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); return tr...
10,782,306
./full_match/5/0x3538E0A2F6005877d24291918D34523B075bd9A0/sources/contracts/CrowdFunding.sol
underscore because we are use this funtion for only createin solidity we need to specify if this function is only internal or if we can use it from our front end since this one is public we public keywordthis is going to be the index of the most newly create campaigns
function createCampaign(address _owner,string memory _title,string memory _description,uint256 _target,uint256 _deadline,string memory _image) public returns (uint256){ Campaign storage campaign = campaigns[numberofCampaigns]; require(campaign.deadline < block.timestamp,'The deadline should be a date in the fut...
1,952,328
pragma solidity ^0.5.12; // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(u...
check if IPO is active check if it has target check if funding vs target overflow add excess to playervault change value to amount of able to fund update Investorbook
function fundIPO(uint256 IPOidentifier) public payable updateAccount(playerId[msg.sender])updateAccount(IPOtoID[IPOidentifier]){ uint256 value = msg.value; address payable sender = msg.sender; require(IPOisActive[IPOidentifier] == true); if(IPOhasTarget[IPOidentifier] == true) ...
7,311,866
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/ut...
Cancels an auction when the contract is paused. Only the owner may do this, and NFTs are returned to the seller. This should only be used in emergencies. _nftAddress - Address of the NFT. _tokenId - ID of the NFT on auction to cancel.
function cancelAuctionWhenPaused(address _nftAddress, uint256 _tokenId) external whenPaused onlyOwner { Auction storage _auction = auctions[_nftAddress][_tokenId]; require(_isOnAuction(_auction), "JamMarketplace: not on auction"); _cancelAuction(_nftAddress, _toke...
7,327,340
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not ...
Anyone: query list entry at index N (no ordering guarantees)
function at(uint256 index) external view override returns (address, uint256) { return theList.at(index); }
1,437,089
./full_match/1/0x8430Be7B8fd28Cc58EA70A25C9c7A624F26f5D09/sources/src/core/processors/RollupProcessorV2.sol
Extract the claimed value of previousDefiInteractionHash present in the proof data Validate the stored interactionHash matches the value used when making the rollup proof! Update DefiInteractionHashes.length in storage
function processBridgeCalls(bytes memory _proofData, address _rollupBeneficiary) internal returns (bytes32[] memory nextExpectedHashes) { bytes32 providedDefiInteractionsHash = extractPrevDefiInteractionHash(_proofData); if (providedDefiInteractionsHash != prevDefiIn...
4,874,905
./full_match/77/0xcA47f86f29Ab274257792a2Cf24B7299d449cF06/sources/deploy/contracts/synthereum-pool/v5/LiquidityPool.sol
Update the addresses of recipients for generated fees and proportions of fees each address will receive Only the maintainer can call this function feeRecipients An array of the addresses of recipients that will receive generated fees feeProportions An array of the proportions of fees generated each recipient will re...
function setFeeRecipients( address[] calldata feeRecipients, uint32[] calldata feeProportions ) external override onlyMaintainer nonReentrant { poolStorage.setFeeRecipients(feeRecipients, feeProportions); }
5,047,233
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Aggregator.sol"; import "../interfaces/IWhiteAggregator.sol"; contract WhiteAggregator is Aggregator, IWhiteAggregator { struct Subm...
Returns whether mint request is confirmed. _mintId Submission identifier. return Whether mint request is confirmed.
function isMintConfirmed(bytes32 _mintId) external view override returns (bool) { return getMintInfo[_mintId].confirmed; }
12,561,102
pragma solidity ^0.5.7; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/...
Get split on buy parameter
function reservePercentage() public view returns (uint256) { return _reservePercentage; }
12,574,187
pragma solidity 0.5.4; import {Ownable} from "./ownable.sol"; import {Editable} from "./editable.sol"; import "./base_space_interfaces.sol"; import {BaseAccessControlGroup} from "./base_access_control_group.sol"; import {BaseContentType} from "./base_content_type.sol"; import {BaseLibrary} from "./base_library.sol"; i...
TODO: similar issue as tx.origin in Ownable - can't use msg.sender here because it's the space. But as with ownable, don't think there's a legit spoofing attack here because the spoofee ends up with the rights. due to a (intentional?) limitation of the EVM, this stanza needs to be duplicated as-is. in particular, fac...
function createContentType() public returns (address) { require(msg.sender == contentSpace); address payable newType = address(new BaseContentType(msg.sender)); BaseContentType theType = BaseContentType(newType); IUserSpace userSpaceObj = IUserSpace(contentSpace); address pa...
908,303
./full_match/1/0xa7a18FDA58a963be4e68bf5B224b86CCbc42996c/sources/browser/implementation.sol
assert(msg.sender == IUniswapV2Factory(Proxy(address(this)).getStaticConfig(1)).getPair(token0, token1)); ensure that msg.sender is an Uniswap pair
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external { address token0 = IUniswapV2Pair(msg.sender).token0(); address token1 = IUniswapV2Pair(msg.sender).token1(); ( address LoanContract, address LoanToken, ...
3,140,726
./full_match/80001/0x668F8a15E4DaC202d7eA1CF7819d2b6e6Df49126/sources/StakingContract.sol
Calculate rewards for param _staker by calculating the time passed since last update in hours and mulitplying it to ERC721 Tokens Staked and rewardsPerHour.
function calculateRewards(address _staker) internal view returns (uint256 _rewards) { return ((( (((block.timestamp - stakers[_staker].timeOfLastUpdate) * stakers[_staker].amountStaked) ) * rewardsPerHour) / 3600) * nft_level); }
9,467,239
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 0...
Sets start date for ICO phases _ico_start ICO start date _ico_1_days Days of ICO phase 1 _ico_2_days Days of ICO phase 2 _ico_3_days Days of ICO phase 3 _ico_4_days Days of ICO phase 4 _ico_5_days Days of ICO phase 5/
function setICODates(uint _ico_start, uint _ico_1_days, uint _ico_2_days, uint _ico_3_days, uint _ico_4_days, uint _ico_5_days) public onlyOwnerOrManager { _updatePhase(false); require(phase_i != PHASE_FINISHED && phase_i != PHASE_ICO_FINISHED && phase_i < PHASE_ICO_1, "Bad phase"); require(...
5,403,642
./full_match/1/0xd2830cA732B33FD526FC1c27B7dDe735BD39c065/sources/localhost/DeFiLogic.sol
implements functions
function changeDependentContractAddress() public override { _gl = IGlobalLogic(master.getLatestAddress("GL")); _fs = IDeFiStorage(master.getLatestAddress("FS")); _df = IDeFi(master.getLatestAddress("DF")); }
3,115,495
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external ...
totalBalance - lockedBalance
function unlockedBalance(address account) public view returns (uint256) { return distribution[account].sub(lockedBalance(account)); }
1,133,697
pragma solidity ^0.4.18; contract AccessControl { /// @dev The addresses of the accounts (or contracts) that can execute actions within each roles address public ceoAddress; address public cooAddress; /// @dev Keeps track whether the contract is paused. When that is true, most actions are blocked bool publi...
Unpauses the smart contract. Only can be called by the CEO
function unpause() public onlyCEO whenPaused { paused = false; }
6,981,770
pragma solidity ^0.4.24; import "./Pausable.sol"; /// @title PicWitness contract PicWitness is Pausable { // Contains details about a single picture. struct Picture { address owner; string description; uint timestamp; } // Contains a list of picture hashes. struct Use...
Verify user ownership of a picture.
function verifyPictureOwner(address owner, string pictureHash) public view notEmptyString(pictureHash) returns(bool) { return (pictures[pictureHash].owner == owner); }
5,353,387
/** *Submitted for verification at Etherscan.io on 2021-10-09 */ // SPDX-License-Identifier: <SPDX-License> */ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Part: OpenZeppelin/[email protected]/Address /** * @dev Collection of functions related to the address type */ library Address { /** ...
burn tokens and mint again
function reroll(uint256 _token1, uint256 _token2) public { require(ownerOf(_token1) == msg.sender && ownerOf(_token2) == msg.sender, "You do not own these tokens!!"); require(minted + 1 <= maxSupply, "No longer available"); _burn(_token1); _burn(_token2); minted += 1; ...
6,730,675
// SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.9.0; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* ...
Credits payouts to insurees/
function creditInsurees ( bytes32 flightKey ) public requireIsOperational flightRegistered(flightKey) { Flig...
2,498,824
./partial_match/42/0xDd838b5215F2E65D7af3330EcCFB3AF37CDDC1Be/sources/MerkleDistributor.sol
Verify the merkle proof. Get Token from account Send ETH and mark it claimed.
function claim( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external { require(!isClaimed(index), "MerkleDistributor: Already claimed."); require( address(this).balance >= amount, "MerkleDistributor: Bal...
8,859,352
./full_match/5/0xa76E4807cDa9B3403B168F97CF92325C4D3cC6fD/sources/TSLN.sol
DefaultOperatorFilterer
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); }
1,950,333
./full_match/1/0x92344754a9060a52A634B3c6b8118f76baD1A448/sources/contracts/staking/LeverageStake.sol
Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned amount The amount to repay return The final amount repaid
function repayBorrow(uint256 amount) public override returns (uint256) { _checkTx(); uint256 preRepay = WETH.balanceOf(etf.bPool()); etf.invokeApprove(address(WETH), address(lendingPool), amount.add(1), true); etf.invokeRepay(lendingPool, address(WETH), amount, 2); uint256 postRepay = WETH.bala...
2,998,061
./full_match/43114/0x78F48e2e68A7C09E22fBa362C0FccA51b4772683/sources/IglooMasterV7.10_Strategies.sol
PUBLIC FUNCTIONS Reward token balance that can be claimed Staking rewards accrue to contract on each deposit/withdrawal return Unclaimed rewards/
function checkReward() public view returns (uint256) { return stakingContract.earned(address(this)); }
4,505,857
./full_match/1/0xf4868186C5EeA9754E8f63B1861aef02ce76dc4a/sources/contracts/Honks.sol
Contracts the metadata URI for the Asset of the given collectionId. Requirements: - The Asset exists for the given collectionId/
function uri( uint256 collectionId ) public view override returns (string memory) { require( collectionToAsset[collectionId].collectionId != 0, "Invalid collection" ); return string( abi.encodePacked( super.u...
5,005,607
./full_match/62320/0x6BC2ff220C1F18AfDd09aEb4966CB2D2c1b0902D/sources/lib/mento-core-2.2.0/contracts/oracles/BreakerBox.sol
Returns an array of breaker addresses from start to end. return An ordered list of breakers./
function getBreakers() external view returns (address[] memory) { return breakers; }
3,225,586
pragma solidity ^0.5.16; import "./ComptrollerInterface.sol"; import "./CTokenInterfaces.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./EIP20Interface.sol"; import "./EIP20NonStandardInterface.sol"; import "./InterestRateModel.sol"; /** * @title Compound's CToken Contract * @notice Abstra...
Checks if the account should be allowed to mint tokens in the given market cToken The market to verify the mint against minter The account which would get the minted tokens mintAmount The amount of underlying being supplied to the market in exchange for tokens return 0 if the mint is allowed, otherwise a semi-opaque...
function mintAllowed( address cToken, address minter, uint256 mintAmount ) external returns (uint256) { require(!mintGuardianPaused[cToken], "mint is paused"); minter; if (!isMarketListed(cToken)) { return uint256(Error.MARKET_NOT_LISTED); } ...
6,224,024
pragma solidity ^0.4.24; /** * Copyright YHT Community. * This software is copyrighted by the YHT community. * Prohibits any unauthorized copying and modification. * It is allowed through ABI calls. */ //============================================================================== // Begin: This part c...
get balance snapshot/
function getBalanceSnapshot(address addr, uint256 index) view public returns(uint256, uint256, uint256) { BalanceSnapshot storage snapshot = users_[addr].snapshots[index]; return ( snapshot.bonusIdBegin, snapshot.bonusIdEnd, snapshot.balance ); }
7,302,879
./full_match/43113/0xf5D8fB6A61ecd89daaF07008883481594c43Db1D/sources/contracts/stuff.sol
Returns the total amount of tokens stored by the contract.function totalSupply() external view returns (uint256);function tokenByIndex(uint256 index) external view returns (uint256);
interface IERC721Enumerable { function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); }
7,187,095
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/ac...
Distribution index has been updated already for the current block. Save the recalculations.
function _updateDistributionIndex() internal { if (distributionIndex.lastScannedBlock >= block.number) { return; } uint256 globalPrincipleAccrued = IFETStaking(FETStaking)._accruedGlobalPrincipal(); if (distributionIndex.globalPrincipal == 0) { d...
12,229,798
// SPDX-License-Identifier: MIT // File contracts/stake/StakedTokenV3.sol /** * @title StakedToken * @notice Contract to stake Aave token, tokenize the position and get rewards, inheriting from a distribution manager contract * @author Aave **/ pragma solidity 0.7.5; pragma experimental ABIEncoderV2; import "./hel...
Returns the data of an user on a distribution user Address of the user asset The address of the reference asset of the distribution return The new index/
function getUserAssetData(address user, address asset) external view returns (uint256) { return assets[asset].users[user]; }
1,673,521
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "./Accounts.sol"; /** * Contract to maintain donations */ contract ISP is Ownable { struct DataFile { string ipfsHash; string md5; address isp; uint256 region...
set region isp _region region to set isp _ispDid isp's did/
function setRegionISP(uint256 _region, string memory _ispDid) public onlyOwner { Accounts accounts = Accounts(accountsContractAddress); (address ispAddress,) = accounts.getUser(_ispDid); require(ispAddress != address(0), "Not allowed!"); accountsContractAddress.delegatecall(abi.encod...
7,293,075
./full_match/5/0x3C4a3F5Cc6212674AE28264c3DF05aFdf6CE6a23/sources/browser/test.sol
Store value in variable yooolo with num `num` num value to store/
function test3(uint256 num) public { number = num; }
1,866,706
/*** * ░█████╗░░█████╗░███╗░░██╗██████╗░██╗░░░██╗  ░█████╗░██████╗░███████╗░█████╗░████████╗░█████╗░██████╗░ * ██╔══██╗██╔══██╗████╗░██║██╔══██╗╚██╗░██╔╝  ██╔══██╗██╔══██╗██╔════╝██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗ * ██║░░╚═╝███████║██╔██╗██║██║░░██║░╚████╔╝░  ██║░░╚═╝██████╔╝█████╗░░███████║░░░██║░░░██║░░██║...
this will set the fees required to mint using publicMint(), must enter in wei. So 1 ETH = 1018. uint256 _newFee - fee you set, if ETH 1018, if an ERC20 use token's decimals in calculation
function setMintPrice(uint256 _newFee) public onlyOwner { uint256 oldFee = mintPrice; mintPrice = _newFee; emit UpdatedMintPrice(oldFee, mintPrice); }
14,395,478
./full_match/43113/0x597b63C07b62629AF888E7cAc987cCbEF106135b/sources/LendingPool_flat.sol
Claim back your poolToken. Unlocks the amount deposited + gained and burns the eToken. Check to see if user has enough funds, and amount > 0 Updates User balance
function withdraw(uint256 _amount, bool max) external { require(accounts[msg.sender].balance >= _amount && _amount > 0); addDividendsToBalance(msg.sender); if (max) { _amount = accounts[msg.sender].balance; } accounts[msg.sender].balance = accounts[ms...
7,209,460
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; library VanityNameServiceUtils { /** * @dev Returns total fee for `_name` on the basis of `_name` length. */ function _getPrice(uint256 fee, string memory _name) internal pure returns (uint256) { return ...
Returns reservation hash./
function _getReservationHash(string memory _name, address _owner) internal pure returns (bytes32) { return (keccak256(abi.encodePacked(_getNameHash(_name), _owner))); }
967,171
pragma solidity 0.4.19; import './CHXToken.sol'; contract CHXVestingVault { CHXToken private tokenContract; address public beneficiary; uint public vestingTime; // Point in time (as UNIX timestamp) at which tokens are available for withdrawal. function CHXVestingVault(address _tokenContractAddress, a...
Enable recovery of ether sent by mistake to this contract's address.
function drainStrayEther(uint _amount) external onlyBeneficiary returns (bool) { beneficiary.transfer(_amount); return true; }
12,572,383
./full_match/4/0xBf9f8197118293908a295c331e4b23ba14277e37/sources/contracts/Governance.sol
compute state by time compute state by votes vote is accepted but not sent to be executed vote is executed --> can be forced by guardian vote sent to be executed vote can be executed
function state(uint proposalId) public view returns (ProposalState) { require(lastProposalId >= proposalId && proposalId > 0, "invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled || block.timestamp > proposal.createTime + WARM_UP + ACTIVE && propo...
12,271,632
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "./ERC721CreatorCore.sol"; import "./IERC721CreatorCoreEnumerable.sol"; /** * @dev Core ERC721 creator imple...
See {IERC721CreatorCoreEnumerable-totalSupplyBase}./
function totalSupplyBase() public view virtual override returns (uint256) { return _extensionBalances[address(this)]; }
6,344,784
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; import "./AloePredictions.sol"; import "./IncentiveVault.sol";...
The maximum number of proposals that should be aggregated A mapping containing a summary of every epoch A mapping containing every proposal An array containing keys of the highest-stake proposals in the current epoch The unique ID that will be assigned to the next submitted proposal The current epoch. May increase...
function _organizeProposals(uint40 newestProposalKey, uint80 newestProposalStake) internal { uint40 insertionIdx = summaries[epoch].accumulators.proposalCount - 1; if (insertionIdx < NUM_PROPOSALS_TO_AGGREGATE) { highestStakeKeys[insertionIdx] = newestProposalKey; return; ...
1,314,016
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "./openzeppelin-solidity/contracts/SafeMath.sol"; import "./interfaces/IReleaseSchedule.sol"; /** * A release schedule with a "halvening" event occuring every 26 weeks. * Halvening events last indefinitely. */ contract HalveningReleaseSchedule is IRe...
Returns the amount of rewards available, based on the given timestamp. _lastClaimTime The timestamp of last rewards claim; used for calculating elapsed time. return (uint256) number of tokens available./ Check for cross-cycle rewards
function availableRewards(uint256 _lastClaimTime) external view override returns (uint256) { if (_lastClaimTime < distributionStartTime) { return 0; } if (_lastClaimTime < getStartOfCurrentCycle()) { return ((getStartOfCurrentCycle().sub(_lastClaimTime)).mul(getCurre...
5,382,390
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @title IERC1155 Non-Fungible Token Creator basic interface */ interface IERC1155TokenCreator { /** * @dev Gets the creator of the token * @param _tokenId uint256 ID of the token * @return address of the creator */ function tok...
/ tokenCreator/ Gets the creator of the token _tokenId uint256 ID of the token return address of the creator/
function tokenCreator(uint256 _tokenId) external view override returns (address payable) { return iERC1155TokenCreator.tokenCreator(_tokenId); }
13,892,942
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // File: Address.sol /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is un...
NOTE: Vyper produces multiple signatures for a given function with "default" args NOTE: Vyper produces multiple signatures for a given function with "default" args
interface VaultAPI is IERC20 { function name() external view returns (string calldata); function symbol() external view returns (string calldata); function decimals() external view returns (uint256); function apiVersion() external pure returns (string memory); function permit( ...
13,397,553
/** *Submitted for verification at Etherscan.io on 2020-07-28 */ pragma solidity 0.6.0; /** * @title Offering contract * @dev Offering + take order + NEST allocation */ contract Nest_3_OfferMain { using SafeMath for uint256; using address_make_payable for address; using SafeERC20 for ERC20; s...
Modify whether the token allows mining
function changeTokenAllow(address token, bool allow) public onlyOwner { _tokenAllow[token] = allow; }
5,361,505
./partial_match/1/0x2B1c501B3741DaD2680D93DF9a1913Fab6C2d4ac/sources/CaveStaking.sol
Add a new stake token to the pool. Can only be called by the owner. DO NOT add the same stake token more than once. Rewards will be messed up if you do.
function add(uint256 _allocPoint, IERC20 _stakeToken, bool _withUpdate, uint16 _unstakeFeeBP) public onlyOwner { require(_unstakeFeeBP <= 10000, "add: invalid deposit fee basis points"); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardTimestamp = block.timestamp...
4,027,278
./full_match/1/0x6E86583588D1b4c073A8b857D7388f67A3DC5f8F/sources/contracts/CyberAssassins.sol
Set the sale active for white list/
function setWhitelistPause(bool _pause) external onlyOwner { WHITELISTPAUSE = _pause; emit WhitelistPauseEvent(WHITELISTPAUSE); }
9,804,403
// SPDX-License-Identifier: MIT /** * @authors: [@hbarcelos] * @reviewers: [@ferittuncer*, @fnanni-0, @nix1g] * @auditors: [] * @bounties: [] * @deployments: [] */ pragma solidity ^0.7.2; import "./dependencies/IAMB.sol"; import "./dependencies/RealitioInterface.sol"; import "./ArbitrationProxyInterfaces....
Receives a failed attempt to request arbitration. _questionID The ID of the question./
function receiveArbitrationFailure(bytes32 _questionID) external override onlyAmb onlyForeignChain onlyForeignProxy { Request storage request = questionIDToRequest[_questionID]; require(request.status == Status.AwaitingRuling, "Invalid request status"); ...
5,536,964
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Modifiers, ChallengeType} from "../libraries/LibAppStorage.sol"; import {LibERC1155} from "../libraries/LibERC1155.sol"; import {LibChallenges} from "../libraries/LibChallenges.sol"; contract DAOFacet is Modifiers { event DaoTransferred(address index...
Allow the Diamond owner or DAO to remove challenge managers Will throw if one of the addresses in `_challengeManagers` is not an challenge manager _challengeManagers An array containing the addresses that need to be removed from existing challenge managers
function removeChallengeManagers(address[] calldata _challengeManagers) external onlyDaoOrOwner { for (uint256 index = 0; index < _challengeManagers.length; index++) { address challengeManager = _challengeManagers[index]; require(s.challengeManagers[challengeManager] == true, "DAOFac...
1,783,265
/** *Submitted for verification at Etherscan.io on 2022-03-24 */ /* [email protected]@@@@#%*;,..............*@ [email protected]@@@@@@@@#*:[email protected]@ [email protected]@@@@@@@@@@@*,........;@@@ [email protected]@@@@@@@@@@@@%,......:#@@@ [email protected]@@@@@@@@@@@@@?.....,#@@@@ [email protected]@@@@@@@@@@@@@@...
Allows contract owner to update default percentages in case of public mint is organized. percentArtist_ artist percentage percentPlatform_ platform percentage/
function updateDefaultPercentages( uint16 percentArtist_, uint16 percentPlatform_ ) public onlyOwner { unchecked { require( percentArtist_ + percentPlatform_ == 10000, "Invalid percentage" ); } _percentArtist = perc...
10,717,767
./partial_match/1/0x809416858a4d0cAA83a660C54B59c4180C6d1Be3/sources/UController.sol
globalConstraintsCount return the global constraint pre and post count return uint256 globalConstraintsPre count. return uint256 globalConstraintsPost count./
function globalConstraintsCount(address _avatar) external view returns(uint, uint) { return ( organizations[_avatar].globalConstraintsPre.length, organizations[_avatar].globalConstraintsPost.length ); }
16,037,370
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "../periphery/Withdrawa...
SPDX-License-Identifier: MIT MIT License =========== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
interface IPendleRewardManager { event UpdateFrequencySet(address[], uint256[]); event SkippingRewardsSet(bool); event DueRewardsSettled( bytes32 forgeId, address underlyingAsset, uint256 expiry, uint256 amountOut, address user ); function redeemRewards( ...
5,771,451
./full_match/1/0x2dA4e98b98aE7C65217BF4b5a10FE9f78D381F8e/sources/contracts/VSP/VaynerSportsAuction.sol
Computes the total sum of elements of a given array. array An array of values. return The total sum of elements/
function getSumOfElements(uint256[] memory array) internal pure returns (uint256) { uint256 val; for (uint256 i = 0; i < array.length; ) { val += array[i]; unchecked { ++i; } } return val; }
16,588,759
./full_match/44787/0x6a43d9B69591c25D2ab353166D7d6960cC5E196f/sources/contracts/WittyEuro-9.sol
Burn WEUR and withdraw equivalent amount of internal units (wei)./ Burn according number of internal units
function burn(uint64 weurAmount) public payable isBased { uint256 celoAmount = weurAmount * base * 1_000_000_000; _burn(msg.sender, celoAmount); payable(msg.sender).transfer(celoAmount); }
13,250,031
./full_match/43114/0x7cb2151825cd3D3571043e9715E85d6f8Ca91811/sources/WAVAXorgV3Staker.sol
Stakes a deposited token without doing an ownership check
function _stakeToken(IncentiveKey memory key, uint256 tokenId) private { require(block.timestamp >= key.startTime, 'WAVAXorgV3Staker::stakeToken: incentive not started'); require(block.timestamp < key.endTime, 'WAVAXorgV3Staker::stakeToken: incentive ended'); bytes32 incentiveId = Incentive...
4,585,038
./partial_match/42/0x4ffADC639B57e864150ff98a55D249fed53fa63B/sources/ZuniBadge.sol
Schedule (commit) a token to be added; must call applyAddToken after a fixed number of blocks to actually add the token bPool - Core BPool the CRP is wrapping token - the token to be added balance - how much to be added denormalizedWeight - the desired token weight newToken - NewTokenParams struct used to ...
function commitAddToken( IBPool bPool, address token, uint256 balance, uint256 denormalizedWeight, NewTokenParams storage newToken ) external { require(!bPool.isBound(token), "ERR_IS_BOUND"); require( denormalizedWeight <= BalancerConstants.MA...
3,448,963
pragma solidity ^0.4.17; /* * source https://github.com/blockbitsio/ * @name Application Entity Generic Contract * @package BlockBitsIO * @author Micky Socaci <micky@nowlive.ro> Used for the ABI interface when assets need to call Application Entity. This is required, o...
after cash back time
function afterVoteNoCashBackTime() public view returns ( bool ) { uint256 time = MilestoneCashBackTime + getBylawsCashBackVoteRejectedDuration(); if(getTimestamp() > time) { return true; } return false; }
941,734
pragma solidity 0.5.15; library Addresses { function isContract(address account) internal view returns (bool) { uint256 size; // solium-disable-next-line security/no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } f...
solium-disable-next-line security/no-inline-assembly
function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; }
7,332,854
./full_match/43114/0x9E4E36a00F7043ec6aC08f81c40438052CCFfD02/sources/MasterChef.sol
View function to see pending Vasts on frontend.
function pendingVast(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accVastPerShare = pool.accVastPerShare; if (block.timestamp > pool.lastRewardSecond && pool.lpSupply != 0...
4,533,084
./partial_match/1/0x5f13816E16021fe309cC75455b1c0455963a953A/sources/src/HelloBridge.sol
-------------------------------------------------------------------------- / internal / -------------------------------------------------------------------------- /
function _setSupportedChain(uint256 chainId, bool isSupported) internal { supportedChains[chainId] = isSupported; }
3,975,619
pragma solidity 0.5.12; contract HelloWorld{ struct Person { uint id; string name; uint age; uint height; address walletAddress; } Person[] public people; function createPerson(string memory name, uint age, uint height) public { //This creates a person P...
This creates a person
function createPerson(string memory name, uint age, uint height) public { Person memory newPerson; newPerson.name = name; newPerson.age = age; newPerson.height = height; people.push(newPerson); }
14,022,110
./partial_match/1/0xc7FAAbD290FFFff45a2F6FC4973276b15e1D617B/sources/Flags.sol
enable the warning flag for an address. Access is controlled by raisingAccessController, except for owner who always has access. subject The contract address whose flag is being raised/
function raiseFlag(address subject) external override { require(allowedToRaiseFlags(), "Not allowed to raise flags"); tryToRaiseFlag(subject); }
9,256,704
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view ret...
sum votes, multiply by precision, divide by square rooted total supply
function getQuorum(uint256 id) public view returns (uint256){ require(proposals[id].proposer != address(0), "non-existent proposal"); uint256 _totalSupply; if (proposals[id].totalSupply == 0) { _totalSupply = AdditionalMath.sqrt(totalSupply()); ...
16,911
./partial_match/56/0xa9eB28df890A88077487eBEF47974527656433E6/sources/MasterPepe.sol
Update the given pool's SPB allocation point. Can only be called by the owner.
function set( uint256 _pid, uint256 _allocPoint, uint32 _depositFeeBP, bool _withUpdate, bool _isOurToken ) public onlyOwner { if (!_isOurToken) { require( _depositFeeBP < depositFeeBase, "add: invalid deposit fee basis ...
11,088,657
./full_match/97/0xadCD1099e240F6F52BC4D4fC0C92b181Ad69cbeF/sources/project_/contracts/ERC20FarmFixEnd.sol
Deposit staked tokens on behalf of msg.sender and collect reward tokens (if any) amount: amount to deposit (in stakedToken)/
function deposit(uint256 amount) external { _deposit(amount, address(msg.sender)); }
5,019,075
pragma solidity ^0.5.0; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/utils/Address.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contr...
tokenValue returns the value of the given amount of the token specified. do not calculate anything on zero amount do the dust adjustment to the value calculation?
function tokenValue(address _token, uint256 _amount) public view returns (uint256 value) { if (_amount == 0) { return 0; } uint256 priceDigitsCorrection = 10 ** uint256(addressProvider.getTokenRegistry().priceDecimals(_token)); if (valueDustAdjustment) { va...
12,676,110
./partial_match/1/0xB6f0cc275f0F6A2d70cb8011021fcDB54132209f/sources/ClearPoolStrategy.sol
Deposits funds into the pool. depositAmount The deposit amount./ Spender approval, if needed
function depositInPool (uint256 depositAmount) external onlyOwnerOrOperator ifInitialized nonReentrant { require(depositAmount > 0, "Deposit amount required"); require(IERC20(currencyTokenAddress).balanceOf(address(this)) >= depositAmount, "Insufficient balance"); if (depositAmount > IERC20...
9,136,006
./partial_match/3/0x25BfA7A89EEc683D2d1dF562f9c818019BBC84e9/sources/TokenController.sol
Update this contract's token pointer to newContract (e.g. if the contract is upgraded)/
function setToken(TrueCurrency _newContract) external onlyOwner { token = _newContract; emit SetToken(_newContract); }
5,198,325
./full_match/1/0x06ac03D295F04F21Ab862bb40672f79f6e4e802D/sources/browser/Untitled.sol
Initializing local variables Access the local variable
function transmission() public view returns(uint){ uint convention = 1; uint conventionconvention = 2; uint bite = convention + conventionconvention; return bite; }
2,949,144
./full_match/1/0xe7d20aEd148751365729c35019eF8813Caa7dAf5/sources/contracts/libraries/Ownable.sol
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "new owner is the zero address" ); _transferOwnership(newOwner); }
9,709,288
./partial_match/3/0xFaA5Cfab34706C7328c0800ce232a8a61563740B/sources/old_UniswapLocked.sol
Add Liquidity to Uniswap at defined price, if no pool exists it will create one. Approve token for router, require contract to have the necessary tokens/
function addLiquidity() public { require(address(_token) != address(0), "UniswapLocked: Token can not be zero"); uint256 etherBalance = address(this).balance; uint256 tokensAmount = _priceInv.div(BASE_PRICE).mul(etherBalance); uint256 tokensAmountMin = tokensAmount.sub(_priceInv.div(...
5,192,972
pragma solidity 0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title Blocklist * @dev This contract manages a list of addresses and has a simple CRUD */ contract Blocklist is Ownable { /** * @dev The index of each user in the list */ mapping(address => uint256) private _userIndex; ...
Adds many addresses to the blocklist at once accounts[] The list of addresses to add Fails if at least one of the addresses was already blocklisted/
function batchAddToBlocklist(address[] calldata accounts) external onlyOwner { uint256 accountLength = accounts.length; for (uint256 i; i < accountLength;) { require(_addToBlocklist(accounts[i])); } }
12,205,973
./full_match/83/0xf063E7c32CBeE0890524AB919758ef72De48e18d/sources/contracts/BaseV1-core.sol
as per `current`, however allows user configured granularity, up to the full window size
function quote( address tokenIn, uint256 amountIn, uint256 granularity ) external view returns (uint256 amountOut) { uint256[] memory _prices = sample(tokenIn, amountIn, granularity, 1); uint256 priceAverageCumulative; for (uint256 i = 0; i < _prices.length; i++) ...
9,564,264
./full_match/97/0x20610C85207106d89e43335Cf8DDd7C58D6a3b4c/sources/contracts/StrategyRouter.sol
Withdraw tokens from batch. Receipts are burned and user receives amount of tokens that was noted. Cycle noted in receipts should be current cycle. _receiptIds Receipt NFTs ids.
function withdrawFromBatch(uint256[] calldata _receiptIds) public { (uint256[] memory receiptIds, address[] memory tokens, uint256[] memory withdrawnTokenAmounts) = batch.withdraw(msg.sender, _receiptIds, currentCycleId); currentCycleDepositsCount -= receiptIds.length; if (curre...
3,273,888
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; // This is only kept for backward compatability / upgrading import {OwnableUpgradeable} from "../oz/access/OwnableUpgradeable.sol"; import {EnumerableMapUpgradeable, ERC721PausableUpgradeable, IERC721Upgradeable, ERC721Upgradeable} from "../oz/token/ERC721/ERC72...
Returns to normal state. Requirements: - The contract must be paused./
function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } uint256[49] private __gap;
143,858
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // Sources flattened with hardhat v2.9.1 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/[email protected] // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8...
Withdraw funds to Gnosis Safe multi-sig wallet
function withdraw() external { require (_success, "Could not withdraw"); }
7,849,542
./full_match/80001/0x014F02C43E46677dedF9c20Bf55Dca357C139222/sources/contracts/SignatureDropRandom.sol
Returns the metadata ID for a given tokenId.
function _getMetadataId( uint256 _tokenId, uint256 _batchId, uint256 _indexOfBatchId ) private view returns (uint256 metadataId) { uint256 randomness = uint256(tokenIdOffset[_batchId]); uint256 prevBatchId; if (_indexOfBatchId > 0) { prevBatchId = get...
9,459,904
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../interface/IJswapFactory.sol"; import "../interface/IJswap...
withdraw JF/ delete userPending[msg.sender];
function withdraw() public { UserInfo storage user = userInfo[msg.sender]; require(user.pending > 0, "No goods"); uint256 pending = user.pending; user.pending = 0; uint256 length = pools.length; for (uint256 pid = 0; pid < length; pid++) { if(userPending[ms...
12,938,599
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; library ECTools { // @dev Recovers the address which has signed a message // @thanks https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d function recoverSigner(bytes32 _hashedMsg, string _sig) public pure returns (address) { req...
after timer expires - anyone can call; even before timer expires, non-exit-initiating party can call deduct hub/user wei/tokens from total channel balances transfer hub wei balance from channel to reserves transfer user wei balance to user transfer hub token balance from channel to reserves transfer user token balance ...
function emptyChannel( address user ) public noReentrancy { require(user != hub, "user can not be hub"); require(user != address(this), "user can not be channel manager"); Channel storage channel = channels[user]; require(channel.status == ChannelStatus.ChannelDispute, "...
2,512,671
./full_match/1/0x0C0014d268d3A31726Eb8bcF4e77061D0E8081e4/sources/contracts/GatekeepBrink.sol
Set wallet address to be actively monitored.
function setUserAddress(address userAddress_ ) external onlyOwner { require(userAddress_ != address(0), "Invalid address"); userAddress = userAddress_; }
3,214,019
./partial_match/1/0x5c5B1da92Bf8E70fe105c95386C043e60B9954aE/sources/NftStaking.sol
Update Account and Auto-claim
function updateAccount(uint256[] calldata tokenIds) private { uint256 reward; uint256 blockCur = Math.min(block.number, expiration); for (uint256 i; i < tokenIds.length; i++) { reward += calculateReward(msg.sender, tokenIds[i]); _depositBlocks[msg.sender][tokenIds[i]] = blockCur;...
9,201,899
./full_match/1/0xBEbB92Ed09688e64DC38c240B600D0B1d504EE56/sources/lib/aera-contracts/contracts/v1/AeraVaultV1.sol
Update weights of tokens in the pool. Will only be called by deposit(), withdraw() and cancelWeightUpdates().
function updateWeights(uint256[] memory weights, uint256 weightSum) internal { uint256 numWeights = weights.length; uint256[] memory newWeights = new uint256[](numWeights); uint256 adjustedSum; for (uint256 i = 0; i < numWeights; i++) { newWeights[i] = (weigh...
3,080,276
./partial_match/1/0x2d1E0ba4D0A068dAd784976d360F7C810909017D/sources/Ryuzaki.sol
Disables the reward feature. Emits a {DisabledReward} event. Requirements: - reward feature mush be enabled./
function disableReward() public onlyOwner { require(_rewardEnabled, "Reward feature is already disabled."); setTaxReward(new uint32[](3), 0); _rewardEnabled = false; emit DisabledReward(); }
9,178,583
./full_match/421613/0xcfA132E353cB4E398080B9700609bb008eceB125/sources/project:/contracts/interfaces/superfluid/ISuperTokenFactory.sol
Super token factory interface Superfluid/
interface ISuperTokenFactory { function getHost() external view returns(address host); function initialize() external; function getSuperTokenLogic() external view returns (ISuperToken superToken); import { SuperfluidErrors } from "./Definitions.sol"; enum Upgradability { NON_UPGRADABLE, ...
11,585,407
./partial_match/42/0xFD2908636dD8bd0008A06a12ae040115bc1D2219/sources/ExchangeReader.sol
set new price adjust ratio only owner can call _priceAdjustRatio new price adjust spread in 18 digits/
function setPriceAdjustRatio(Decimal.decimal memory _priceAdjustRatio) public onlyOwner { priceAdjustRatio = _priceAdjustRatio; }
8,887,702
./full_match/42/0xED116cfd83Ef9e06D7f48FE476AE60BDbB3387A8/sources/UnitTest/PreachersCompFiLqdt.sol
Decode the parameters in "calldata" as passed by doCompFiLiquidate. ERC20 cFlashToken = ERC20(flashToken); Swap flash loan for targetToken Approve tokens to be used to pay the lqdtTokenAmount
function cashOnHand( bytes memory data ) internal returns ( bool ){ (address flashToken, uint256 flashAmount, address lqdtAccount, address lqdtToken, uint256 lqdtTokenAmount, address collateralToken) = abi.decode(data, (address, uint256, address, address,...
9,566,606
pragma solidity ^0.5.0; import "./CollectionBasic.sol"; import "../KarmaCoin.sol"; import "../GyanCoin.sol"; import "../ScholarshipContract.sol"; import "../ownership/rbac/RBAC.sol"; /** * @title BaseCollection * @author Aakash Bansal @ one0x Inc. * @dev Basic version of collection contract * @dev Handled collect...
TODO : put logic here to dynamically calculate Karma value based on gyan
function getKarmaToBurn(uint256 _gyan) public view returns (uint256) { uint256 dailyKarmaMint = (karmaCoin.totalSupply().mul(5).div(100)).div(365); uint256 dailyGyanEarn = gyanCoin.yesterdayMint(); return _gyan.mul(dailyKarmaMint.div(dailyGyanEarn)); }
1,017,765
./full_match/5/0xf2b3aEc131b7df040B1190CceA1754872A7e3ee5/sources/NftStaking.sol
the first code calculates the rwards on an O staker before adding new tokenso if the staker was earning 50 tokens...he will be getting extra 50 token for staking a new token
function stakeToken(uint256 _tokenId) external nonReentrant { if(stakers[msg.sender].stakedAmount > 0){ uint rewards = calculateRewards(msg.sender); stakers[msg.sender].unclaimedTokens += rewards; } }
1,861,799