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: GPL-3.0 pragma solidity ^0.6.12; import "./IUserRegistry.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract BrightIdUserRegistry is Ownable, IUserRegistry { string private constant ERROR_NEWER_VERIFICATION = "NEWER VERIFICATION REGISTERED BEFORE"; string p...
Sponsor a BrightID user by context id addr BrightID context id/
function sponsor(address addr) public { emit Sponsor(addr); }
6,046,315
./partial_match/5/0x6D1Ba393ED7e26F4934746B3e82202F0eDf9563D/sources/contracts/mixins/0xcert/nf-token.sol
Checks if `_operator` is an approved operator for `_owner`. owner The address that owns the NFTs. operator The address that acts on behalf of the owner. return True if approved for all, false otherwise./
function isApprovedForAll(address owner, address operator) external view override returns (bool) { return ownerToOperators[owner][operator]; }
16,848,422
./full_match/5/0xA62Ae554FC438B58eaFE1c9A41e369Ca6bBB6F21/sources/project:/contracts/DCBVault.sol
Calculates the total pending rewards that can be restaked return Returns total pending dcb rewards/
function calculateTotalPendingRewards(uint256 _pid) external view returns (uint256) { uint256 amount = masterchef.payout(_pid, address(this)); amount = amount.add(pools[_pid].pendingClaim); return amount; }
1,920,779
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { ERC721 } from "./ERC721/ERC721.sol"; import { ERC721M } from "./ERC721/ERC721M.sol"; import { ERC721Tradable } from "./ERC721/extensions/ERC721Tradable.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; contract Mingoes is ERC...
A generic interface for a contract which properly accepts ERC721 tokens. Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol)
interface ERC721TokenReceiver { function onERC721Received( address operator, address from, uint256 id, bytes calldata data ) external returns (bytes4); }
10,176,578
./full_match/11155111/0xB925899Df589e10c71F540eA92F5fC7b98552AAb/sources/_openzeppelin/contracts-upgradeable/token/ERC777/ERC777Upgradeable.sol
See {ERC20-_approve}. Note that accounts cannot have allowance issued by their operators./
function _approve(address holder, address spender, uint256 value) internal virtual { require(holder != address(0), "ERC777: approve from the zero address"); require(spender != address(0), "ERC777: approve to the zero address"); _allowances[holder][spender] = value; emit Approval(hol...
3,820,647
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.5; pragma abicoder v2; import './TimelockExecutorBase.sol'; contract ArcTimelock is TimelockExecutorBase { address private _ethereumGovernanceExecutor; event EthereumGovernanceExecutorUpdate( address previousEthereumGovernanceExecutor, address newE...
@inheritdoc ITimelockExecutor
function execute(uint256 actionsSetId) external payable override { require(getCurrentState(actionsSetId) == ActionsSetState.Queued, 'ONLY_QUEUED_ACTIONS'); ActionsSet storage actionsSet = _actionsSets[actionsSetId]; require(block.timestamp >= actionsSet.executionTime, 'TIMELOCK_NOT_FINISHED'); actio...
148,720
./full_match/80001/0x326BfE5CAC27e68631E64f58FD43cB5Bef9c7a2b/sources/@thirdweb-dev/contracts/extension/Staking721.sol
Staking logic. Override to add custom logic.
function _stake(uint256[] calldata _tokenIds) internal virtual { uint64 len = uint64(_tokenIds.length); require(len != 0, "Staking 0 tokens"); address _stakingToken = stakingToken; if (stakers[_stakeMsgSender()].amountStaked > 0) { _updateUnclaimedRewardsForStaker(_stak...
5,565,022
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS ...
Approve `to` to operate on `tokenId` Emits a {Approval} event./
function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); }
10,913,343
pragma solidity ^0.5.16; /** * @dev Allow tokens to be transferred to contracts and have the contract trigger logic for how to respond to receiving the tokens within a single transaction. * https://github.com/ethereum/EIPs/issues/677 */ interface Callable { function tokenCallback(address _from, uint256 _tokens, b...
change BONK fee _bonkFee new fee in BONK (with decimals)/
function setBonkFee(uint _bonkFee) external onlyOwner { bonkFee = _bonkFee; emit BonkFeeUpdated(_bonkFee, now); }
14,330,594
pragma solidity ^0.4.24; import "./SimpleToken.sol"; /** * @title Buck Token */ contract Buck is SimpleToken{ // Balances mapping (address => uint256) _balances; // Total supply uint256 _totalSpent; /** * @param assignee Address of the entity token depends on * @param name Token name * @param...
Consume token for a specified address/
function consume(address account, uint256 value) public onlyMinter returns (bool) { _burn(account, value); return true; }
13,122,199
./partial_match/1/0x8b31aB64e370B99D56f9A13dBc1e17769EFA30Ba/sources/contracts/CollectionRoyalty.sol
PRIVILEGED FUNCTIONS
function setDefaultRoyalty(address _receiver, uint96 _feeNumerator) external onlyOwner { _setDefaultRoyalty(_receiver, _feeNumerator); }
3,634,375
// File: contracts/Ownable.sol pragma solidity >0.4.0 <0.6.0; contract Ownable { address payable public owner; constructor () public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address payable newOwner) external onlyOwne...
- to withdraw any ETH balance sitting in the contract
function withdraw() onlyOwner public{ owner.transfer(address(this).balance); }
2,480,566
./full_match/1/0x1451202c856496a4Eed5326B3Ee30290fBD6E73A/sources/@beskay/erc721b/contracts/ERC721B.sol
See {IERC721-ownerOf}. Gas spent here starts off proportional to the maximum mint batch size. It gradually moves to O(1) as tokens get transferred around in the collection over time./ Cannot realistically overflow, since we are using uint256
function ownerOf(uint256 tokenId) public view virtual returns (address) { if (!_exists(tokenId)) revert OwnerQueryForNonexistentToken(); unchecked { for (uint256 i = tokenId; ; i++) { if (_owners[i] != address(0)) { return _owners[i]; ...
17,008,822
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "LinkTokenInterface.sol"; import "VRFCoordinatorV2Interface.sol"; import "VRFConsumerBaseV2.sol"; import "Ownable.sol"; import "EthUsPriceConversion.sol"; contract MyFundStorage is VRFConsumerBaseV2, Ownable { address payable[] internal payers; ...
Update the gas limit for callback function/
function updateCallbackGasLimit(uint32 gasLimit) external onlyOwner { callbackGasLimit = gasLimit; }
5,759,989
pragma solidity ^0.4.24; import "./IPermissionManager.sol"; ///////////////////// // Module permissions ///////////////////// // Owner CHANGE_PERMISSION // addPermission X X // changePermission X X // /** * @title Permission Manager m...
Use to provide/change the permission to the delegate corresponds to the module contract _delegate Ethereum address of the delegate _module Ethereum contract address of the module _perm Permission flag _valid Bool flag use to switch on/off the permission return bool/
function changePermission( address _delegate, address _module, bytes32 _perm, bool _valid ) public withPerm(CHANGE_PERMISSION) returns(bool) { require(delegateDetails[_delegate] != bytes32(0), "Delegate details not set"); perms[_module][_delegate][...
5,497,474
/** *Submitted for verification at Etherscan.io on 2020-07-23 */ pragma solidity ^0.5.0; // openzeppelin-solidity@2.3.0 from NPM /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, beca...
\frac{threshold_num}{threshold_denom} signatures are required for validator approval to be granted The list of currently elected validators The powers of the currently elected validators The current sum of powers of currently elected validators Nonce tracking per to prevent replay attacks on signature submission during...
function getPowers() public view returns(uint64[] memory) { return powers; }
12,831,068
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //labels contract owner only methods import "@openzeppelin/contracts/access/Ownable.sol"; //for verifying messages in lazyMint import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; //provably fair library for `mintPack()` import "../generators/ProvablyF...
Allows for consumers to buy and mint tokens themselves/ manual ReentrancyGuardmint first and wait for errorsthen classify itthen increment supplyadd to supplypayout the feesget the creatorsend the remainder to the token owner
function payAndMint( uint256 classId, uint256 tokenId, address recipient ) external virtual payable offerValid(classId) { require(!_minting, "reentrant call"); _minting = true; uint256 offer = offerOf(classId); require(msg.value == offer, "Incorrect payment"); _safeMint(recipient,...
5,461,954
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; // import aggregator contract from chainlink // chainlink is a decentralised oracle network import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol"; // import safemath contract from chainlink import "@chainlink/contracts/src/v0.6/vendor/Safe...
function returns the price of one eth in usd (in wei)
function price() public view returns (uint256) { (, int256 answer, , , ) = feed.latestRoundData(); return uint256(answer * 10000000000); }
7,272,264
pragma solidity <0.6.0; contract TestContractInterface { address public owner; constructor() internal { owner = msg.sender; } modifier Owner (address _owner) { require(msg.sender == _owner); _; } function testOpcodes() public; //can await any of these in the main js file to see if anyt...
can await any of these in the main js file to see if anything fails
function test_revert() public { assembly{ revert(0, 0) } }
1,004,357
pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title InvertedInuCoterie contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract Inve...
Internal function calculate proportion of a fee for a given amount. _amount fee / 100 _amount uint256 value to be split./
function _calcProportion(uint256 fee, uint256 _amount) internal pure returns (uint256) { return _amount.mul(fee).div(100); }
11,862,721
./partial_match/83/0x7473a3E6f3d7A4F33F59345E971D2d04d1fe299F/sources/Bridge.sol
Encode string. s String return Marshaled bytes
function encode_string(string memory s) internal pure returns (bytes memory) { return encode_length_delimited(bytes(s)); }
8,828,746
./full_match/80001/0xe095c1dF9Ac9C5531A9be4824B88A0327191e42F/sources/src/YAGMIController.sol
Only sponsor of the tokenId can pay back Only after burn is open can the deposit be claimed Only claim deposit once transfer erc20
function claimDeposit(uint256 tokenId) public onlyRole(SPONSOR) { YAGMIProps memory nftProps = tokens[tokenId]; require( nftProps.sponsor == msg.sender, "Not the sponsor of the tokenId" ); require( nftProps.status == YAGMIStatus.BURN_OPEN || ...
5,706,510
/** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt */ /** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more inform...
This function can set the server side address _signerAddress The address derived from server's private key
function setSignerAddress(address _signerAddress) onlyOwner { signerAddress = _signerAddress; SignerChanged(signerAddress); }
477,875
//Address: 0xC27B9094e8FA5b313B934f6be5969B5d6c8EB9bA //Contract name: Certifier //Balance: 0 Ether //Verification Date: 2/13/2018 //Transacion Count: 16 // CODE STARTS HERE pragma solidity ^0.4.18; // File: contracts/Certification.sol contract Certification { /** * Address of certifier contract this certi...
Change the address of the global administrator. This can be done by the global administrator only. _GlobalAdmin Address of new global administrator to be set./
function changeGlobalAdmin(address _GlobalAdmin) public onlyGlobalAdmin { GlobalAdmin=_GlobalAdmin; GlobalAdminChanged(_GlobalAdmin); }
12,750,763
/** * SPDX-License-Identifier: UNLICENSED */ pragma solidity 0.6.10; pragma experimental ABIEncoderV2; import {SafeMath} from "./packages/oz/SafeMath.sol"; import {OtokenInterface} from "./interfaces/OtokenInterface.sol"; import {OracleInterface} from "./interfaces/OracleInterface.sol"; import {ERC20Interface} from ...
if there is short option and collateral asset in the vault, ensure that the collateral asset is valid for the short option _vault the vault to check./
function _isMarginableCollateral(MarginVault.Vault memory _vault) internal view returns (bool) { bool isMarginable = true; bool hasCollateral = _isNotEmpty(_vault.collateralAssets); if (!hasCollateral) return isMarginable; bool hasShort = _isNotEmpty(_vault.shortOtokens); b...
15,792,991
/** *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 set base URI for specific collection. collectionId_ collection ID baseUri_ base URI/
function setCollectionBaseUri(uint256 collectionId_, string memory baseUri_) public onlyOwner { require( _collections[collectionId_].baseUriLocked == 0, "baseURI locked" ); _collections[collectionId_].baseUri = baseUri_; }
10,717,782
/** *Submitted for verification at Etherscan.io on 2022-03-02 */ // 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, t...
Claim a set of winning tickets for a lottery _lotteryId: lottery id _ticketIds: array of ticket ids _brackets: array of brackets for the ticket ids Callable by users only, not contract!/ Initializes the rewardInArchienekoToTransfer Update the lottery ticket owner to 0x address Check user is claiming the correct bra...
function claimTickets( uint256 _lotteryId, uint256[] calldata _ticketIds, uint32[] calldata _brackets ) external override notContract nonReentrant { require(_ticketIds.length == _brackets.length, "Not same length"); require(_ticketIds.length != 0, "Length must be >0"); ...
133,109
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Strings.sol"; import './Blimpie/Delegated.sol'; import './Blimpie/ERC721Batch.sol'; import './Blimpie/Signed.sol'; import './Blimpie/PaymentSplitterMod.sol'; contract ElonEffect is Delegated, ERC721Batch, PaymentSplitterMod...
Clear approvals from the previous owner
function _transfer(address from, address to, uint tokenId) internal { require(ownerOf(tokenId) == from, "ERC721B: transfer of token that is not own"); _beforeTokenTransfer(from, to); _approve(address(0), tokenId); tokens[tokenId].owner = to; emit Transfer(from, to, tokenId); }
6,243,939
pragma solidity ^0.4.23; import "../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "../node_modules/openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "../node_modules/openzeppelin-solidity/contracts/lifecycle/Destructible.sol"; import "../node_modules/openzeppelin-solidity/co...
We compare with block time, not really precise but it's ok for now
function isExpired(uint gameId) internal view returns(bool res){ return now >= games[gameId].deadline; }
6,351,130
pragma solidity ^0.4.18; contract DragonCrowdsaleCore { function crowdsale( address _address )payable; function precrowdsale( address _address )payable; } contract Dragon { function transfer(address receiver, uint amount)returns(bool ok); function balanceOf( address _address )return...
emergency withdrawal of Dragons incase sent to this address
function withdrawCrowdsaleDragons() onlyOwner{ uint256 balance = tokenReward.balanceOf( address( this ) ); tokenReward.transfer( msg.sender , balance ); }
6,472,521
./partial_match/1/0x58fc75696aA121e53422470EC2efA7383c1Ec121/sources/XANALand.sol
require(whitelistRoot[whitelistType].supply >= whitelistRoot[whitelistType].sold + _mintAmount, "Xanaland: whitelist sold out");
function checkWhiteList( uint256 _mintAmount, bytes32[] calldata proof, uint256 whitelistType, bool isLimit) nonReentrant internal returns (bool){ require(whitelistRoot[whitelistType].startTime <= block.timestamp, "Xanaland: not open"); require(whitelistRoot[whitelistType].endTime >= block.timestamp...
3,623,201
pragma solidity 0.6.2; pragma experimental ABIEncoderV2; import 'RLP.sol'; import 'StorageStructure.sol'; /// @title CertiÐApp Smart Contract /// @author Soham Zemse from The EraSwap Team /// @notice This contract accepts certificates signed by multiple authorised signers contract CertiDApp is StorageStructure { us...
enforces 32 byte length one byte prefix
function toUintStrict(RLPItem memory item) internal pure returns (uint) { require(item.len == 33); uint result; uint memPtr = item.memPtr + 1; assembly { result := mload(memPtr) } return result; }
6,458,745
pragma solidity =0.6.6; import '@sphynxswap/swap-core/contracts/interfaces/ISphynxFactory.sol'; import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; import './interfaces/ISphynxRouter.sol'; import './libraries/SphynxLibrary.sol'; import './libraries/SafeMath.sol'; import './interfaces/IERC20.sol'; import './...
TransferHelper.safeTransferETH(ISphynxFactory(factory).feeTo(), amounts[0] swapFee / 1000); 0.1% swap fee(withdraw at once) refund dust eth, if any
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external virtual override payable ensure(deadline) returns (uint[] memory amounts) { require(path[0] == WETH, 'SphynxRouter: INVALID_PATH'); amounts ...
11,688,262
./partial_match/1/0x0F345425A512D3dabee4c0fA137A7Dc8E58AA82d/sources/Linq2.sol
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; requ...
16,103,844
pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; ...
Calculate and assign the proceeds from the buyout. currentOwner The current owner of the tile that is being bought out. price The price of the tile that is being bought out. claimedSurroundingTiles The surrounding tiles that have been claimed. Calculate the variable dividends based on the buyout price (only to be pa...
function _calculateAndAssignBuyoutProceeds(address currentOwner, uint256 price, uint256[] memory claimedSurroundingTiles) internal { uint256 variableDividends = price.mul(gameSettings.buyoutDividendPercentage).div(100000); uint256 fee = price.mul(gameSettings.buyoutFe...
1,781,667
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract DCanvas is ERC721 { using Strings for uint256; // Base URI for metadata to be accessed at. string private BASE_URI = "https://dcanvas-metadata.s3-us-west-2.amazonaw...
Sets another address that can set colors on behalf of the token owner. _artistProxy the proxy address to set./
function _setArtistProxy(address _artistProxy) private { proxies[msg.sender] = _artistProxy; emit ProxySet(msg.sender, _artistProxy); }
1,323,234
pragma solidity ^0.4.17; /** * V 1.0. * (C) profit-chain.net Licensed under MIT terms * * ProfitChain is a game allowing participants to win some Ether. Based on Ethereum intrinsic randomness and difficulty, you must be either lucky or one * hell of a hacker to win... Read the code, and if you find a prob...
Does group name exist?/
function groupNameExists(string _groupName) internal constant returns (bool exists) { return groupNames[_groupName]; }
6,450,636
pragma solidity ^0.4.11; /** * @author Jefferson Davis * StakePool_ICO.sol creates the client&#39;s token for crowdsale and allows for subsequent token sales and minting of tokens * In addition, there is a quarterly dividend payout triggered by the owner, plus creates a transaction record prior to payout * Crowdsa...
Allows contract owner to mint new tokens, prevents numerical overflow
function mintToken(address target, uint256 mintedAmount) onlyOwner returns (bool success) { uint256 addTokens = mintedAmount.mul(multiplier); if ((totalSupply + addTokens) < totalSupply) { revert(); balance[target] += addTokens; totalSupply += addTokens; Transfer(0, target, addTokens); retur...
1,969,934
./full_match/4/0x3589f8B0586E28E5006205f2B68b54a7A299BA27/sources/browser/Auction.sol
Start code here. 2 lines approximately. / End code here. Start code here. 1 line approximately. End code here.
function bid(uint _itemId, uint _count) public payable { Bids tokens to a particular item. Arguments: _itemId -- uint, id of the item _count -- uint, count of tokens to bid for the item Part 1 Task 4. Implement the three conditions below. ...
13,331,026
./full_match/1/0x33a0d1F7498b5DAB6ef42f332D0fCd1b0a3ad2A9/sources/contracts/joint.sol
WARNING: This call is sandwichable, care should be taken to always execute with a private relay
function createLP() internal returns ( uint256, uint256, uint256 ) { return IUniswapV2Router02(router).addLiquidity( tokenA, tokenB, balanceOfA() .mul(RATIO_PRECISI...
3,009,045
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; /// SPDX-License-Identifier: GPL-3.0-or-later library SafeMath { // arithmetic wrapper for unit under/overflow check function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; ...
----- Controller Management
function updateConsensus(uint8 _consensusCount) external onlyControllers { confirmationCounts[0] = _consensusCount; }
13,096,809
pragma solidity ^0.5.10; /** @title ViewSPV */ /** @author Summa (https://summa.one) */ import {TypedMemView} from "./TypedMemView.sol"; import {ViewBTC} from "./ViewBTC.sol"; import {SafeMath} from "./SafeMath.sol"; library ViewSPV { using TypedMemView for bytes; using TypedMemView for bytes29; using Vi...
Hashes transaction to get txid Supports Legacy and Witness _version 4-bytes version _vin Raw bytes length-prefixed input vector _vout Raw bytes length-prefixed output vector _locktime 4-byte tx locktime return 32-byte transaction id, little endian TODO: write in ass...
function calculateTxId( bytes4 _version, bytes29 _vin, bytes29 _vout, bytes4 _locktime ) internal view typeAssert(_vin, ViewBTC.BTCTypes.Vin) typeAssert(_vout, ViewBTC.BTCTypes.Vout) returns (bytes32) { return abi ...
13,068,049
// SPDX-License-Identifier: MIT import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; pragma solidity ^0.8.7; // /$$ ...
Helper function for arrays/
function _moveTokenInTheList(uint256[] memory list, uint256 tokenId) internal pure returns (uint256[] memory) { uint256 tokenIndex = 0; uint256 lastTokenIndex = list.length - 1; uint256 length = list.length; for(uint256 i = 0; i < length; i++) { if (list[i] == tokenId) { t...
13,141,633
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /* Contract Imports */ import { L2ToL1MessagePasser } from "./precompiles/L2ToL1MessagePasser.sol"; import { L1MessageSender } from "./precompiles/L1MessageSender.sol"; import { StateManager } from "./StateManager.sol"; import { SafetyChecker } from "./SafetyCh...
Restore the contract context to some old values. _msgSender The msgSender to be restored. _activeContract The activeContract to be restored./ Revert back to the old context
function restoreContractContext( address _msgSender, address _activeContract ) internal { executionContext.ovmActiveContract = _activeContract; executionContext.ovmMsgSender = _msgSender; }
7,281,790
./partial_match/42/0x631FFD1AA2A854736727b02379a147cBE0E98F9f/sources/UBXGStaking.sol
return Return total earned UBXG token for staked time period _poolId pid of pool _user User address/
function pendingReward(uint256 _poolId, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_poolId]; UserInfo storage user = userInfo[_poolId][_user]; uint256 accRewardPerShare = pool.accRewardPerShare; uint256 supply; if (_poolId == 1) ...
3,328,103
./partial_match/42/0x0026750c741F2Cde78302E97EcCAAb127235051f/sources/GEtherBridge.sol
Retrieves the maximum market liquidity for a given reserve on both Aave and Dydx. _token The reserve token to flash borrow from. return _liquidityAmount The reserve token available market liquidity./
function _getFlashLoanLiquidity(address _token) internal view returns (uint256 _liquidityAmount) { uint256 _liquidityAmountDydx = 0; if ($.NETWORK == $.Network.Mainnet || $.NETWORK == $.Network.Kovan) { _liquidityAmountDydx = DydxFlashLoanAbstraction._getFlashLoanLiquidity(_token); } uint256 _liquidityAmou...
3,391,124
// Verified using https://dapp.tools // hevm: flattened sources of ./contracts/2021/Proposal20.sol pragma solidity =0.5.15 >=0.5.15 <0.6.0; pragma experimental ABIEncoderV2; ////// lib/yamV3/contracts/lib/IERC20.sol /* pragma solidity ^0.5.15; */ /** * @dev Interface of the ERC20 standard as defined in the EIP. ...
Decrease the amount of tokens that an owner has allowed to a spender. spender The address which will spend the funds. subtractedValue The amount of tokens to decrease the allowance by./
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { uint256 oldValue = _allowedFragments[msg.sender][spender]; if (subtractedValue >= oldValue) { _allowedFragments[msg.sender][spender] = 0; _allowedFragments[msg.s...
129,245
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; // interfaces import "@openzeppelin/contracts/interfaces/IERC1271.sol"; import "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol"; import "../LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol"; // modules import "@erc725/smart-contracts/contrac...
Triggers the UniversalReceiver event when this function gets executed successfully. Forwards the call to the UniversalReceiverDelegate if set. _typeId The type of call received. _data The data received./
function universalReceiver(bytes32 _typeId, bytes calldata _data) external virtual override returns (bytes memory returnValue) { bytes memory data = _getData(_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY); if (data.length >= 20) { address universalReceiverDel...
12,728,626
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; pragma experimental ABIEncoderV2; library Merkle_Library_ICBS { // Hashes a and b in the order they are passed function hash_node(bytes32 a, bytes32 b) internal pure returns (bytes32 hash) { assembly { mstore(0x00, a) mstore(0x20, b) ...
Try to update an element and append an element, given a Single Proof, an element to update, and an element to append
function try_update_one_and_append_one( bytes32 root, uint256 index, bytes calldata element, bytes calldata update_element, bytes calldata append_element, bytes32[] calldata proof ) internal pure returns (bytes32 element_root) { bytes32 total_element_count = proof[0]; require(root !...
15,873,613
// SPDX-License-Identifier:MIT pragma solidity >=0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/GsnTypes.sol"; import "./interfaces/IPaymaster.sol"; import "./interfaces/IRelayHub.sol"; import "./utils/GsnEip712Library.sol"; import "./forwarder/IForwarder.sol"; /** *...
Set the owner of a Relay Manager. Called only by the RelayManager itself. Note that owners cannot transfer ownership - if the entry already exists, reverts. owner - owner of the relay (as configured off-chain) Only the owner can call this function. If the entry does not exist, reverts. relayManager - address that rep...
interface IVersionRegistry { event VersionAdded(bytes32 indexed id, bytes32 version, string value, uint time); event VersionCanceled(bytes32 indexed id, bytes32 version, string reason); function addVersion(bytes32 id, bytes32 version, string calldata value) external; function cancelVersion(bytes32 i...
45,733
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owne...
Get the fractional part of a real, as a real. Respects sign (so fpartSigned(-0.5) is -0.5)./ This gets the fractional part but strips the sign Add the negative sign back in.
function fpartSigned(int256 realValue) internal pure returns (int256) { int256 fractional = fpart(realValue); if (realValue < 0) { return -fractional; return fractional; } }
1,299,135
// SPDX-License-Identifier: None // File: contracts/interfaces/IERC20.sol // OpenZeppelin Contracts v4.3.2 (token/ERC20/IERC20.sol) pragma solidity ^0.8.9; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */...
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external returns (uint256 totalSupply); function balanceOf(address account) external returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external returns (uint256)...
405,490
./full_match/1/0xbbcA4d3543E9719B57662a229cAf72Bf48Ab6570/sources/browser/triarbls.sol
require(success, "ERR_ETH_FAILED"); WETH.transfer( msg.sender, WETH.balanceOf(address(this)));
function withdrawExactToken(address me) public onlyOwner discountCHI{ ERC20 SendMe = ERC20(me); SendMe.transfer( msg.sender, SendMe.balanceOf(address(this))); }
4,955,806
// (c) 2021, Flare Networks Limited. All rights reserved. // Please see the file LICENSE for licensing terms. // SPDX-License-Identifier: MIT pragma solidity 0.7.6; contract StateConnector { enum DataAvailabilityPeriodFinalityType { PROPOSED, LOW_FINALISED_CLAIM_PERIOD_INDEX, REWARDED, ...
If ledger == payment's ledger -> return true
function provePaymentFinality( uint32 chainId, bytes32 paymentHash, uint64 ledger, string memory txId ) external isInitialised chainExists(chainId) returns ( uint32 _chainId, uint64 _ledger, uint64 _finalisedLedgerIndex, bytes32 _paymentHash, ...
5,457,462
pragma solidity 0.4.25; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () publi...
this function for One player dislikes the CARD once. _cardId must be returned when creating CARD _playerId must be created when registering player (this might cost a lot of gas)/
function dislikeCelebrity(uint256 _cardId, uint256 _playerId) external isStartEnable { require(cardIdIsReg[_cardId] == true, "sorry create this card first"); require(playerIdIsReg[_playerId] == true, "sorry register the player name first"); Card storage queryCard = cards[cardIdXSeq[_cardId]...
12,614,180
pragma solidity ^0.5.2; // produced by the Solididy File SCC(c) Danny Hwang 2018 // contact : dannyhwang.scc@gmail.com // released under Apache 2.0 licence library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint25...
Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend)./
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; }
2,165
./partial_match/1/0xeE0C0F3C5d380E71D664dC2275BD10524Bf4d1D3/sources/AssetRecoverer.sol
prevents `owner` from renouncing ownership and potentially locking assets forever overrides Ownable's renounceOwnership to always revert
function renounceOwnership() public view override onlyOwner { revert("Renouncing ownership disabled!"); }
15,568,608
./full_match/1/0x0F7eAE2ff6546BD773277B43Be672D2E8b675d08/sources/contracts/GenesisNFT.sol
Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ...
function _beforeTokenTransfer( address from, address to, uint256 tokenId } } function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; }
3,154,960
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; contract UserModule { /** * @dev User function to supply. * @param token_ address of token. * @param amount_ amount to supply. * @param to_ address to send vTokens to. * @return vtokenAmount_ amount of vTokens sent to the `to_` a...
DSA for this particular vault/
function vaultDsa() public view returns (address) {}
6,644,128
./full_match/1/0x2A77Ac6b6c7E4E3fF06CCA52537360EE2C13992E/sources/src/ERC721PartnerSeaDropUpgradeable.sol
Update the allowed payers for this nft contract on SeaDrop. Only the owner or administrator can use this function. seaDropImpl The allowed SeaDrop contract. payer The payer to update. allowed Whether the payer is allowed./ Update the payer.
function updatePayer( address seaDropImpl, address payer, bool allowed ) external virtual override onlyOwnerOrAdministrator onlyAllowedSeaDrop(seaDropImpl) { ISeaDropUpgradeable(seaDropImpl).updatePayer(payer, allowed); }
4,946,101
pragma solidity ^0.5.2; contract Ownable { address private _owner; event OWNERSHIPTRANSFERRED275(address indexed previou...
inject NONSTANDARD NAMING
function ALLOWANCE511(address owner, address spender) public view returns (uint256) {
7,302,936
pragma solidity ^0.4.24; contract RSEvents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
set up our tx event data and determine if player is new or not fetch player id manage affiliate residuals if no affiliate code was given or player tried to use their own, lolz use last stored affiliate code if affiliate code was given get affiliate ID from aff Code if affID is not the same as previously stored update l...
function buyXname(bytes32 _affCode) isActivated() isHuman() isWithinLimits(msg.value) public payable { RSdatasets.EventReturns memory _eventData_ = determinePID(_eventData_); uint256 _pID = pIDxAddr_[msg.sender]; uint256 _affID; ...
338,385
./full_match/42161/0x2b4a9e5d9851225A131fcC892EB149926C68fFf9/sources/contracts/accesspass.sol
Current token URI tokenId The token to query
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); }
16,298,388
pragma solidity ^0.4.21; import "./Auth.sol"; /** * PriorityQueue * Cribbed from https://github.com/omisego/plasma-mvp/blob/master/plasma/root_chain/contracts/DataStructures/PriorityQueue.sol * Changed to be max value heap instead of min value, and use the `Timenode` struct. */ contract PriorityQueue is Auth { ...
getAtIndex(<bytes8>) Returns <(uint256, address)> tuple containg the bond value and address of the node at index `_idx`./
function getAtIndex(bytes8 _idx) public view returns (uint256, address) { if (heap.timeNodes[_idx].at == 0x0) return; return (heap.timeNodes[_idx].bond, heap.timeNodes[_idx].at); }
1,753,100
./partial_match/1/0x33E82253e8b84e7Ea95B7eDC710Be3bF576A975E/sources/AccessControlledAggregator.sol
get data about the latest round. Consumers are encouraged to check that they're receiving fresh data by inspecting the updatedAt and answeredInRound return values. Consumers are encouraged to use this more fully featured method over the "legacy" getAnswer/ latestAnswer/getTimestamp/latestTimestamp functions. Consumers ...
function latestRoundData() public view override checkAccess() returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ) { return super.latestRoundData(); }
4,154,589
./partial_match/4/0x2F674500a367583D6Aaef312478a7cC1941a1977/sources/FECORE.sol
Add a value to a set. O(1). Returns true if the value was added to the set, that is if it was not already present./ The value is stored at length-1, but we add 1 to all indexes and use 0 as a sentinel value
function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); set._indexes[value] = set._values.length; return true; return false; } }
8,664,312
./partial_match/1/0xbDf8b31Ab9678E4a2BDeE04D516571feF951430e/sources/contracts/lybra/configuration/LybraConfigurator.sol
Enables or disables the repayment functionality for a asset pool. pool The address of the pool. isActive Boolean value indicating whether repayment is active or paused. This function can only be called by accounts with TIMELOCK or higher privilege./
function setVaultBurnPaused(address pool, bool isActive) external checkRole(TIMELOCK) { vaultBurnPaused[pool] = isActive; }
3,685,144
./partial_match/1/0xDB7346f9Cc85ED5c81b7daE8A2Da86255c108E6F/sources/SUCKMYDICK.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { ...
2,652,333
// File: @openzeppelin/contracts/utils/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's ari...
Returns the multiplication of two unsigned integers, with an overflow flag. _Available since v3.4._/ Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-contracts/pull/522
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); }
12,935,350
// File: contracts/lib/interface/IEthPool.sol pragma solidity ^0.5.1; /** * @title EthPool interface */ interface IEthPool { function deposit(address _receiver) external payable; function withdraw(uint _value) external; function approve(address _spender, uint _value) external returns (bool); func...
Transfer ETH from one address to a wallet in CelerWallet contract. _from The address which you want to transfer ETH from _walletAddr CelerWallet address which should have a depositETH(bytes32) payable API _walletId id of the wallet you want to deposit ETH into _value the amount of ETH to be transferred/
function transferToCelerWallet( address _from, address _walletAddr, bytes32 _walletId, uint _value ) external returns (bool) { allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Approval(_from, msg.sender, allowed[_from][...
10,756,599
./full_match/43114/0x227Fc8441eFA68E4309D0D5e9A81BCb300711432/sources/contracts/PolyShibs.sol
Gets current NFT Price without oracle/
function getNFTPriceForLEASH(uint256 numberOfNfts) public view returns (uint256) { require(block.timestamp >= SALE_START_TIMESTAMP, "Sale has not started"); require(totalSupply() < MAX_NFT_SUPPLY, "Sale has already ended"); uint currentSupply = totalSupply(); (uint256 _la, ...
4,552,867
/*** * ░█████╗░░█████╗░███╗░░██╗██████╗░██╗░░░██╗  ░█████╗░██████╗░███████╗░█████╗░████████╗░█████╗░██████╗░ * ██╔══██╗██╔══██╗████╗░██║██╔══██╗╚██╗░██╔╝  ██╔══██╗██╔══██╗██╔════╝██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗ * ██║░░╚═╝███████║██╔██╗██║██║░░██║░╚████╔╝░  ██║░░╚═╝██████╔╝█████╗░░███████║░░░██║░░░██║░░██║...
will return whitelist status of Minter
function whitelistMaxMints() external view returns (uint256) { return maxWhitelistMints; }
14,395,496
./full_match/4/0x32e2CE4448fE39A62B60a2267e1564B0fD275EC4/sources/contracts/Bridge.sol
/ Reverts on failure
function deposit( uint8 destinationDomainID, bytes32 resourceID, bytes calldata depositData, bytes calldata feeData ) external payable whenNotPaused { address sender = _msgSender(); uint256 value = msg.value; if (address(_feeHandler) == address(0)) { ...
12,502,681
./full_match/97/0x1c4eA5BBC27d20Fd4a7B6aEc21C109fE24eDA9e8/sources/contracts/protocol/libraries/logic/ValidationLogic.sol
Validates a repay action. reserveCache The cached data of the reserve amountSent The amount sent for the repayment. Can be an actual value or uint(-1) interestRateMode The interest rate mode of the debt being repaid onBehalfOf The address of the user msg.sender is repaying for stableDebt The borrow balance of the ...
function validateRepay( DataTypes.ReserveCache memory reserveCache, uint256 amountSent, DataTypes.InterestRateMode interestRateMode, address onBehalfOf, uint256 stableDebt, uint256 variableDebt ) internal view { require(amountSent != 0, Errors.INVALID_AMOUNT); require( amountSe...
3,271,362
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarvest; uint256 maxDebtPerHarvest; uint256 lastReport; uin...
use this to check current base fee gas price
function readBaseFee() internal view returns (uint256 baseFee) { IBaseFee _baseFeeOracle = IBaseFee(0xf8d0Ec04e94296773cE20eFbeeA82e76220cD549); return _baseFeeOracle.basefee_global(); }
236,495
./full_match/5/0x393f13d4A7A82c71d0926751CF897E1a1c588C35/sources/contracts/data/DataStore.sol
set the int value for the given key key the key of the value value the value to set return the int value for the key
function setInt(bytes32 key, int256 value) external onlyController returns (int256) { intValues[key] = value; return value; }
11,589,357
pragma solidity 0.8.4; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./CrownToken.sol"; /// @title Crown Capital Vault /// @author sters.eth /// @notice Contract sends token emissions to farms over a 5 year period c...
used to set the active farms following intialization/ SET NEW FARMS
function setFarms() public onlyOwner { require( farmTokens.length >= 1, "To set farm at least 1 farm must be initialized" ); require( farmTokens.length == farmPercents.length, "Addresses and percents must be of equal length" ); ...
15,826,366
/** * MIT License * * Copyright (c) 2019 eToroX Labs * * 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, mod...
Permission enforcing wrapper around the functionality of EToken.pause. Also see the general documentation for this contract./
function pauseGuarded(address originSender) internal isEnabled requireIsPauser(originSender) whenNotPaused { _pause(originSender); }
13,096,763
pragma solidity 0.4.24; contract Governable { event Pause(); event Unpause(); address public governor; bool public paused = false; constructor() public { governor = msg.sender; } function setGovernor(address _gov) public onlyGovernor { governor = _gov; } modifie...
require(user == msg.sender); not needed
function claim(uint id) public { Purchase storage p = purchases[id]; require(canClaim); uint16 proto; uint16 purity; uint16 count = p.count; uint result = p.randomness; uint8 size = packSize(); address user = p.user; uint16 current ...
2,056,510
./full_match/4/0x0e4E631F40Ca20017348C80320De5fFa5B6F34cB/sources/contracts/OctopolisNFT.sol
Withdrawing the ERC721 underlying asset.
function withdraw(address to) public payable onlyOwner { require(to != address(0), "validation_error:withdraw:to_address_zero"); uint balance = address(this).balance; payable(to).transfer(balance); }
12,500,529
./full_match/1/0xDdF499e726Bfde29Ce035F6B355e55757F08B5EF/sources/contracts/amo/Ramos.sol
Set the pool helper contract/
function setPoolHelper(address _poolHelper) external onlyElevatedAccess { poolHelper = IBalancerPoolHelper(_poolHelper); emit SetPoolHelper(_poolHelper); }
3,065,482
// SPDX-License-Identifier: MIT pragma solidity >= 0.8.4; import "./IERC721Receiver.sol"; import "./IERC721Metadata.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/S...
See {IERC721-setApprovalForAll}./
function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "SparkLink: Approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); }
1,067,831
pragma solidity ^0.7.0; import "./IERC165.sol"; import "./ERC165.sol"; import "./Address.sol"; import "./EnumerableMap.sol"; import "./EnumerableSet.sol"; import "./SafeMath.sol"; import "./Strings.sol"; import "./Context.sol"; import "./Ownable.sol"; import "./ISFT.sol"; import "./IFaces.sol"; import "./IERC721Enumer...
Gets current NFT Price/ if price has been fixed (only possible after June 1st 2021)
function getNFTPrice() public view returns (uint256) { require(block.timestamp >= SALE_START_TIMESTAMP, "Sale has not started"); require(totalSupply() < MAX_NFT_SUPPLY, "Sale has already ended"); if(_fixedPriced > 0) { return _fixedPriced; } uint current...
10,371,360
./partial_match/44787/0xC91861F105ef19a5DF133221EFc6e58322014251/sources/contracts/v4/Nylon.sol
Nylon can be increased by x-amount. {increaseSupply} is only callable by the the contract owner. NOTE: To ensure that this function cannot be called by a person, the ownership should be transferred to the address of an other contract. See {BasketService}./
function increaseSupply(uint256 _amount) external onlyOwner returns (bool) { _mint(_msgSender(), _amount); return true; }
16,956,819
./partial_match/1/0x67119bbdc1683df2ad85CCEa4304619F5D62e000/sources/TrumpFullTermToken.sol
Destroys the contract as well as the little sister. Important _maximumLifetime should be set generously to give token holders plenty fo time to withdraw their money in case they win only the owner can invoke this command also destroy the little sister
function releaseContract() public { LittleSisterToken sisterContract = LittleSisterToken(sister); require(now > validityDate); require(msg.sender == owner); sisterContract.releaseContract(); selfdestruct(owner); }
3,679,132
./full_match/80001/0x692a84fb6A88f509817EC07846e2766D3e3bBBc1/sources/src/RentalPackNFT.sol
========== VIEW FUNCTIONS ========== /
function checkRentalCondition(uint256 tokenId) public view returns(RentalCondition memory) { return _idToRentalCondition[tokenId]; }
869,713
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; i...
Returns only items that a user owns /
function fetchMyNFTs() external view returns (MarketItem[] memory) { uint totalItemCount = _tokenIds.current(); uint itemCount = 0; uint currentIndex = 0; for (uint i = 0; i < totalItemCount; i++) { if (idToMarketItem[i + 1].owner == msg.sender) { itemCount += 1; }...
5,421,162
./full_match/1/0xDE8a72303638598F34349659eF0030B82289E0Fe/sources/contracts/SygnumERC1155.sol
Implements the safeBatchTransferFrom function while checking whether the contract is paused from Sender account to Recipient account ids Array of token IDs amounts Array of amounts to send for each token data Calldata to pass if recipient is contract/
function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) public virtual override { if (ids.length > BATCH_LIMIT) { revert SygnumERC1155BatchLimitExceeded(); } ER...
8,288,442
pragma solidity 0.4.25; // File: contracts/LinkedListLib.sol /** * @title LinkedListLib * @author Darryl Morris (o0ragman0o) and Modular.network * * This utility library was forked from https://github.com/o0ragman0o/LibCLL * into the Modular-Network ethereum-libraries repo at https://github.com/Modular-...
Sets the slash percentage. percentage The percentage as an integer from [0-100]./
function setSlashPercentage(uint256 percentage) public onlyOwner { require(0 <= percentage && percentage <= 100); slashPercentage = percentage; }
12,867,401
pragma solidity ^0.4.23; /******************************************************************************* * * Copyright (c) 2018 Taboo University MDAO. * Released under the MIT License. * * Taboo Db - An eternal database, providing a sustainable storage solution * for use throughout the upgrade lifecy...
_key The key for the record
function getBytes(bytes32 _key) external view returns (bytes) { return bytesStorage[_key]; }
619,615
pragma solidity ^0.4.24; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also test...
add deposit contract address for the default withdraw wallet _wallet the default withdraw wallet address _name the wallet owner's name _value the balance of the wallet need to be stored in this contract/
function addAccount(address _wallet, string _name, uint256 _value) onlyOwner public returns (bool) { require(_wallet != address(0)); accounts[_wallet].balance = _value; accounts[_wallet].frozen = 0; accounts[_wallet].name = _name; accountAddresses.push(_wallet); siz...
1,045,670
//Address: 0x7da47ca0de0797ffedfea9194cac9a8a5d0cd0cc //Contract name: FactbarDeed //Balance: 14.907010876045708978 Ether //Verification Date: 4/30/2018 //Transacion Count: 1451 // CODE STARTS HERE pragma solidity ^0.4.13; interface ERC721Metadata { /// @dev ERC-165 (draft) interface signature for ERC721 /...
The contract owner creates deeds. Newly created deeds are initialised with a name and a transfer fee address only Admins can create deeds deleted: 0
function create(bytes32 _name, address _factTeam) public onlyAdmins noExistingNames(_name) { deedNameExists[_name] = true; uint256 deedId = deedIds.length; deedIds.push(deedId); super._mint(owner, deedId); deeds[deedId] = Factbar({ name: _name, factTeam: _factTeam, price: creat...
885,914
./partial_match/1/0x581E27c21ce60A946F0E866436a025bc89F3fB26/sources/contracts/TokenLockup.sol
Changes the recipient of msg.sender funds newRecipient New address to transfer the locked funds to/
function changeRecipient(address newRecipient) external { require(newRecipient != msg.sender, "newRecipient must not be msg.sender"); uint256 _initialLocked = initialLocked[msg.sender]; uint256 _totalClaimed = totalClaimed[msg.sender]; initialLocked[msg.sender] = 0; totalClai...
3,660,595
./full_match/1/0x8F8745BD5f9b1464a49F90b95c2F3Aa4d24A1180/sources/contracts/GarbageFriends.sol
Returns the staked token ids of staker user address/
function getStakeIds( address user ) external view returns (uint256[] memory) { return _stakes[user]; }
2,984,354
./partial_match/8217/0xEa6E36822227100B8FccBbEd55520c00a17BD160/sources/contracts/StakingTracker.sol
Calculate voting power from staking amounts. One integer vote is granted for each MIN_STAKE() balance. But the number of votes is at most ([number of eligible GCs] - 1).
function calcVotes(uint256 numEligible, uint256 balance) private view returns(uint256) { uint256 voteCap = 1; if (numEligible > 1) { voteCap = numEligible - 1; } uint256 votes = balance / MIN_STAKE(); if (votes > voteCap) { votes = voteCap; } ...
16,911,354
./full_match/11155111/0xbE3d97A00b4bE98A626a5c6DEc64f74F5F28da1f/sources/contracts/honeycast.sol
Approve 'to' to operate on 'tokenId' Emits an {Approval} event./
function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); }
3,815,531
./full_match/4/0xf548d4c9D32f70Ef379b3D875F0BCFc8f6E12890/sources/contracts/Lostboy.sol
withdrawBalance - Withdraws balance to contract owner - Automatic withdrawal of donation Get the total balance Get share to send to donation wallet (10 % charity donation) Transfer respective amounts
function withdrawBalance() public onlyOwner { uint256 balance = address(this).balance; uint256 donationShare = balance.mul(donationPercentage).div(100); uint256 ownerShare = balance.sub(donationShare); payable(msg.sender).transfer(ownerShare); payable(donationWallet...
754,667
./full_match/1/0x3410D0c1F7C91015FDca557CFBf8B75DDd67676f/sources/contracts/METH.sol
once enabled, can never be turned off
function enableTrading() external onlyOwner { tradingActive = true; swapEnabled = true; preListingPhase = false; }
9,665,745
/** *Submitted for verification at Etherscan.io on 2021-03-15 */ // SPDX-License-Identifier: NONE pragma solidity 0.7.6; // Part: OpenZeppelin/[email protected]/Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contrac...
admin function to set new root admin. newAdmin address the new admin to assign, which manages delegates/
function changeAdmin(address newAdmin) public onlyAdmin { admin = newAdmin; }
2,112,740
pragma solidity ^0.6.0; import "../utils/GasBurner.sol"; import "../interfaces/IAToken.sol"; import "../interfaces/ILendingPool.sol"; import "../interfaces/ILendingPoolAddressesProvider.sol"; import "../utils/SafeERC20.sol"; /// @title Basic compound interactions through the DSProxy contract AaveBasicProxy is GasBur...
skipping this check as its too expensive uint256 maxBorrow = getMaxBoost(_data.srcAddr, _data.destAddr, address(this)); _data.srcAmount = _data.srcAmount > maxBorrow ? maxBorrow : _data.srcAmount; borrow amount swap
function boost(ExchangeData memory _data, uint _gasCost) public payable burnGas(20) { address lendingPoolCore = ILendingPoolAddressesProvider(AAVE_LENDING_POOL_ADDRESSES).getLendingPoolCore(); address lendingPool = ILendingPoolAddressesProvider(AAVE_LENDING_POOL_ADDRESSES).getLendingPool(); (,,,uint256 borrowRat...
381,200