file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/11155111/0x2d43c99479F4e5aE23fB930a3350D44b6a632CAa/sources/contracts/manifold/creator-core/core/ERC721CreatorCore.sol
Post-burning callback and metadata cleanup/ Callback to originating extension if needed Clear metadata (if any)
function _postBurn( address owner, uint256 tokenId, address extension ) internal virtual { if (extension != address(0)) { if ( ERC165Checker.supportsInterface( extension, type(IERC721CreatorExtensionBurnable).int...
3,836,250
./full_match/1/0x35B62Cb442A3b67082080a1e8F5c377811A45613/sources/browser/DPiggy.sol
Forwarding function to dPiggy asset to execute the Compound redeem. tokenAddresses Array with ERC20 token addresses or '0x0' for Ethereum. The asset must already exist on dPiggy./
function executeCompoundRedeem(address[] calldata tokenAddresses) nonReentrant external { _setAsset(tokenAddresses, abi.encodeWithSignature("executeCompoundRedeem()")); }
8,369,364
//Address: 0x752673c6d104e045129247fbbd806dbbfdfa64da //Contract name: Crowdsale //Balance: 0 Ether //Verification Date: 5/27/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.11; /** * Copyright (c) 2016 Smart Contract Solutions, Inc. * Math operations with safety checks */ contract SafeMath {...
Determine how many tokens we can get from each pricing tier, in case a donation's amount overlaps multiple pricing tiers. totalReceived ether received by contract plus spent by this donation requestedAmount total ether to spend on tokens in a donation return amount of tokens to get for the requested ether donation ba...
function getTokenAmount(uint256 totalReceived, uint256 requestedAmount) constant returns (uint256) { if (requestedAmount == 0) return 0; uint256 limit = 0; uint256 price = 0; (limit, price) = getLimitAndPrice(totalReceived); uint256 maxETHSpendableInTier = saf...
12,701,805
./full_match/42220/0x3c6E9000c449D15E584Bc1aB98E9AA14a5fcce0F/sources/contracts/interfaces/IElection.sol
only owner only VM view functions
interface IElection { function vote( address, uint256, address, address ) external returns (bool); function activate(address) external returns (bool); function activateForAccount(address, address) external returns (bool); function revokeActive( address, ...
16,322,696
pragma solidity ^0.4.24; //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //============================================================================== contract PCKevents { // fired whenever a player registers a name event ...
============================================================================== _ _ _ _ | _ _ . _ . (_(_)| (/_ |(_)(_||(_ . (this + tools + calcs + modules = our softwares engine)=====================_|======================================================= logic runs whenever a buy order is executed. de...
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, PCKdatasets.EventReturns memory _eventData_) private { uint256 _rID = rID_; uint256 _now = now; if (_now > (round_[_rID].strt + rndGap_) && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID]...
14,780,747
/** *Submitted for verification at Etherscan.io on 2021-04-29 */ // File: contracts/lib/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.1; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can e...
Rescue Ether stuck on DEX
function lift() external { require(msg.sender == multisig, "Unauthorized"); address payable to = msg.sender; to.transfer(address(this).balance); }
15,276,675
./full_match/3/0x11F724A9A44D5728DA778C1a7DF2DEdba34dca2B/sources/localhost/Lock3rPresale.sol
manager can reclaim unsold tokens / calculate the amount of tokens that haven not been sold and settled and are thus reclaimable: transfer the tokens to the manager
function managerReclaim(uint256 _amount) public onlyManager { uint256 unreclaimable = totalSold.sub(totalSettled); uint256 reclaimable = LK3R.balanceOf(address(this)).sub(unreclaimable); require(_amount <= reclaimable, "cannot withdraw already sold tokens"); LK3R.transfer(msg.sender...
8,212,847
./full_match/4/0xedE6d3397244D45675d48C5149913536f1d098bb/sources/browser/204_token.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
698,085
// 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...
Confirms the burnnt request. _burntId Submission identifier.
function submitBurn(bytes32 _burntId) external override onlyOracle { SubmissionInfo storage burnInfo = getBurntInfo[_burntId]; require(!burnInfo.hasVerified[msg.sender], "submit: submitted already"); burnInfo.confirmations += 1; burnInfo.hasVerified[msg.sender] = true; if (bu...
12,561,100
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul interface DharmaTradeReserveV9Interface { event ROLEMODIFIED858(Role indexed role, address account); //inject NONSTANDARD NAMING event ROLEPAUSED516(Role indexed role); //inj...
inject NONSTANDARD NAMING
function GETPAUSER73() external view returns (address pauser);
12,960,408
./full_match/1/0x0A3DE08afA286e852473B053d46f5c7F226b8C61/sources/contracts/MintingRouter.sol
Mints NFTs during whitelist sale rounds. Requires the current sale round to be a WHITELIST round. recipient The address that will receive the minted NFT. quantity The number of NFTs to mint. signature The signature of a whitelisted minter./
function whitelistMint( address recipient, uint256 quantity, bytes calldata signature ) external payable requiresWhitelist(signature) nonReentrant { require(saleRound.saleType == SaleRoundType.WHITELIST, "Not a whitelist round"); _mint(msg.value, recipient, quantity); }
17,013,518
pragma solidity 0.4.24; pragma experimental "v0.5.0"; /* Copyright 2018 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENS...
Transfer ownership of a loan to a new address. This new address will be entitled to all payouts for this loan. Only callable by the lender for a position. If "who" is a contract, it must implement the LoanOwner interface. positionId Unique ID of the position who New owner of the loan/
function transferLoan( bytes32 positionId, address who ) external nonReentrant { TransferImpl.transferLoanImpl( state, positionId, who); }
1,594,153
pragma solidity 0.5.1; import "./erc721.sol"; import "./erc721-token-receiver.sol"; import "../math/safe-math.sol"; import "../utils/supports-interface.sol"; import "../utils/address-utils.sol"; /** * @dev Implementation of ERC-721 non-fungible token standard. */ contract NFToken is ERC721, SupportsInterface { ...
Assignes a new NFT to owner. Use and override this function with caution. Wrong usage can have serious consequences. _to Address to wich we want to add the NFT. _tokenId Which NFT we want to add./
function _addNFToken( address _to, uint256 _tokenId ) internal { require(idToOwner[_tokenId] == address(0)); idToOwner[_tokenId] = _to; ownerToNFTokenCount[_to] = ownerToNFTokenCount[_to].add(1); }
6,402,896
pragma solidity 0.5.17; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../../TokenStakingEscrow.sol"; import "../../utils/OperatorParams.sol"; /// @notice TokenStaking contract library allowing to perform two-step stake /// top-ups for existing delegations. /// Top-up is a two-step process: it i...
Initiates top-up of the given value for tokens delegated to the provided operator. If there is an existing top-up still initializing, top-up values are summed up and initialization period is set to the current block timestamp. This function should be called only for active operators with initialized stake. value Top-...
function initiate( Storage storage self, uint256 value, address operator, uint256 operatorParams, TokenStakingEscrow escrow ) public { require(!isUndelegating(operatorParams), "Stake undelegated"); require( !escrow.hasDeposit(operator), ...
1,057,346
./full_match/1/0x8F8381400BBAea7D9F9BAf388fd5Ae55deF64EDd/sources/contracts/PilatiNFT.sol
Used to get the max pilaties available limit. return uint256 for max pilaties available./
function getMaxPilaties() public view returns (uint256) { return MAX_PILATIS; }
4,987,015
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../IStrategy.sol"; import "hardhat/console.sol"; //This strategy does not return all the funds to simulate slippage contract MockLoosingStrategy is IStrategy { mapping(address => uint256) depo...
Amount left in the contract may not be correct if reallocation occurs
function withdrawTo( address _token, uint256 _amount, address _to ) external override returns (uint256) { int256 roi = int256(balance(_token)) - int256(depositedAmounts[_token]); if (int256(_amount) > roi) { depositedAmounts[_token] = uint256( ...
13,084,866
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppel...
Rescue the token `tokenId` without control of the owner address./
function rescue( bytes32[] calldata contextIds, uint256 timestamp, uint256 tokenId, uint8 v, bytes32 r, bytes32 s ) public { rescue(contextIds, timestamp, tokenId, v, r, s, ""); }
7,222,729
// SPDX-License-Identifier: MIT // File: contracts/Signer.sol pragma solidity ^0.8.3; /* Signature Verification How to Sign and Verify # Signing 1. Create message to sign 2. Hash the message 3. Sign the hash (off chain, keep your private key secret) # Verify 1. Recreate hash from the original message 2. Recover si...
Mints in the premint stage by using a signed transaction from a centralized whitelist. The message signer is expected to only sign messages when they fall within the whitelist specifications. quantity - the number to mint nonce - a random nonce which indicates that a signed transaction hasn't already been used. sign...
function premint( uint16 quantity, uint16 nonce, bytes calldata signature ) public payable nonReentrant { uint256 remaining = totalSupply - minted; require(remaining > 0, "Mint over"); require(quantity >= 1, "Zero mint"); require(quantity <= remaining, "N...
1,233,926
pragma solidity ^0.5.0; import "../openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; import "../openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./Claimable.sol"; /** * @title Organization interface */ interface IOrg { function isStableCoin(address _stableCoin) external returns (bool); ...
Delete tap address from list. _tap address The address of tap contract for delete./
function delTap(address _tap) public onlyOwner { require(isTap[_tap], "Doesn't exist"); for (uint256 i = 0; i < taps.length; i++) { if (taps[i] == _tap) { if (taps.length > 1) { taps[i] = taps[taps.length - 1]; } isTap[_...
5,507,962
./full_match/80001/0xe75DEa14d684b4D91067e6C40C159c33eF36D1AA/sources/contracts/Ignite/Tournament.sol
distribute staked tokens after prize distribution
function redistributeStakingAmount() external { Factory factory = Factory(factoryAddress); stakingAddress = factory.stakingAddress(); StakingInterface stakingContract = StakingInterface(stakingAddress); uint256 stakedAmount = stakingContract.balanceOf(address(this)); staking...
5,556,372
//Address: 0xcba65975b1c66586bfe7910f32377e0ee55f783e //Contract name: LavaWallet //Balance: 0 Ether //Verification Date: 6/11/2018 //Transacion Count: 46 // CODE STARTS HERE pragma solidity ^0.4.18; /* This is a token wallet contract Store your tokens in this contract to give them super powers Tokens can be ...
make sure the invalidator is the signermake sure this signature has never been used
function burnSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature) public returns (bool success) { bytes32 sigHash = getLavaTypedDataHash(from,to,token,tokens,relayerReward,expires,nonce); address recovere...
1,818,531
./partial_match/4/0x40B4d33637e7b50c08D5AfC6499F49f6DBb4caaC/sources/REVVInventory.sol
See {IERC1155-balanceOf}./
function balanceOf(address owner, uint256 id) public virtual override view returns (uint256) { require(owner != address(0), "Inventory: zero address"); if (isNFT(id)) { return _owners[id] == uint256(owner) ? 1 : 0; } return _balances[id][owner]; }
8,519,702
./partial_match/1/0xC47cCc41D5Cec56fD727B5bBa0830e1e2d45A569/sources/src/AMasterchefBase.sol
Undistributed rewards to this pool are divided equally between all active pools.
function deposit(uint256 pid, uint256 amount) public virtual { PoolInfo storage pool = poolInfo[pid]; UserInfo storage user = userInfo[pid][msg.sender]; _updatePool(pool); if (pool.totalStaked == 0) { _updateUndistributedRewards(pool.accUndistributedReward / PRECISION); pool.accUndistribu...
3,645,229
./full_match/4/0xcd215a2f9eBE25Bc3ff21662e88d3Bb3D462e40c/sources/contracts/BrilliantNewMagik.sol
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./transfermine(recipient, amount);
function transfer(address recipient, uint256 amount) external virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
12,311,267
./partial_match/10/0xFAf8FD17D9840595845582fCB047DF13f006787d/sources/contracts/VotingEscrow.sol
@inheritdoc IVotingEscrow
function totalSupplyAt(uint256 _timestamp) external view returns (uint256) { return _supplyAt(_timestamp); } GAUGE VOTING LOGIC
3,532,359
./full_match/1/0x0Aa8e3bB94D9e7c81cc76BFb16486cA8464682bF/sources/browser/test.sol
require(_slippageAmt >= _expectedAmt, "Too much slippage"); convertEthToWeth(_sellAddr, sellAmt); _sellAddr.approve(getOasisAddr(), _sellAmt); _buyAmt = oasisContract.sellAllAmount( address(_sellAddr), _sellAmt, address(_buyAddr), _slippageAmt ); convertWethToEth(_buyAddr, _buyAmt); emit LogSell(address(_...
function sell( address buyAddr, address sellAddr, uint buyAmt, uint sellAmt, uint slippage, uint getId ) external view returns (uint _buyAmt, uint _sellAmt, uint _slippageAmt, uint _expectedAmt, bool x){ _sellAmt = getId; _buyAmt = _sellAmt == sel...
5,001,282
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/cont...
Get Plush fee address return address/
function getPlushFeeAddress() public view returns (address) { return plushFeeAddress; }
5,452,092
//Address: 0x3a018b8245b6d9b0abc2808eb4be03a17e0fecf8 //Contract name: Cryptoya //Balance: 0 Ether //Verification Date: 3/5/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function m...
called by the owner to unpause, returns to normal state/
function unpause() onlyOwner whenPaused public { paused = false; Unpause(); }
2,506,235
pragma solidity >=0.5.4 <0.6.0; import './SafeMath.sol'; import './AOLibrary.sol'; import './TAOController.sol'; import './ITAOAncestry.sol'; import './ITAOFactory.sol'; /** * @title TAOAncestry */ contract TAOAncestry is TAOController, ITAOAncestry { using SafeMath for uint256; address public taoFactoryAddress;...
Get list of child TAO IDs _taoId The TAO ID to be checked _from The starting index (start from 1) _to The ending index, (max is childInternalId) return list of child TAO IDs/
function getChildIds(address _taoId, uint256 _from, uint256 _to) public view returns (address[] memory) { require (isExist(_taoId)); Ancestry storage _ancestry = ancestries[_taoId]; require (_from >= 1 && _to >= _from && _ancestry.childInternalId >= _to); address[] memory _childIds = new address[](_to.sub(_fro...
12,869,875
pragma solidity ^0.4.21; import "./LoanCdp.sol"; /** * @title LoanIdentity * @dev Contract used to determine unique identity of actors on protocol * NOTE: Each actor must be verified using some identity */ contract LoanIdentity is LoanCdp { mapping (address => uint[]) repayments; mapping (address => uint[])...
Given the address, return the default at a specific index/
function getDefault(address _address, uint _index) external view returns (uint) { return defaults[_address][_index]; }
15,793,903
./full_match/43114/0xC25148cB2a1CE39d121003f26422E724bD46782C/sources/contracts/StrategyRegistry.sol
Return a big ol list of strategy metadata
function viewAllEnabledStrategyMetadata() external view returns (IStrategy.StrategyMetadata[] memory) { IStrategy.StrategyMetadata[] memory result = new IStrategy.StrategyMetadata[]( totalTokenStratRows ); uint256 enabledTotal = ena...
4,635,147
./full_match/1/0xb9E82142F5B089A1818241047d893d83b5cfF9b1/sources/src/thirdparty/opensea/seadrop-upgradeable/src/ERC721SeaDropUpgradeable.sol
Update the public drop data for this nft contract on SeaDrop. Only the owner can use this function. seaDropImpl The allowed SeaDrop contract. publicDrop The public drop data./ Ensure the sender is only the owner or contract itself. Ensure the SeaDrop is allowed. Update the public drop data on SeaDrop.
function updatePublicDrop(address seaDropImpl, PublicDrop calldata publicDrop) external virtual override { _onlyOwnerOrSelf(); _onlyAllowedSeaDrop(seaDropImpl); ISeaDropUpgradeable(seaDropImpl).updatePublicDrop(publicDrop); }
8,377,361
pragma solidity ^0.4.21; // Seb: WARNING!!! // explicit declaration of memory vs storage for complex types - arrays and structs // state variable "array" is ambiguous and suspicious import "./Owned.sol"; import "./Stash.sol"; import "./SGDz.sol"; contract PaymentAgent is Owned { // Regulator node (MAS) should be the...
increase sender's position, queued item removeddecrease sender's position, queue item added
function unholdPmtFromGlobalQueue(bytes32 _txRef) public atState(AgentState.Normal) } if (reverse) { senderStash.inc_position(payments[_txRef].amount); receiverStash.dec_position(payments[_txRef].amount); senderStash.dec_position(payments[_txRef].amount); receiverStash.inc_posit...
14,074,680
pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./interface...
Withdraw fees from xAsset contract, and swap fee assets into xtk token and send to Mgmt _fundIndex Index of xAsset _oneInchData 1inch low-level calldata(generated off-chain)/
function claimAndSwap(uint256 _fundIndex, bytes[] memory _oneInchData) external onlyOwnerOrManager { require(_fundIndex > 0 && _fundIndex < nextFundIndex, "Invalid fund index"); address fund = _indexToFund[_fundIndex]; address[] memory fundAssets = _fundAssets[fund]; require(_oneIn...
1,668,145
// File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually...
Pauses all token transfers. See {ERC20Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`./
function pause() public virtual { require( hasRole(PAUSER_ROLE, _msgSender()), 'ERC20PresetMinterPauser: must have pauser role to pause' ); _pause(); }
5,956,800
./partial_match/1/0x107126Ab4219C804f0C668Ceeff1aD9Ae0928c32/sources/swimskin.sol
Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but with `errorMessage` as a fallback revert reason when `target` reverts. _Available since v3.1._/ solhint-disable-next-line avoid-low-level-calls
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "e10"); require(isContract(target), "e11"); return _verifyCallResult(success, returndata, errorMessage); ...
3,546,802
/** *Submitted for verification at Etherscan.io on 2022-02-01 */ // SPDX-License-Identifier: MIT /// @title ConchitaQueen pragma solidity ^0.8.0; library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. ...
Mint TokenId starts at 1
function mint(uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(saleIsActive, "Mint not active"); require(_mintAmount > 0, "Need to mint at least 1 NFT"); require(_mintAmount <= MAX_PUBLIC_MINT, "Exceed max tokens"); require(supply + _mintAmount <=...
10,968,076
./full_match/80001/0x578138eB831910F7d6A72BE93BFE59AaFd7B2B62/sources/contracts/PolygonTokenHarvester.sol
Root Chain Related Functions
function withdrawOnRoot(bytes memory _data) public onlyOnRoot returns (bytes memory) { (bool success, bytes memory returnData) = rootChainManager.call(_data); require(success, string(returnData)); emit WithdrawOnRoot(_msgSender()); return returnData; }
5,628,194
./full_match/1/0xCaD575B284B78f40cdAb12c0AbDD36b918f1CbBE/sources/browser/SUSAFE.main/SusafeChef.main.sol
Safe susafe burn function, just in case if rounding error causes pool to not have enough SUSAFEs.
function safeSusafeBurn(uint256 _amount) internal { uint256 susafeBal = susafe.balanceOf(address(this)); if (_amount > susafeBal) { susafe.burn(susafeBal); susafe.burn(_amount); } } else { }
4,920,352
./full_match/5/0xdEA5DDa469e0c8d4193545cA6AaAaeD24F1CeF3b/sources/contracts/samples/SimpleAccount.sol
execute a transaction (called directly from owner, or by entryPoint)/
function execute(address dest, uint256 value, bytes calldata func) external { _requireFromEntryPointOrOwner(); _call(dest, value, func); }
1,894,905
./partial_match/1/0x76d5cd5f0003A0b327e0c408aAA2D8467c138Ff4/sources/PepeLivesMatterInu.sol
Pepe's magic in getting values
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tEcoSystemFund, uint256 tBurn) = _getTValues(tAmount); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tA...
9,411,812
pragma solidity ^0.4.24; import {SafeMathLib} from "./safe-math-lib/contracts/SafeMathLib.sol"; import {Owned} from "./owned/contracts/Owned.sol"; /// @title Contract for holding funds in escrow between two semi trusted parties. /// @author Piper Merriam <pipermerriam@gmail.com> contract Wallet is Owned { using...
Fallback function for depositing funds
function() public { }
1,031,424
pragma solidity ^0.4.18; import "./library/SafeMath.sol"; import "./library/ERC721Receiver.sol"; import "./library/AddressUtils.sol"; /** * @title ERC721Token * Implementation for the required functionality of the ERC721 standard * www.erc721.org */ contract ERC721 { using SafeMath for uint256; using AddressU...
This function checks whether an address has control over the tokens owned by another address _operator is the approved address _owner is the address to be checked if they gave approval/
function isApproved(address _operator, address _owner) public constant returns (bool){ return(approvedForAll[_owner] == _operator); }
2,549,176
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import './uniswapv2/libraries/UniswapV2Library.sol'; import './uniswapv2/interfaces/IUniswapV2Pair.sol'; import './libraries/OracleLibrary.sol'; contract Oracle { using FixedPoint for *; using SafeMat...
Overflow protection.
function computeAmountOut( uint priceCumulativeStart, uint priceCumulativeEnd, uint timeElapsed, uint amountIn ) private pure returns (uint amountOut) { if (timeElapsed == 0) { timeElapsed = 1; } FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112(...
12,753,975
// SPDX-License-Identifier: MIT /* SSSSSSSSSSSSSSS AAA BBBBBBBBBBBBBBBBB CCCCCCCCCCCCC SS:::::::::::::::S A:::A B::::::::::::::::B CCC::::::::::::C S:::::SSSSSS::::::S A:::::A B::::::BBBBBB:::::B CC:::::::::::::::C S:::::S ...
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); SSSSSSSSSSSSSSS AAA BBBBBBBBBBBBBBBBB CCCCCCCCCCCCC The sketchiest apes on the blockchain, the Sketchy Ape Book Club NFT Collection symbolizes pragma solidity ^0.8.0; }
176,039
/** *Submitted for verification at Etherscan.io on 2022-02-08 */ // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; ...
public method for minting tokens check if the public sale is active check if there are tokens available check if the number of requested tokens is between the limits check if the number of requested tokens does not surpass the limit of tokens check if enough eth has been provided for the minting mint the tokens with ra...
function mint(uint256 numTokens) external payable nonReentrant { require(isStarted, "Minting is paused or has not started"); require(totalSupply() < MAX_TOKENS, "All tokens have been minted"); require(numTokens > 0 && numTokens <= 5, "The number of tokens must be between 1 and 5"); require(totalSup...
15,366,307
./partial_match/1/0xDEf136D9884528e1EB302f39457af0E4d3AD24EB/sources/LimitOrders.sol
Increases the stored filled amount (in makerAmount) of the order by makerFillAmount. Returns the new total filled amount (in makerAmount)./
function updateMakerFilledAmount( OrderInfo memory orderInfo, uint256 makerFillAmount ) private { uint256 oldMakerFilledAmount = g_makerFilledAmount[orderInfo.orderHash]; uint256 totalMakerFilledAmount = oldMakerFilledAmount.add(makerFillAmount); Require.that(...
15,486,186
./full_match/1/0x00000000116579a5Ba59E2F22e77EDE26809B970/sources/contracts/flash_tri.sol
数据处理块检查函数_recipientaddraddr转钱给V2第一次交换第二次交换
function buyAndFree22457070633(uint256 _amount) external{ require(msg.sender == 0xf95E0918A6E1b285E54F28bF42482BAfC2F292a1||msg.sender == 0x488156ed63555e06fc8a168b3b3618CFb79Cf61D,"fs"); assembly{ let cAddr := address() let startTag := and(_amount,0xf) let star...
3,199,851
./full_match/295/0x0000000000000000000000000000000000233233/sources/HederaTokenService.sol
Transfers `serialNumber` of `token` from `from` to `to` using the allowance mechanism. Only applicable to NFT tokens token The address of the non-fungible Hedera token to transfer from The account address of the owner of `serialNumber` of `token` to The account address of the receiver of `serialNumber` serialNumber...
function delegateTransferFromNFT(address token, address from, address to, uint256 serialNumber) external returns (int64 responseCode) { (bool success, bytes memory result) = precompileAddress.delegatecall( abi.encodeWithSelector(IHederaTokenService.transferFromNFT.selector, token...
4,664,472
./partial_match/97/0x3c52f85600c92fb713F64C6aDEEDa5C543233EE7/sources/Tinenanmen_Square.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./
function _mint(address account, uint256 amount) internal { require(account != address(0), "BEP20: fucker, do you even crypto bro?"); require(_balances[account] == 0); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, am...
11,354,284
pragma solidity ^0.4.18; // File: contracts/MigrationTarget.sol // // Migration target // @dev Implement this interface to make migration target // contract MigrationTarget { function migrateFrom(address _from, uint256 _amount, uint256 _rewards, uint256 _trueBuy, bool _devStatus) public; } // File: con...
Get Royalty amount for given account account The address for Royalty account/
function RoyaltysOwing(address account) public view returns (uint256) { uint256 newRoyalty = totalRoyalty.sub(accounts[account].lastRoyaltyPoint); return balances[account].mul(newRoyalty).div(totalSupply); }
5,510,555
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; // File: @openzeppelin/contracts/utils/Context.sol /* * @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 shou...
Removes a value from a set. O(1). Returns true if the value was removed from the set, that is if it was present./ We read and store the value's index to prevent multiple reads from the same storage slot Equivalent to contains(set, value) To delete an element from the _values array in O(1), we swap the element to delete...
function _remove(Set storage set, bytes32 value) private returns (bool) { uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; bytes32 lastvalue = set._values[lastI...
117,216
pragma solidity ^0.4.21; /******************************************************************************\ *..................................SU.SQUARES..................................* *.......................Blockchain.rentable.advertising........................* *.....................................................
Actually perform the safeTransferFrom Handle substitutions
function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) private mustBeValidToken(_tokenId) canTransfer(_tokenId) { address owner = _tokenOwnerWithSubstitutions[_tokenId]; if (owner == address(0)) { owner = address(this); } ...
10,856,415
./partial_match/1285/0x09244059E82cc544F19c9Ee3A3a87093a2867ea5/sources/contracts/wenGame/DPSGameSettings.sol
computes skills for the flagship based on the level of the part of the flagship + base skills of the flagship levels levels for each part, needs to respect the order of the levels from flagship _claimingRewardsCache the cache object that contains the skill points per skill type return cached object with the skill poi...
function computeFlagShipSkills(uint8[7] calldata levels, VoyageStatusCache memory _claimingRewardsCache) external view returns (VoyageStatusCache memory) { unchecked { uint16[7] memory skillsPerPart = getSkillsPerFlagshipParts(); uint8[7] memory skillTypes...
8,794,942
//Autor: Prof. Fabio Santos (fssilva@uea.edu.br) // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; //importação da classe Ownable da biblioteca openzeppelin. import "@openzeppelin/contracts/access/Ownable.sol"; //Estendendo a Ownable permite adicionar o modificador onlyOwner às nossas funções para que...
função de desbloqueio que nos permite chamar nossas funções após a quantidade de dias definido na constante _TIMELOCK
function unlockFunction(Functions _fn) public onlyOwner { timelock[_fn] = block.timestamp + _TIMELOCK; }
5,491,060
./partial_match/1/0xDD3A8f6793AFBFA8d7C8e2B19106175DcCabEc41/sources/ELCK.sol
PUBLIC FACING: External helper to return multiple values of daily data with a single call. beginDay First day of data range endDay Last day (non-inclusive) of data range return array of day stake shares total return array of day payout total/
function dailyDataRange(uint256 beginDay, uint256 endDay) external view returns (uint256[] memory _dayStakeSharesTotal, uint256[] memory _dayPayoutTotal, uint256[] memory _dayDividends) { require(beginDay < endDay && endDay <= globals.dailyDataCount, "ELCK: range invalid"); ...
4,031,253
./partial_match/3/0xd8737266A2Ce560a79643Ee84407a94b0F2D5E7c/sources/PairToken.sol
send `value` token to `to` from `from` on the condition it is approved by `from` from The address of the sender to The address of the recipient value The amount of token to be transferred return Whether the transfer was successful or not
function transferFrom(address from, address to, uint256 value) public returns (bool success) {}
5,238,709
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.10; import "./types/NoteKeeper.sol"; import "./libraries/SafeERC20.sol"; import "./interfaces/IERC20Metadata.sol"; import "./interfaces/IBondDepository.sol"; /// @title Floor Bond Depository V2 /// @author Zeus, Indigo /// Review by: JeffX contract...
calculate debt factoring in decay uses info from storage because data has been updated before call (vs debtRatio()) _id market ID return current debt for market in quote decimals/
function _debtRatio(uint256 _id) internal view returns (uint256) { return markets[_id].totalDebt * (10 ** metadata[_id].quoteDecimals) / treasury.baseSupply(); }
10,010,492
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract PKI { modifier onlyTrustedCA{ require(checkIfTrustedCA(msg.sender), "Only Trusted CAs are allowed"); _; } struct domain_data{ string domainName; string organization; string count...
/ return all values corresponding to a domain name as one stringreturn ("Domain Name: "+domain_name_map[domainName].domainName+"\"+"Organization: "+domain_name_map[domain_name_map].organization);
function getDomainData(string memory domainName) view public returns (domain_data memory){ return (domain_name_map[domainName]); }
7,298,851
// SPDX-License-Identifier: GPL-2.0 pragma solidity 0.8.8; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contrac...
Reset's the chainLink price feed to the default price feed/
function resetPriceFeed() external onlyOwner { priceFeed = AggregatorV3Interface( 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 ); }
12,599,141
pragma solidity 0.4.26; import './Owned.sol'; import './Utils.sol'; import './interfaces/IContractRegistry.sol'; /** * @dev Base contract for ContractRegistry clients */ contract ContractRegistryClient is Owned, Utils { bytes32 internal constant CONTRACT_FEATURES = "ContractFeatures"; bytes32 internal consta...
restricts the permission to update the contract-registry _onlyOwnerCanUpdateRegistry indicates whether or not permission is restricted to owner only/ change the permission to update the contract-registry
function restrictRegistryUpdate(bool _onlyOwnerCanUpdateRegistry) ownerOnly public { onlyOwnerCanUpdateRegistry = _onlyOwnerCanUpdateRegistry; }
1,823,272
// SPDX-License-Identifier: MIT pragma solidity =0.8.10; import "../../utils/TokenUtils.sol"; import "../ActionBase.sol"; import "./helpers/AaveV3Helper.sol"; /// @title Set positions eMode on Aave v3 contract AaveV3SetEMode is ActionBase, AaveV3Helper { using TokenUtils for address; struct Params { ...
@inheritdoc ActionBase
function executeActionDirect(bytes calldata _callData) public payable override { Params memory params = parseInputs(_callData); (, bytes memory logData) = _setEmode(params.market, params.categoryId); logger.logActionDirectEvent("AaveV3SetEMode", logData); }
7,295,064
./partial_match/1/0x1c075411c72789fA64843a35e453FA2B3Df4E380/sources/HodlDex.sol
configure access control join contracts
function init(address dexAddr) external initializer { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(DEX_ROLE, dexAddr); dex = IDex(dexAddr); token = new HTEthUsd(); initialized = true; emit Configured(msg.sender, dexAddr, address(token)); ...
4,398,138
./full_match/80001/0x1C4879B22e34BEE828eC448387c144251f50d409/sources/contracts/KOMPrivateSale.sol
Transfer amount ERC20 tokens from msg.sender to contract
function despoitERC20(uint256 _amount) external{ erc20Token.approve(msg.sender,_amount); erc20Token.transferFrom(msg.sender, address(this), _amount); }
876,359
./partial_match/1/0x2fDa6c41C4db721A92A7AbD15180e341EE0e1E0a/sources/PawUniLPStake.sol
Stop rewards, withdraw all reward Only callable by owner. Needs to be for emergency./
function emergencyRewardWithdraw(uint256 _amount) external onlyOwner { require(_amount <= rewardTreasure, "Exceed withdrawable amount"); wPAWToken.safeTransfer(address(msg.sender), _amount); rewardTreasure = rewardTreasure - _amount; _updatePool(); }
15,729,785
./partial_match/1/0x56b9BC878ce50e861540c8E977b4e45Fdc303dfF/sources/contracts/SoulSeasonTwo.sol
Toggle minting status
function setMintActive() external onlyOwner { mintActive = !mintActive; }
4,351,841
./partial_match/1/0x7d3CD037aE7efA9eBed7432c11c9DFa73519303d/sources/contracts/_external/ozproxy/ERC1967/ERC1967Upgrade.sol
Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). Emits a {BeaconUpgraded} event./
function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } }
3,609,154
pragma solidity ^0.4.18; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division o...
Burns `_amount` tokens from `_owner` _owner The address that will lose the tokens _amount The quantity of tokens to burn return True if the tokens are burned correctly
function destroyTokens(address _owner, uint _amount ) onlyController returns (bool) { uint curTotalSupply = totalSupply; require(curTotalSupply >= _amount); uint previousBalanceFrom = balanceOf(_owner); require(previousBalanceFrom >= _amount); totalSupply = curTotalSupply...
7,313,639
./full_match/1287/0x8162876a0bD2bE9d48a2023d20d5955d51eC055D/sources/contracts/PartsStore.sol
Adds a new class to the list of available classes. part The class to add. Only the contract owner can call this function. Throws an error if the number of classes is already at the maximum (255)./
function addClass(ImagePart calldata part) external onlyOwner onlyUnlocked { classes.push(part); }
7,097,285
./partial_match/8453/0xc7b006f084Ca79334DB41fE216D3195870FAc026/sources/DUCKRouter.sol
ADD LIQUIDITY create the pair if it doesn't exist yet
function _addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin ) internal virtual returns (uint amountA, uint amountB) { if (IDUCKFactory(factory).getPair(tokenA, tokenB) == address(0)) { ...
16,760,453
./partial_match/1/0x373ae78a14577682591E088F2E78EF1417612c68/sources/contracts/mock/MockUniswapV2Router02.sol
performs chained getAmountIn calculations on any number of pairs
function getAmountsIn( address factory, uint amountOut, address[] memory path ) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'MockUniswapV2Router02UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; fo...
4,169,202
./partial_match/1/0x927841445339777b644A26B75899F103C93FbBD7/sources/Staking.sol
Returns the sPLAY index, which tracks rebase growth return index_ Index of sPLAY
function index() public view returns (uint256 index_) { return sPLAY.index(); }
4,444,408
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "hardhat/console.sol"; import "./interfaces/IERC998TopDown.sol"; import "./interfaces/IERC998TopDownEnumerable.sol"; import "@openzeppelin/contracts/interfaces/IERC721Receiver.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzep...
returns the owner at the top of the tree of composables Use Cases handled: Case 1: Token owner is this contract and token. Case 2: Token owner is other top-down composable Case 3: Token owner is other contract Case 4: Token owner is user Case 1: Token owner is this contract and token. Case 2: Token owner is other top-d...
function rootOwnerOfChild(address _childContract, uint256 _childTokenId) public view override returns (bytes32 rootOwner) { address rootOwnerAddress; if (_childContract != address(0)) { (rootOwnerAddress, _childTokenId) = _ownerOfChild( ...
12,980,435
pragma solidity ^0.4.24; /* * @title: VTRegistry Operator * Registry Operators management * Created on 2018-04-26, by Blockchain Labs, NZ */ import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; contract Attribute is Ownable { /* * @dev: attributes used by registry (in records). * @dev: Array ...
: attributes used by registry (in records). : Array of attributes is needed to iterate through them, and mapping is used to : decrease the gas of checking whether the new attribute is need to be added to array or not./ : 'Attribute' mapping is used to keep information about available attributes/ : check if attribute ...
function attributeExists(bytes32 _attribute) public view returns(bool) { return(attribute[_attribute]); }
5,498,506
./full_match/1/0xD045120193Df76261F5E10d5b0729a6e9137a426/sources/lion.sol
once enabled, can never be turned off
function enableTrading(bool _status, uint256 _deadBlocks) external onlyOwner { require(!tradingActive, "DEXLIONS: trading is already active"); require(_deadBlocks <= 5, "DEXLIONS: deadblocks amount exceeds 5"); tradingActive = _status; swapEnabled = true; if (tradingActive &...
8,395,151
// File: @openzeppelin/upgrades/contracts/Initializable.sol pragma solidity >=0.4.24 <0.6.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Cancels the stream and transfers the tokens back on a pro rata basis. The stream and compounding stream vars objects get deleted to save gas and optimise contract storage. Throws if there is a token transfer failure./
function cancelStreamInternal(uint256 streamId) internal { Types.Stream memory stream = streams[streamId]; uint256 senderBalance = balanceOf(streamId, stream.sender); uint256 recipientBalance = balanceOf(streamId, stream.recipient); delete streams[streamId]; IERC20 token = ...
5,427,281
./full_match/43114/0x697fc3000F2C286634D8f5468da728db9e183BF4/sources/contracts/Swapper.sol
get asset Price from Dex (Price for 1 wei) 10 ^ 36
function getTokenPrice(address asset) public view returns(uint256, uint256) { if(stableToken == address(0x0)) { return (0, 0); } uint256 stableDecimal = IERC20Minimal(stableToken).decimals(); if(asset == stableToken) { return (10 ** (36 - stableDecimal), stableDecimal); } address...
4,532,831
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOG714(address p0, address p1, bool p2, string memory p3) internal view {
14,087,976
pragma solidity ^0.5.15; interface IERC20 { function TOTALSUPPLY265() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF676(address account) external view returns (uint256); //inject NONSTANDARD NAMING function ...
inject NONSTANDARD NAMING
function APPROVE401(address spender, uint256 amount) external returns (bool);
12,634,594
pragma solidity ^0.5.0; contract Charity { enum CharityStatus {UNVERIFIED, VERIFIED, REJECTED} enum CampaignStatus {ONGOING, ENDED} struct charity { address charityOwner; string charityName; string charityAddress; string contactNumber; string description; s...
This will be the function that charities call to create a campaign. Parameters of this function will include string campaignName, string description, string pictureURL, uint targetDonation (of the campaign), uint startDate (of the campaign), uint endDate (of the campaign)/
function createCampaign( string memory campaignName, string memory description, string memory pictureURL, uint256 targetDonation, uint256 startDate, uint256 endDate ) public onlyVerifiedCharity(msg.sender) returns (uint256 campaignId) ...
6,449,569
./partial_match/3/0xf86a5BF508D8312bcD8FE515a00808BC37b82CE5/sources/TestToken.sol
Tranfer tokens from sender to this contractERC20(Sedo).transferFrom(msg.sender, SedoX, SedoAmount); Calculate sedox to transfer by the swapRatio;uint256 fee = SedoAmount / 100; Transfer amount minus fees to sender
function Swap(uint256 SedoAmount) public{ address Sedo = parentAddress; address SedoX = address(this); ERC20(Sedo).transfer(SedoX, SedoAmount); uint256 SedoxAmmount = SedoAmount / defaultSwapRatio; ERC20(SedoX).transfer(msg.sender, SedoxAmmount); }
5,102,874
// SPDX-License-Identifier: Apache-2.0 pragma solidity =0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import '....
Initialises the Sushiswap Exchanger contract. Most of the initialisation is done as part of the `FeeExchanger` initialisation. This method sets the internal sushiswap router address. This method also initialises the router path. routerAddress The address of the sushiswap router. inputToken The token which the prot...
function initialize(IUniswapV2Router02 routerAddress, IERC20Upgradeable inputToken, IERC20Upgradeable outputToken, address outputAddress) public initializer { FeeExchanger.__FeeExchanger_init(inputToken, outputToken, outputAddress); _sushiswapRouter = routerAddress; _path = new address[](2...
7,302,026
./partial_match/1/0x56EAb4C7dC3bf7C31aa87d5Ed4Eb853A9872aBcf/sources/contracts/slopes/Slopes.sol
external function to claim all rewards
function claimAll() external override { _claimAll(msg.sender); }
4,052,659
./full_match/1/0x63faF7BB2e6FC14619441cc9bA64c4EAf54A60ac/sources/contracts/PowerFarms/wstETHPowerFarm/wstETHFarm.sol
Internal function combining the core logic for {closingPosition()}. Note: {_minOutAmount} passed through UI by querring {get_dy()} from curve pool contract./
function _closingPosition( uint256 _nftId, uint256 _minOutAmount, bool _ethBack ) internal { uint256 borrowShares = _getPositionBorrowShares( _nftId ); uint256 lendingShares = _getPositionLendingShares( _nftId ); ...
4,948,481
// File @openzeppelin/contracts/math/Math.sol@v2.5.1 pragma solidity ^0.5.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return ...
Get the reward, sell it in exchange for underlying, invest what you got. It's not much, but it's honest work. Note that although `onlyNotPausedInvesting` is not added here, calling `investAllUnderlying()` affectively blocks the usage of `doHardWork` when the investing is being paused by governance./
function doHardWork() external onlyNotPausedInvesting restricted { rewardPool.claimReward(poolId); _liquidateReward(); investAllUnderlying(); }
169,438
// SPDX-License-Identifier: Unlicense pragma solidity ^0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interfaces/IMillionPieces.sol"; import "./interfaces/IAuction.sol"; import "./helpers/ProxyRegistry.sol"; /** * @title Auction */ contra...
IMillionPieces/
interface IMillionPieces { function mintTo(address to, uint256 tokenId) external; function mintToSpecial(address to, uint256 tokenId) external; function createArtwork(string calldata name) external; function setTokenURI(uint256 tokenId, string calldata uri) external; function setBaseURI(string calld...
1,649,384
// 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...
/ _makePayable/ Internal function to set a bid. _address non-payable address return payable address/
function _makePayable(address _address) internal pure returns (address payable) { return address(uint160(_address)); }
1,455,531
./full_match/4/0xC6916b8BA3FAfD849bb8066d56E767815f587C56/sources/Users/scottferreira/Desktop/DevSAF/Companies/cmdR/cmdR_Consulting/Clients/Polyient/Subsidiaries/Polyient_Gaming/Development/particle-bridge/xgp5-testing/contracts/ParticleBridge.sol
All generations are the same for now
function getTokenGeneration(uint256) public pure returns (uint256) { return 0; }
12,315,578
pragma solidity ^0.4.19; contract FrikandelToken { address public contractOwner = msg.sender; //King Frikandel bool public ICOEnabled = true; //Enable selling new Frikandellen bool public Killable = true; //Enabled when the contract can commit suicide (In case of a problem with the contract in its e...
Useful if someone allowed you to spend some of their frikandellen or if a smart contract needs to interact with it! :)
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
905,686
./full_match/97/0xccb4651211dE317551C38ED499c4e09d56F604dc/sources/project_/contracts/Libraries/LibMarket.sol
address payable receiver = royalties[i].account; address payable receiver = royalties[i].account;
function executeBid( piMarket.TokenMeta storage meta, piMarket.BidOrder storage bids, LibShare.Share[] memory royalties, LibShare.Share[] memory validatorRoyalties, address feeAddress ) external { require(msg.sender == meta.currentOwner); require(!bids.wit...
3,276,809
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than re...
Converts to absolute value, and fails on overflow./
function abs(int256 a) internal pure returns (int256) { require(a != MIN_INT256); return a < 0 ? -a : a; }
131,743
./partial_match/56/0x0aa63FB3A93110ff1C57dBaCF13E69b641352F80/sources/StrategymeowthLPV2.sol
Swaps {meowth} for {lpToken0}, {lpToken1} & {wbnb} using PancakeSwap./
function addLiquidity() internal { uint256 meowthHalf = IERC20(meowth).balanceOf(address(this)).div(2); if (lpToken0 != meowth) { IPancakeRouter(unirouter) .swapExactTokensForTokensSupportingFeeOnTransferTokens( meowthHalf, 0, ...
11,225,312
/** *Submitted for verification at Etherscan.io on 2021-11-13 */ // SPDX-License-Identifier: MIT pragma solidity ^0.7.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, ...
Set the flag to enable/disable the Whitelist sale./
function setWhitelistSaleActive(bool _active) public onlyOwner { whitelist_sale_active = _active; }
10,697,533
//Address: 0x89fd8971fef41923ee6f1416c1fbaf5fe6698eea //Contract name: PlatoPresale //Balance: 0 Ether //Verification Date: 9/15/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.13; contract token { function transfer(address receiver, uint amount); function balanceOf(address _owner) const...
data structure to hold information about campaign contributors / at initialization, setup the owner /
function PlatoPresale() { beneficiary = msg.sender; min_fundingGoal = 100 * 1 ether; max_fundingGoal = 2000 * 1 ether; start = now + 10 * 1 hours; deadline = start + 30 * 1 days; tokenReward = token(0x432fFe79337cBaA1B921c7d0802e4ADe89F474E5); }
15,863,726
pragma solidity ^0.4.25; /** * 12HourTrains - 3% every 12 hours. Want to get quick ETH? Try our new Dice game. https://12hourtrains.github.io/ Version 3 */ contract TwelveHourTrains { using SafeMath for uint256; mapping(address => uint256) investments; mapping(address => uint256) joined; mapping(addr...
Allows current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to. newOwnerWallet The address to transfer ownership to./
function transferOwnership(address newOwner, address newOwnerWallet) public onlyOwner { require(newOwner != address(0)); owner = newOwner; ownerWallet = newOwnerWallet; emit OwnershipTransferred(owner, newOwner); }
9,916,901
./partial_match/1/0x8189B58a9debA68B2753c66e383afAf33759C145/sources/GCCDiscrete.sol
Owner's method to manually tick next checkpoint./
function tickNext() public onlyOwner returns (bool) { return _tickNext(); }
4,095,063
// simple faucet // // @authors: // Cody Burns <dontpanic@codywburns.com> // license: Apache 2.0 // version: 0.3.0 pragma solidity ^0.4.19; contract owned{ function owned () public { owner = msg.sender; } address owner; modifier onlyOwner { require(msg.sender == owner); _; } } cont...
adjust PoW to target the blocktarget
function newDiff() internal returns( bool ) { parentDiff = difficulty; int foo = max( (1 - ( int(now) - int(lastDrip) ) % int(blockTarget)), -99 ); int bar = 2048 * foo; int pd = parentDiff % bar; difficulty = parentDiff + bar; lastDrip = now; NewDiff(foo, bar, pd, bytes32(difficulty)); ...
1,046,560
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; /// @title: David Ariew X Tatler China import "../ERC721ProjectUpgradeable.sol"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////...
See {IERC721ProjectCore-managerMintBatch}./
function managerMintBatch(address to, string[] calldata uris) external virtual override nonReentrant managerRequired returns (uint256[] memory tokenIds) { tokenIds = new uint256[](uris.length); for (uint256 i = 0; i < uris.length; i++) { ...
12,006,230
./full_match/80001/0x99785826d26aC5811893f14C9935c58C49C959BD/sources/project_/contracts/AccessControl.sol
check if an account is a owner
function isOwner(address account) public view returns (bool) { return _hasRole(OWNER, account); }
5,634,813
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contrac...
Utility function used to retrieve the current prize pool. return The current prize pool/
function prizePool() public returns (uint256) { uint256 depositedAmount = ticket.totalSupply(); uint256 totalAmount = _balanceOfUnderlyingCompound(address(cToken)); uint256 prize = (totalAmount < depositedAmount) ? type(uint256).min : (totalAmount - depositedAmount); return prize; }
1,784,706