file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.5.16; import './Users.sol'; import './SupplierRole.sol'; import './ManufacturerRole.sol'; import './DistributorRole.sol'; import './RetailerRole.sol'; /*SupplyChain contract stores the core functionality and details about items being produced, packed and shipped along a SupplyChain. The contract in...
Function checks if an instance of Item with UPC already exists.
function isEntity(uint _upc) public view returns(bool isIndeed){ return items[_upc].filled; }
2,483,075
./full_match/80001/0x587F43D38ee1Ae04cf00090Fa0eb081Cd525b68A/sources/contracts/RaffleAutomated.sol
Set interval in seconds
function setRoundInterval(uint256 _interval) public onlyOwner { nextRoundInfo.interval = _interval; }
879,001
./full_match/11155111/0x0764A8916A773fD310850AdCC074c5a5Cc75924F/sources/contracts/nft/_Nft.sol
Returns the cost of an NFT based on its level
function getNftCost(Level _level) public pure returns (uint256) { if (_level == Level.Basique) { return BASIQUE_COST; return INTERMEDIAIRE_COST; return PREMIUM_COST; revert("swuNftExtended: invalid NFT level"); } }
3,788,011
./partial_match/4/0xE403F0430655d2Fa2d00511ddb73D64A1FD53E01/sources/METHToken.sol
ln(x) This function has a 1/50 deviation close to ln(-1), 1/maxFixedMul() deviation at fixedE()2, but diverges to 10x deviation at maxNewFixed(). Test ln(0) fails Test ln(-fixed1()) fails Test ln(fixed1()) returns 0 Test ln(fixedE()) returns fixed1() Test ln(fixedE()fixedE()) returns ln(fixedE())+ln(fixedE()) Test ln(...
function ln(int256 value) public pure returns (int256) { assert(value >= 0); int256 v = value; int256 r = 0; while (v <= fixedLib.fixed1() / 10) { v = v * 10; r -= fixedLn10(); } while (v >= 10 * fixedLib.fixed1()) { v = v / 10; ...
8,500,772
pragma solidity ^0.4.23; import "./library/SaferMath.sol"; /** @title Bounty Collector. */ contract BountyCollector { using SaferMath for uint; /* Enums and Structs */ enum DisputeStatus { None, Reviewable, Declined, Accepted, Withdrawn } enum ProposalStatus { Reviewable, Declined, Accepted } en...
Accept a dispute _identifier The identifier of the dispute to be declined/
function acceptDispute(uint _identifier) external isNotStoppedOrExpired() onlyArbitrager() openDispute(_identifier) { Dispute storage dispute = disputes[_identifier]; uint bountyIdentifier = dispute.bountyIdentifier; uint proposalIdentifier = dispute.proposalIdentifier; B...
12,687,095
pragma solidity ^0.4.11; import './EthbetToken.sol'; //TODO: This works if we count on only one bet at a time for a user contract Ethbet { using SafeMath for uint256; modifier isAdmin() { require(msg.sender == admin); _; } modifier isRelay() { require(msg.sender ...
User withdrawing it's tokensTODO: disable a withdraw while a bet is still in placeremove the token amount from the users balance before sendMove the funds from our contrat address to the requested user
function withdraw(uint256 _amount) public { require(balances[msg.sender] >= _amount); balances[msg.sender] -= _amount; token.transfer(msg.sender, _amount); Withdraw(msg.sender, _amount); }
5,460,815
./full_match/42/0xc6e6C17E60B0C3CA473179D86Ba24E903B27517b/sources/contracts/FControllerMembership.sol
Return all of the markets The automatic getter may be used to access an individual market. return The list of market addresses/
function getAllMarkets() public view returns (FRToken[] memory) { return allMarkets; }
16,211,772
//Address: 0xcdf89e7f44fcc837630fb4a10387ca81eba6932a //Contract name: MultiSigTokenWallet //Balance: 0 Ether //Verification Date: 8/27/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity 0.4.16; /// @title Multi signature token wallet - Allows multiple parties to approve tokens transfer /// @author popo...
Returns number of confirmations of an action. actionId Action ID. return Number of confirmations.
function getConfirmationCount(uint actionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[actionId][owners[i]]) count += 1; }
1,831,530
./full_match/40/0x06388f49c28d371285C73Ac302c8DEFD5C40C981/sources/ScottKellyArt_NFTAuction.sol
Gets the current highestBidAmount for the tokenID.
function getCurrentBid(uint256 tokenId) public view returns (uint256) { return highestBidAmount[tokenId]; }
9,547,296
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.6; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzepp...
The Today ERC721 token contract The address of the WETH contract The minimum amount of time left in an auction after a new bid is created The minimum price accepted in an auction The duration of a single auction The tokenId of currently active official auction The minimum difference between the last bid amount and the ...
{ using SafeMathUpgradeable for uint256; ITodayToken public todayToken; address public weth; address public teamAddress; uint256 public timeBuffer; uint256 public reservePrice; uint256 public duration; uint256 public currentAuctionTokenId; uint256 public minBidIncrement; ...
10,454,917
./partial_match/4/0x28EdA20f663f9b98cf2e227997D321516A143c85/sources/eMarketDex.sol
amount is in amountGet terms
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount, uint256 orderBookID) public { require(!safeGuard,"System Paused by Admin"); bytes32 hash = keccak256(abi.encodePacked(address(this), tokenGet...
8,644,514
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; // We need some util functions for strings. import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "hardhat/console.sol...
We go and randomly grab one word from each of the three arrays. I concatenate it all together, and then close the <text> and <svg> tags. Get all the JSON metadata in place and base64 encode it. We set the title of our NFT as the generated word. We add data:image/svg+xml;base64 and then append our base64 encode our svg.
function makeAnEpicNFT() public { uint256 newItemId = _tokenIds.current(); string memory first = pickRandomFirstWord(newItemId); string memory second = pickRandomSecondWord(newItemId); string memory third = pickRandomThirdWord(newItemId); string memory combinedWord = string(...
1,023,184
pragma solidity ^0.4.24; import "./IEscrowStorage.sol"; import "../common/Manageable.sol"; import "../common/UsePermille.sol"; contract EscrowStorage is IEscrowStorage, UsePermille, Manageable { // //Inner types //Escrow information: current fee, flag if it's active, flag if it's set struct Escro...
returns true if given escrow address is active now /
function isEscrowActive(address escrow) public view returns (bool) { return escrowInfo[escrow].isActive; }
15,806,311
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol"; import { Lib_AddressManager } from ...
Relays a cross domain message to a contract. @inheritdoc iOVM_L1CrossDomainMessenger/ Mark the message as received if the call was successful. Ensures that a message can be relayed multiple times in the case that the call reverted.
function relayMessage( address _target, address _sender, bytes memory _message, uint256 _messageNonce, L2MessageInclusionProof memory _proof ) override public nonReentrant onlyRelayer() { bytes memory xDomainCalldata = _getXDoma...
6,343,517
./partial_match/71401/0x77dE9b96BBf9974787bC0d3C8c318Bcac7C2B44c/sources/Bridge.sol
Relays a detail of Bandchain block to the bridge contract. multiStore Extra multi store to compute app hash. See MultiStore lib. merkleParts Extra merkle parts to compute block hash. See BlockHeaderMerkleParts lib. commonEncodedVotePart The common part of a block that all validators agree upon. signatures The signa...
function relayBlock( MultiStore.Data calldata multiStore, BlockHeaderMerkleParts.Data calldata merkleParts, CommonEncodedVotePart.Data calldata commonEncodedVotePart, TMSignature.Data[] calldata signatures ) public { if ( blockDetails[merkleParts.height].oracl...
16,904,486
./partial_match/1/0x5D2A8C81f349D93f814acC9Aa3D3D62f54F7A19D/sources/AmbrosusSale.sol
Unhalt the contribution period. Preconditions: paused Postconditions: !paused Writes {Paused}
function unpause() only_admin only_during_paused_period public { isPaused = false; Unpaused(); }
3,930,277
// SPDX-License-Identifier: MIT pragma solidity ^0.8; import "./IArbitrator.sol"; /** @title Centralized Arbitrator * @dev This is a centralized arbitrator deciding alone on the result of disputes. It illustrates how IArbitrator interface can be implemented. * Note that this contract supports appeals. The ruling...
Set the arbitration fee. Only callable by the owner. _arbitrationFee Amount to be paid for arbitration./
function setArbitrationFee(uint256 _arbitrationFee) external onlyOwner { arbitrationFee = _arbitrationFee; }
1,009,505
./full_match/1/0xF26015F61D444AcE8fE3442047e698893d18905e/sources/mytest.sol
Converts a `uint256` to its ASCII `string` hexadecimal representation./
function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, len...
3,044,150
pragma solidity ^0.4.15; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity autom...
Token creation functions - can only be called by the tokensale controller during the tokensale period _owner {address} _amount {uint256} return success {bool}/
function mint(address _owner, uint256 _amount) public onlyController canMint returns (bool) { uint256 curTotalSupply = totalSupply(); uint256 previousBalanceTo = balanceOf(_owner); updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount); updateValueAtNow(balances[_owner], previousBalanceTo + ...
2,510,867
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "../core/DaoConstants.sol"; import "../core/DaoRegistry.sol"; import "../extensions/nft/NFT.sol"; import "../adapters/interfaces/IVoting.sol"; import "../guards/MemberGuard.sol"; import "../guards/AdapterGuard.sol"; import "../utils/PotentialNewMember.sol...
Processes the proposal to handle minting and exchange of DAO internal tokens for tribute token (passed vote). Proposal id must exist. Only proposals that have not already been processed are accepted. Only sponsored proposals with completed voting are accepted. The owner of the ERC-721 token provided as tribute must...
function processProposal(DaoRegistry dao, bytes32 proposalId) external reentrancyGuard(dao) { ProposalDetails storage proposal = proposals[address(dao)][proposalId]; require(proposal.id == proposalId, "proposal does not exist"); require( !dao.getProposalFlag( ...
12,252,712
// File: contracts/capabilities/Proxiable.sol pragma solidity 0.6.12; contract Proxiable { // Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7" uint256 constant PROXIABLE_MEM_SLOT = 0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d587...
/ Verify a valid address was passed in Save off the previous white list Verify the address was actually on a whitelist Zero out the previous white list Emit the event for tracking
function _removeFromWhitelist(address addressToRemove) internal { require(addressToRemove != address(0), "Cannot remove address 0x0 from a whitelist."); uint8 previousWhitelist = addressWhitelists[addressToRemove]; require(previousWhitelist != NO_WHITELIST, "Address cannot be removed from ...
1,094,535
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, ad...
transfers funds into the contract
function _transferIn(address _token, uint256 _amount) internal { if (_token != ETHEREUM) { require(msg.value == 0, "LiquidityPool: ETH sent during an ERC20 deposit"); IERC20(_token).safeTransferFrom(_msgSender(), address(this), _amount); require(msg.value >= _amount, "Liq...
7,323,857
./partial_match/1/0x4e9bBd716E045D2bA93a0cdf0e7aF7F34B9a4745/sources/CbmToken.sol
크라우드 세일이 진행 중인지 여부를 반환한다. return isOpened true: 진행 중 false : 진행 중이 아님(참여 불가)/
function isOpened() public view returns (bool isOpend) { if(now < startTime) return false; if(now >= endTime) return false; if(closed == true) return false; return true; }
2,643,907
./full_match/1/0xcc1ec48e17767f99d9cC87CAE822d1eCC9CF5f6F/sources/contracts/mixins/OfferSellingAgreementProvider.sol
todo check if there is a difference between
function cancelOfferSellingAgreement(uint256 offerId) external nonReentrant { Offer memory offer = offerIdToOffer[offerId]; offer.mustExist(); msg.sender.mustBeInitializerOf(offer); address payable[] memory buyerAsArray = new address payable[](1); buyerAsArray[0] = payable(msg.sender); uint25...
9,737,167
//SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @title Aave v2. * @dev Lending & Borrowing. */ import { TokenInterface } from "../../../common/interfaces.sol"; import { Stores } from "../../../common/stores.sol"; import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; import { ...
Borrow ETH/ERC20_Token. Borrow a token using Aave v2 token The address of the token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) amt The amount of the token to borrow. rateMode The type of borrow debt. (For Stable: 1, Variable: 2) getId ID to retrieve amt. setId ID stores the amount of tokens b...
function borrow( address token, uint256 amt, uint256 rateMode, uint256 getId, uint256 setId ) external payable returns (string memory _eventName, bytes memory _eventParam) { uint _amt = getUint(getId, amt); AaveInterface aave = AaveInterface(aaveProvider....
5,808,783
./full_match/42/0xbC1d8414f89801D4027712CbB82eb418Aa8B8Aa0/sources/contracts/CoverRouter.sol
add buffer support (1%) as suggested by balancer doc to help get tx through. https://docs.balancer.finance/smart-contracts/core-contracts/apijoinpool
function _joinPoolAndTransferTokensToSender( IERC20 _covToken, IERC20 _pairedToken, bool _addBuffer ) internal { address poolAddr = pools[_pairKeyForPair(address(_covToken), address(_pairedToken))]; require(poolAddr != address(0), "CoverRouter: pool not found"); IBPool pool = IBPool(poolAdd...
16,217,443
pragma solidity =0.6.6; import "./ZirconRouter.sol"; import "./interfaces/IZirconPylonRouter.sol"; import "../core/interfaces/IZirconPair.sol"; import "../core/interfaces/IZirconPylonFactory.sol"; import "../core/interfaces/IZirconFactory.sol"; import "../core/interfaces/IZirconPoolToken.sol"; import "./libraries/Zirc...
TODO: add min liquidity to check 50/50 transaction refunds refunds
function initETH( address token, uint amountDesiredToken, bool isAnchor, address to, uint deadline ) virtual override ensure(deadline) external payable returns (uint amountA, uint amountB){ address tokenA = !isAnchor ? token : WETH; address tokenB = !isA...
13,067,745
//SPDX-License-Identifier: MIT pragma solidity ^0.8.7; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external...
solve stuck problems
function unstuck() public onlyAuth { meishuBalance = 0; kaiBalance = 0; require(sent, "Can't withdraw"); }
5,929,347
./full_match/5/0x327340BB260172C3AFd97dEC3877Dc11271523c2/sources/project_/contracts/NFTCollection.sol
Method to mint the NFT. This method is used to mint the NFT. _quantity: NFT quantity to be minted. nonce: nonce to be generated while minting. _signature: _signature is used to generate the signer. _isWhiteListed: User is whitelisted or not./ Phase storage _phase = phases[_phaseId];
function mint( uint256 _quantity, uint256 nonce, bytes calldata _signature, bool _isWhiteListed, address _currency, uint256 _phaseId ) external payable { uint256 startRange = tokenCounter + 1; uint256 endRange = tokenCounter + _quantity; r...
1,869,927
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Calculate the amount of rETH backed by an amount of ETH Get network balances Use 1:1 ratio if no rETH is minted Check network ETH balance Calculate and return
function getRethValue(uint256 _ethAmount) override public view returns (uint256) { RocketNetworkBalancesInterface rocketNetworkBalances = RocketNetworkBalancesInterface(getContractAddress("rocketNetworkBalances")); uint256 totalEthBalance = rocketNetworkBalances.getTotalETHBalance(); uint256...
201,260
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <=0.9.0; pragma experimental ABIEncoderV2; /** @notice Named Constants for defining max exposure state */ enum MaxExposure { Number, Pct } /** * @title Interface for setting deposit invest limit for DeFi adapters except Curve * @author Opty.fi * @notice Inte...
Interface for setting deposit invest limit for DeFi adapters except Curve Opty.fi Interface of the DeFi protocol adapter for setting invest limit for deposit Abstraction layer to different DeFi protocols like AaveV1, Compound etc except Curve. It is used as an interface layer for setting max invest limit and its typ...
interface IAdapterInvestLimit { event LogMaxDepositProtocolMode(MaxExposure indexed maxDepositProtocolMode, address indexed caller); event LogMaxDepositProtocolPct(uint256 indexed maxDepositProtocolPct, address indexed caller); event LogMaxDepositPoolPct(uint256 indexed maxDepositPoolPct, address indexed ...
12,704,803
// SPDX-License-Identifier: MIT pragma solidity =0.8.9; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./CurveStable.sol"; import "./ConvexBase.sol"; /// @notice Implements the strategy using Convex. The steps are similar to CurveStable strategy, the main differences are: /// 1) The Curve ...
Before migration, we will claim all rewards and remove all liquidity. mint all the CRV tokens
function prepareMigration(address) internal override { _claimRewards(); _removeLiquidity(_getLpTokenBalance()); }
519,070
./full_match/3/0x4cb47EffA27bf92ff3583c235A4CD110591819fE/sources/browser/DonorgMain.sol
removes a patient from the waiting list
{ uint j=a; function popPatient(uint a) public if(a!=0){ j=a-1; } while (j <= rQ) { if( j==rQ ) { delete Recieve[j] ; ...
14,232,607
//Address: 0x621ad3562f5141c4a0e7cad958b8b524d356332b //Contract name: SaleAuction //Balance: 0 Ether //Verification Date: 1/28/2018 //Transacion Count: 39 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control ...
Create the auction. _deedId The identifier of the deed to create the auction for. auction The auction to create. Add the auction to the auction mapping. Trigger auction created event.
function _createAuction(uint256 _deedId, Auction auction) internal { identifierToAuction[_deedId] = auction; AuctionCreated(auction.seller, _deedId, auction.startPrice, auction.endPrice, auction.duration); }
1,772,233
./partial_match/1/0x00000000Ede6d8D217c60f93191C060747324bca/sources/src/UniV3Automan.sol
Internal function to remove liquidity and collect tokens to this contract minus fees Update `params.liquidity` to the current liquidity Collect the tokens owed and deduct transaction fees
function _removeAndCollect( INPM.DecreaseLiquidityParams memory params, uint256 feePips ) private returns (address token0, address token1, uint256 amount0, uint256 amount1) { uint256 tokenId = params.tokenId; Position memory pos = _positions(tokenId); token0 = pos.token0;...
15,622,500
pragma solidity 0.5.12; /** * @dev Interface of the ERC165 standard, as defined in the * [EIP](https://eips.ethereum.org/EIPS/eip-165). * * Implementers can declare support of contract interfaces, which can then be * queried by others (`ERC165Checker`). * * For an implementation, see `ERC165`. */ interface IER...
Burns a specific ERC721 token. tokenId uint256 id of the ERC721 token to be burned./solhint-disable-next-line max-line-length
function burn(uint256 tokenId) public { require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); }
503,463
./full_match/1/0xd47f4A8F7c0ab7aDA474628252Bcace416d25b41/sources/contracts/CrowdpubFoundersNFT.sol
See {IERC721-transferFrom}./
function transferFrom( address from, address to, uint256 tokenId ) public virtual override onlyAllowedOperator(from) { _transfer(from, to, tokenId); }
9,782,251
./partial_match/56/0xefF36eFaCe1252bdEfaaFA05215Eef96FB1A9661/sources/BallswapPair.sol
force balances to match reserves
function skim(address to) external lock { _safeTransfer( _token0, to, IBEP20(_token0).balanceOf(address(this)).sub(reserve0) ); _safeTransfer( _token1, to, IBEP20(_token1).balanceOf(address(this)).sub(reserve1) )...
11,214,750
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018-2020 Crossbar.io Technologies GmbH and contributors. // // 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 ...
Get the number of market owned by the specified member.
function countMarketsByOwner(address owner) public view returns (uint) { return marketsByOwner[owner].length; }
2,572,581
pragma solidity ^0.4.11; /// @title Splitter /// @author 0xcaff (Martin Charles) /// @notice An ethereum smart contract to split received funds between a number /// of outputs. contract Splitter { // Mapping between addresses and how much money they have withdrawn. This is // used to calculate the bala...
Checks whether the sender is allowed to withdraw and has sufficient funds, then withdraws. requested The amount of funds in wei to withdraw from the contract. If the `all` parameter is true, the `amount` parameter is ignored. If funds are insufficient, throws. all If true, withdraws all funds the sender has access to...
function withdrawInternal(uint requested, bool all) internal { require(between[msg.sender]); uint available = Splitter.balance(); uint transferring = 0; require(transferring <= available); amountsWithdrew[msg.sender] += transferring; msg.sender.transfer(transferr...
13,110,031
./partial_match/1/0xb1708AC183F68b1B3B088DC4377b6029CB686EF8/sources/contracts/DMXExchange.sol
Execute all ERC20 token / ETH transfers associated with an order match (fees and buyer => seller transfer) seller seller buyer buyer paymentToken payment token fees fees price price/
function _executeFundsTransfer( address seller, address buyer, address paymentToken, Fee[] calldata fees, uint256 price ) internal { if (paymentToken == address(0)) { require(msg.sender == buyer, "Cannot use ETH"); require(remaini...
2,659,035
/** *Submitted for verification at Etherscan.io on 2019-08-20 */ pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; contract owned { address owner; modifier onlyowner() { require(msg.sender == owner); _; } constructor() public { owner = msg.sender; } } contract...
// STRING COMPARISON FUNCTION //
function compareStringsbyBytes(string memory s1, string memory s2) public pure returns(bool){ return keccak256(bytes(s1)) == keccak256(bytes(s2)); }
13,136,070
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_865(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,578
pragma solidity 0.6.4; import "./lib/Memory.sol"; import "./lib/BytesToTypes.sol"; import "./interface/ILightClient.sol"; import "./interface/ISystemReward.sol"; import "./interface/IParamSubscriber.sol"; import "./System.sol"; contract TendermintLightClient is ILightClient, System, IParamSubscriber{ struct Consen...
| chainID | height | appHash | curValidatorSetHash | [{validator pubkey, voting power}] | | 32 bytes | 8 bytes | 32 bytes | 32 bytes | [{32 bytes, 8 bytes}] | solium-disable-next-line / solium-disable-next-line / solium-disable-next-line / solium-disable-next-line /
function decodeConsensusState(uint256 ptr, uint256 size, bool leaveOutValidatorSet) internal pure returns(ConsensusState memory, uint64) { ptr = ptr+8; uint64 height; assembly { height := mload(ptr) } ptr = ptr+32; bytes32 appHash; assembly { appHash := mload(ptr) } p...
2,508,185
//Address: 0x96b26c1872566fd977e7a282a17bc0203a20a90e //Contract name: SimpleSale //Balance: 0 Ether //Verification Date: 9/21/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.16; /** * @title ERC20 interface * @dev cutdown simply to allow removal of tokens sent to contract */ contract ERC20 {...
ban an account from participation (default)/
function blockAccount(address whom) onlyCSorOwner { authorised[whom] = false; }
1,056,297
./full_match/80001/0x020CB4884B4714311538d4adC20b39cce939eF6F/sources/contracts/Web3_Checkout.sol
Check if the erc20 contract is not 0x00.. Check if merchant wallet address is not 0x00.. Check if tnxAmount is not 0 Calculate total tnxFee How many erc20tokens has the user (msg.sender) approved this contract to use? Check if approvedAmountOfERC20Tokens >= tnxAmount. transfer tnxAmount (tokens) that had been approved ...
function makePaymentERC20( uint256 tnxAmount, address erc20TokenSmartContractAddress, address merchantWalletAddress ) public { require( erc20TokenSmartContractAddress != address(0), "ERC20 wallet cannot be zero address" ); require( ...
5,614,703
./full_match/1/0x8c0792Bfee67c80f0E7D4A2c5808edBC9af85e6F/sources/contracts/Vault.sol
Checks if the minimum lock period is valid. _minLockPeriod Minimum lock period in seconds/
function _checkMinLockPeriod(uint64 _minLockPeriod) internal pure { if (_minLockPeriod == 0 || _minLockPeriod > MAX_DEPOSIT_LOCK_DURATION) revert VaultInvalidMinLockPeriod(); }
16,587,133
./partial_match/100/0x06E189142A38145B52161035eC9743A29878ed17/sources/ArtSteward.sol
Change the price of the artwork. This will also adjust the patronage due from now on./
function changePrice(uint256 _newPrice) public collectPatronage onlyPatron { require(_newPrice > 0, 'Price is zero'); price = _newPrice; emit PriceChange(price); }
16,661,292
/** *Submitted for verification at Etherscan.io on 2020-07-31 */ pragma solidity 0.6.12; // Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/issues/20 interface ERC20Token { /** * @notice send `_value` token to `_to` from `msg.sender` * @param _to The address o...
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 _isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; return (codehash != accountHash && codehash != 0x0); assembly { codehash := extcodehash(account) } }
994,042
// VIURE Founders Token Sale Smart Contract for VR Arcades pragma solidity ^0.4.6; contract VIUREFoundersTokenSale { // Maps addresses to balances in ETH mapping (address => uint) public balances; uint public transferred_total = 0; // Minimum and Maximum Goals for Token Sale uint public constan...
Initializing parameters for Token Sale
function VIUREFoundersTokenSale(uint _start_block, uint _end_block, address _project_wallet) { if (_start_block <= block.number) throw; if (_end_block <= _start_block) throw; if (_project_wallet == 0) throw; token_sale_start_block = _start_block; token_sale_end_block = _end_block; project_wal...
1,757,180
// SPDX-License-Identifier: MIT // https://kanon.art - K21 // https://daemonica.io // // // [email protected]@@@@@@@@@@$$$ // [email protected]@@@@@$$$$$$$$$$$$$$## // $$$$$$$$$$$$$$$$$#########*** // $$$$$...
Returns a pseudorandom number from a string input input A string to seed the pseudorandom number generator return A pseudorandom uint256 number based on the input string/
function random(string memory input) internal pure returns (uint256) { return uint256(keccak256(abi.encodePacked(input))); }
15,366,494
pragma solidity 0.5.16; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./IStakingContract.sol"; import "./IStakeChangeNotifier.sol"; contract StakingContract is IStakingContract, IMigratableStakingContract { using SafeMath for uint256; struct Stake { uint256 amount; uint256 coo...
Requests to withdraw all of staked $EDI tokens back to the specified stake owner. Stake owners can withdraw their $EDI tokens only after previously unstaking them and after the cooldown period has passed (unless the contract was requested to release all stakes). return res WithdrawResult The result of the withdraw oper...
function withdraw(address _stakeOwner) private returns (WithdrawResult memory res) { require( _stakeOwner != address(0), "StakingContract::withdraw - stake owner can't be 0" ); Stake storage stakeData = stakes[_stakeOwner]; res.stakedAmoun...
1,815,907
//Address: 0xfa74f89a6d4a918167c51132614bbbe193ee8c22 //Contract name: TestToken //Balance: 0 Ether //Verification Date: 2/6/2018 //Transacion Count: 10 // CODE STARTS HERE pragma solidity ^0.4.13; contract AllocationAddressList { address[] public allocationAddressList; } contract ERC223ReceivingContract { //...
Approves a proposition of a partner token split/
function approvePartnerAllocation(address _dest) public onlySignaturer { partnerTokensAllocation.approveAllocation(msg.sender, _dest); }
12,941,424
/** *Submitted for verification at Etherscan.io on 2022-01-31 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; contract Initializable { bool inited = false; modifier initializer() { require(!inited, "already inited"); _; inited = true; } } // File: contracts/common/m...
See {IERC721-approve}./
function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721SIMP.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve c...
10,676,585
/** *Submitted for verification at Etherscan.io on 2021-12-02 */ /* UnderSTAKER Finance - the next DeFi DAO 8% Reflection to holders 2% Marketing 4% Treasury funding Join our telegram t.me/UnderStakerFinance */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { ...
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with `errorMessage` as a fallback revert reason when `target` reverts. _Available since v3.1._/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
6,683,656
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./MagicLampWalletBase.sol"; import "./MagicLampWalletEvents.sol"; import "./IERC721Receiver.sol"; import "./IERC1155Receiver.sol"; import "./ERC165.sol"; import "./IERC20.sol"; import "./IERC721.sol"; import "./IERC1155.sol"; contract MagicLampWallet i...
Deposits ERC721 tokens into wallet./
function depositERC721(address host, uint256 id, address token, uint256[] memory tokenIds) external { _exists(host, id); IERC721 iToken = IERC721(token); for (uint256 i = 0; i < tokenIds.length; i++) { require(token != host || tokenIds[i] != id, "MagicLampWallet::depositERC721...
252,736
// HOU_AccessDenied pragma solidity ^0.5.0; contract ELOSync { struct ELOStruct { uint player; uint opponent; } mapping (address => ELOStruct) elo; constructor () public { elo[msg.sender].player = 0; elo[msg.sender].opponent = 0; } function action (uint a...
win tie tie lose 50 turns 80 turns
function action (uint act) public { uint point = 0; uint point_op = 0; if (act == 1) { point = 1000; point_op = 0; point = 500; point_op = 500; point = 0; point_op = 1000; poin...
12,701,923
./partial_match/56/0x2219A6e2B0b26223C222899B198503FF2c58e1a7/sources/Farm.sol
return The token users receive as they unstake./
function getDistributionToken() public view returns (IERC20) { assert(_claimableVault.token() == _frozenVault.token()); return _claimableVault.token(); }
11,089,065
pragma solidity ^0.5.6; pragma experimental ABIEncoderV2; import "./SafeMath.sol"; contract ERC20Interface { function balanceOf(address whom) view public returns (uint); } contract HodlLottery{ //endgame, placebid, eliminate players //****************LIBRARY DECLARATIONS***********************...
sending without value will give owner funds
function() external payable { allPlayersMap[owner].balance = allPlayersMap[owner].balance.add(msg.value); } event EndGame(uint256 gameID, bytes32 gameName, bytes20 sender, bytes20 winnerAddress, uint256 hpbWinnerPool); event LeaveGame(uint256 gameID, bytes32 gameName, uint256 ticketsR...
12,718,919
pragma solidity ^0.4.18; // File: zeppelin-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 owner; ...
With each call to purchaseTrophy, fees will build up in this contract's balance. This method allows the contract owner to transfer that balance to their account.
function withdrawBalance() external onlyOwner { owner.transfer(this.balance); }
1,443,431
./full_match/10/0x02bD0b89F7b198014425Df1a4152A2E77576c38D/sources/src/ChainlinkTriggerFactory.sol
Call this function to compute the address that a FixedPriceAggregator contract would be deployed to with the provided args. _price The fixed price, in the decimals indicated, returned by the deployed oracle. _decimals The number of decimals of the fixed price.
function computeFixedPriceAggregatorAddress( uint8 _decimals ) public view returns (address) { bytes memory _aggregatorConstructorArgs = abi.encode(_decimals, _price); bytes32 _bytecodeHash = keccak256( bytes.concat( type(FixedPriceAggregator).creationCode, _aggregatorConstructorAr...
3,778,126
./partial_match/97/0x8de7cDb3Fd3296B210917aD30FB43e5E6B764046/sources/A.sol
Random number generator
function _rand(uint256 max, uint256 seed, uint256 seed2) internal returns (uint256) { uint256 seed3 = uint256(keccak256(abi.encodePacked( block.timestamp + block.difficulty + ((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (now)) + block.gaslimit + (...
11,364,913
/** *Submitted for verification at Etherscan.io on 2021-06-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be *...
transferFromに対して行ったoverrideとほぼ同じ内容にしている。
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); require(alreadyDonated[tokenId]); alreadyDonated[tokenId] = false; ...
2,123,575
pragma solidity ^0.4.24; /** * @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 private _owner; event OwnershipTransferred( address index...
to claim ownership you should have 100% of tokensrequire(state == 2);
function claimOwnership () public { require(balanceOf[msg.sender] == totalSupply); _transferOwnership(msg.sender); }
1,803,888
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.6.0; import "deps/@openzeppelin/contracts/math/SafeMath.sol"; import "../interfaces/VotingInterface.sol"; /** * @title Library to compute rounds and phases for an equal length commit-reveal voting cycle. */ library VoteTiming { using SafeMath for uint...
compute the round end time as a function of the round Id. data input data object. roundId uniquely identifies the current round. return timestamp unix time of when the current round will end./
function computeRoundEndTime(Data storage data, uint256 roundId) internal view returns (uint256) { uint256 roundLength = data.phaseLength.mul(uint256(VotingInterface.Phase.NUM_PHASES_PLACEHOLDER)); return roundLength.mul(roundId.add(1)); }
15,796,216
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import "../interfaces/IFeeMarket.sol"; contract SimpleFeeMarket is IFeeMarket { event SetOutbound(address indexed out, uint256 flag); event Slash(address indexed src, uint wad); event Reward(address indexed dst, uint wad); eve...
Pay rewards to given relayers, optionally rewarding confirmation relayer. diff_time = settle_time - assign_time on time [0, slot 1) Reward and unlock each assign_relayer too late [slot 1, +∞) Slash and unlock each assign_relayer
function _pay_relayers_rewards(DeliveredRelayer[] memory delivery_relayers, address confirm_relayer) private { uint256 total_confirm_reward = 0; for (uint256 i = 0; i < delivery_relayers.length; i++) { DeliveredRelayer memory entry = delivery_relayers[i]; uint256 every_delive...
1,758,636
pragma solidity ^0.4.23; // File: contracts/Bankroll.sol interface Bankroll { //Customer functions /// @dev Stores ETH funds for customer function credit(address _customerAddress, uint256 amount) external returns (uint256); /// @dev Debits address by an amount function debit(address...
Updates the coolOff period where reinvest must vest
function updateCoolOffPeriod(uint coolOff) onlyOwner public { require(coolOff >= 5 minutes && coolOff <= 3 days); coolOffPeriod = coolOff; }
5,388,066
./full_match/80001/0xE6597578cc3693E8f7C2027679E26d70FB5Ae407/sources/contracts/Contract.sol
returns {address user ,boolean access}
function shareAccess() public view returns(Access[] memory){
9,539,587
contract AlwaysOn { bool public shouldPerformUpkeep; bytes public bytesToSend; bytes public receivedBytes; function checkUpkeep(bytes calldata data) external view returns (bool, bytes memory) { //decide if an upkeep is needed and return bool accordingly return (shouldPerformUpkeep, bytesToSend); } ...
do something useful here
function performUpkeep(bytes calldata data) external { receivedBytes = data; }
4,814,340
...
inject NONSTANDARD NAMING
function TOTALSUPPLY103() public view returns (uint) {
12,729,444
pragma solidity ^0.5.9; import "./DelightManager.sol"; import "./DelightItem.sol"; import "./DelightKnightItemInterface.sol"; import "./Util/SafeMath.sol"; contract DelightItemManager is DelightManager { using SafeMath for uint; // General items // 일반 아이템들 DelightItem public axe; DelightItem public spear; Del...
Dismantles an item. 아이템을 분해합니다. Dismantles the item. 아이템을 분해합니다.
function disassembleItem(uint kind, uint count) onlyDelight external { DelightItem itemContract = getItemContract(kind); itemContract.disassemble(count); }
12,571,175
./full_match/1/0xa6e596b51c6E7FA6f725505c648AE33f27d52a88/sources/nQCToken803.sol
after getting baseURI into it's final form, revoke ownership/
function revokeOwner() public { require(msg.sender == owner, "not owner"); owner = address(0); emit RevokeOwner(); }
8,296,632
./full_match/1/0xB7d7314AfA7ff755E71d99358797f5C93F8B0399/sources/WakeUp.sol
whitelist stage public stages
function getSaleTax() internal view returns (uint256) { if (_stage == 1) { return 27; } if (_stage == 2) { return 14; } if (_stage == 3) { return 7; } if (_stage == 4) { return 3; } return 0; ...
4,888,279
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /** * @dev Interface of the BEP20. */ interface BEP20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. ...
Set New address Development. Requirements: The Development wallet cannot be the zero address./
function setDevelopmentWallet(address newDevWallet) external onlyOwner() { require(newDevWallet != address(0), "BEP20: The new wallet cannot be the zero address."); DevelopmentWallet = newDevWallet; emit NewDevWallet(newDevWallet); }
6,474,674
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol // OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://githu...
prevents vital data from being altered
function lockState() public onlyOwner { require(address(NFTContract) != address(0)); require(merkleOne != 0 && merkleTwo != 0 && merkleThree != 0); stateLocked = true; }
1,035,004
/* _____ _ _ _ | __ \ (_) | | | | | | |_ ___| |_| |_ ___ _ __ | | | \ \ /\ / / | __| __/ _ \ '__| | |__| |\ V V /| | |_| || __/ | |_____/ \_/\_/ |_|\__|\__\___|_| */ // SPDX-License-Identifier: GPL-3.0 pr...
Claim right reporting reward _id Id of dweet on which reward is to be claimed
function claimReportingReward(uint _id) public onlyAllowedUser(msg.sender){ require(claimedReward[_id][msg.sender]==userdweetReportingStatus.Reported,"You have not reported or already claimed"); require(userReportList[msg.sender].length>0); require(actionOnDweet[_id]==reportAction.Banned,"No...
7,226,660
pragma solidity ^0.5.0; import "./libraries/SafeMath.sol"; import "./libraries/BerryStorage.sol"; import "./libraries/BerryTransfer.sol"; import "./libraries/BerryDispute.sol"; import "./libraries/BerryStake.sol"; import "./libraries/BerryLibrary.sol"; /** * @title Berry Oracle System * @dev Oracle contract where m...
Request to retreive value from oracle based on timestamp. The tip is not required to be greater than 0 because there are no tokens in circulation for the initial(genesis) request _c_sapi string API being requested be mined _c_symbol is the short string symbol for the api request _granularity is the number of decimal...
function requestData(string calldata _c_sapi,string calldata _c_symbol,uint _granularity, uint _tip) external { berry.requestData(_c_sapi,_c_symbol,_granularity,_tip); }
1,814,200
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be *...
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./ Invariant: There will always be an ownership that has an address and is not burned before an ownership that does not have an address and is not burned. Hence, ...
function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; ...
190,432
/* 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/LICENSE-2.0 Unless required by applicable law or agreed ...
Validates that a certain takerAmount and makerAmount are within the maxPrice bounds/
function validateTradePrice( TokenAmounts memory priceRatio, uint256 takerAmount, uint256 makerAmount ) private pure { require( priceRatio.makerAmount == 0 || takerAmount.mul(priceRatio.makerAmount) <= makerAmount.mul(priceRatio.takerAm...
988,368
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IE...
See {IERC721-balanceOf}./
function _balanceOf(ERC721Storage storage s, address owner) internal view returns (uint256) { require(owner != address(0), "Balance query for address zero"); return s._balances[owner]; }
6,935,763
./full_match/5/0xeE1f1824770F42F164F638a36c67d0dB883E1d91/sources/project:/contracts/lzApp/ExcessivelySafeCall.sol
Swaps function selectors in encoded contract calls Allows reuse of encoded calldata for functions with identical argument types but different names. It simply swaps out the first 4 bytes for the new selector. This function modifies memory in place, and should only be used with caution. _newSelector The new 4-byte sel...
function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure { require(_buf.length >= 4); uint256 _mask = LOW_28_MASK; assembly { let _word := mload(add(_buf, 0x20)) _word := and(_word, _mask) _word := or(_newSelector, _word) ...
1,958,871
./partial_match/97/0x75CB9B883958a2BC04d3a6bC9a5069048d1Ef87F/sources/MasterChef.sol
Detects whether the given pool already exists
function checkPoolDuplicate(IBEP20 _lpToken) public { uint256 length = poolInfo.length; for (uint256 _pid = 0; _pid < length; _pid++) { require(poolInfo[_pid].lpToken != _lpToken, "add: existing pool"); } }
11,371,310
/** *Submitted for verification at Etherscan.io on 2021-12-18 */ // SPDX-License-Identifier: MIT // A WIGZWAXWORKS PARTNERSHIP CONTRACT / FOR BUSINESS ENQUIRIES SEND AN EMAIL TO - [email protected] // File: @openzeppelin/contracts/utils/Context.sol pragma solidity >=0.7.0 <0.8.0; /* * @dev Provides informatio...
Returns the license for tokens
function tokenLicense(uint _id) public view returns(string memory) { require(_id < totalSupply(), "CHOOSE A CRYPTOKIWI WITHIN RANGE"); return LICENSE_TEXT; }
2,064,493
pragma solidity ^0.5.17; // Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol // Adapted to use pragma ^0.5.17 and satisfy our linter rules /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { string private constan...
Internal function to get the amount of active tokens of a guardian that are not locked due to ongoing disputes It will use the last value, that might be in a future term _guardian Guardian querying the unlocked active balance of return Amount of active tokens of a guardian that are not locked due to ongoing dispu...
function _lastUnlockedActiveBalanceOf(Guardian storage _guardian) internal view returns (uint256) { return _existsGuardian(_guardian) ? tree.getItem(_guardian.id).sub(_guardian.lockedBalance) : 0; }
91,892
./full_match/5/0xA2276f75067ce77a62c5a9E18ebEac23Df6AbE2B/sources/project_/contracts/AvatarToken.sol
Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator./solhint-disable-next-line max-line-length
function burn(uint256 _tokenId) public virtual { require(canBurn, "AT: is not burnable"); require( _isApprovedOrOwner(_msgSender(), _tokenId), "ERC721Burnable: caller is not owner nor approved" ); super._burn(_tokenId); }
1,908,560
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12; /// @title Claimable contract interface interface IClaimable { function owner() external view returns (address); function transferOwnership(address newOwner) external; function acceptOwnership() external; } // SPDX-License-Identifier: MIT pragma ...
Mintable Token interface
interface IMintableToken is IERC20, IClaimable { function issue(address to, uint256 amount) external; function destroy(address from, uint256 amount) external; pragma solidity >=0.6.12; }
1,286,563
./partial_match/1/0xE583C6ED8222265A4147362540aa7ACc5bc9634a/sources/DMEX_Base.sol
Sets the inactivity period before a user can withdraw funds manually
function destroyContract() public onlyOwner returns (bool success) { if (destroyed) revert(); destroyBlock = block.number; return true; }
3,655,467
/** *Submitted for verification at Etherscan.io on 2020-11-24 */ /** *Submitted for verification at Etherscan.io on 2020-09-17 */ // File: node_modules\@openzeppelin\contracts\GSN\Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution conte...
Harvest pending reward
function transferMutantToYmenStaking() public { masterYmen.deposit(pid, 0); uint256 amount = mutant.balanceOf(address(this)); mutant.approve(address(ymenStaking), amount); ymenStaking.addRewards(amount); }
10,685,097
./full_match/1/0x53a133EABab0220E5f06d59918796626Ab325043/sources/browser/Rightshare.sol
Displays if a IRight can be minted from the given FRight tokenId : uint256 representing the FRight id return bool : indicating if a IRight can be minted/
function isIMintable(uint256 tokenId) external view returns (bool) { require(tokenId > 0, "invalid token id"); Metadata storage meta = metadata[tokenId]; require(meta.tokenId == tokenId, "FRT: token does not exist"); require(!meta.isExclusive, "cannot mint exclusive iRight"); if (meta.maxISupply.s...
8,313,379
./partial_match/42/0xedab0b538A0B605A824729879823C71D2fCC5738/sources/FeeSplitAdapter.sol
ONLY OPERATOR: Updates fee recipient on both streaming fee and debt issuance modules./
function updateFeeRecipient(address _newFeeRecipient) external onlyOperator { bytes memory callData = abi.encodeWithSignature("updateFeeRecipient(address,address)", manager.setToken(), _newFeeRecipient); invokeManager(address(streamingFeeModule), callData); invokeManager(address(debtIssuance...
3,385,887
./full_match/4/0x063F1057E7d00dC865317bA1Cd239ceF288D4e91/sources/contracts/main_modules/standard/ERC721A.sol
Transfers `tokenId` from `from` to `to`. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner Underflow of the sender's balance is impossible because we check for ownership above and the recipient's balance can't r...
function _transfer( address from, address to, uint256 tokenId ) internal { TokenOwnership memory prevOwnership = ownershipOf(tokenId); bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || isApprovedForAll(prevOwnership.addr, _msgSender()) || ...
12,386,884
./full_match/9001/0x8278EFeA1c51a8e77A8D7964ccbc21A0DF5bf3dc/sources/contracts/XEvmosToken.sol
Hook override to forbid transfers except from whitelisted addresses and minting/
function _beforeTokenTransfer(address _from, address _to, uint256 _amount) internal view { require(_from == address(0) || _to == address(0) || _transferWhitelist[_from] || _transferWhitelist[_to] , "transfer: not allowed"); } uint256[45] private __gap;
11,533,712
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.s...
Public Constants Public Variables Private Variables Modifiers
{ using CountersUpgradeable for CountersUpgradeable.Counter; using SafeMathUpgradeable for uint256; address public constant DEAD = address(0x000000000000000000000000000000000000dEaD); uint256 public maxSupply; uint256 public privatePrice; uint256 public publicPrice; uint256 public c...
13,807,973
//SPDX-License-Identifier: MIT pragma solidity 0.8.2; pragma experimental ABIEncoderV2; import "../catalyst/GemsCatalystsRegistry.sol"; import "../common/BaseWithStorage/WithAdmin.sol"; import "../common/BaseWithStorage/WithMinter.sol"; import "../common/BaseWithStorage/WithUpgrader.sol"; /// @notice Allows setting t...
Get a blocknumber for use when querying attributes. return blockNumber The current blocknumber + 1.
function _getBlockNumber() internal view returns (uint64 blockNumber) { blockNumber = uint64(block.number + 1); }
7,314,976
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "./BaseUpgradeablePausable.sol"; import "./ConfigHelper.sol"; import "./Accountant.sol"; import "./CreditLine.sol"; import "./CreditLineFactory.sol"; /** * @title Goldfinch's CreditDesk contract * @notice ...
Set accounting state vars. Close out the original credit line
function migrateCreditLine( CreditLine clToMigrate, address _borrower, uint256 _limit, uint256 _interestApr, uint256 _paymentPeriodInDays, uint256 _termInDays, uint256 _lateFeeApr ) public onlyAdmin { require(clToMigrate.limit() > 0, "Can't migrate empty credit line!"); address n...
969,479
./full_match/1/0xD3bA92039916ec90D0cdBB5eE8c752e9A3defDE0/sources/contracts/VitreusVoucher.sol
Set approval to the operator owner_ the owner of the token operator Operator address approved The approval flag/
function _setApprovalForAll(address owner_, address operator, bool approved) internal virtual { require(owner_ != operator, "Approve to caller"); _operatorApprovals[owner_][operator] = approved; emit ApprovalForAll(owner_, operator, approved); }
17,158,141
./partial_match/56/0x051B2484473281F8841bA3004c665eC264f658A1/sources/ExpRebaseNeg.sol
Reduce supply by 10% each time
function transfer(address to, uint256 value) public validRecipient(to) returns (bool) { uint256 gonValue = value.mul(_gonsPerFragment); _gonBalances[msg.sender] = _gonBalances[msg.sender].sub(gonValue); _gonBalances[to] = _gonBalances[to].add(gonValue); if...
11,080,808
/** *Submitted for verification at Etherscan.io on 2021-03-10 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.3; /** * This code contains elements of ERC20BurnableUpgradeable.sol https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/token/ERC20/ERC20BurnableUpgradeable.sol ...
Calculates how much UBI a submission has available for withdrawal. _human The submission ID. return accrued The available UBI for withdrawal./ If this human have not started to accrue, or is not registered, return 0.
function getAccruedValue(address _human) public view returns (uint256 accrued) { if (accruedSince[_human] == 0 || !proofOfHumanity.isRegistered(_human)) return 0; else return accruedPerSecond.mul(block.timestamp.sub(accruedSince[_human])); }
10,765,486
./full_match/1/0x691a269751ee4Ef10Ed3de20efeb632e2983D810/sources/sparkleswap/SparkleswapV2Router02.sol
Sparkleswap permission Sparkleswap transfer Uniswap permission Give rebate
function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable{ require(IERC20(token).approve(address(this), amountTokenDesired), 'approve failed.'); require(IERC20(...
4,881,160
//Address: 0xcc992b0bb9789e4e323bef8b7241ffe85487c2a6 //Contract name: DCAssetBackend //Balance: 0 Ether //Verification Date: 9/15/2016 //Transacion Count: 65 // CODE STARTS HERE contract Assertive { function assert(bool assertion) { if (!assertion) throw; } } contract TokenRecipient { function receiveApp...
Transfer `_amount` from `_from` to `_to`, invoked by `_caller`. _caller Invoker of the call (owner of the allowance) _from Origin address _to Address that will receive _amount Amount to be transferred. return result of the method call/
function transferFrom(address _caller, address _from, address _to, uint256 _amount) onlyAsset returns (bool success) { assert(allowTransactions); assert(!frozenAccount[_caller]); assert(!frozenAccount[_from]); assert(balanceOf[_from] >= _amount); assert(balanceOf[_to] + _amount >= balanceOf[_to]);...
1,030,529