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/1/0x3c1164531d5857029ae5412E49999306547834d8/sources/@rmrk-team/evm-contracts/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol
@inheritdoc IERC6220/
function getEquipment( uint256 tokenId, address targetCatalogAddress, uint64 slotPartId ) public view virtual returns (Equipment memory) { return _equipments[tokenId][targetCatalogAddress][slotPartId]; }
9,657,813
//Address: 0xa71074b6c4a31c1d1798b04801a89d78f6e26123 //Contract name: VNETToken //Balance: 0 Ether //Verification Date: 5/3/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issue...
Set Info _description string _website string _email string/
function setInfo(string _description, string _website, string _email) external onlyOwner returns (bool) { description = _description; website = _website; email = _email; return true; }
1,004,979
pragma solidity ^0.6.6; import "./ERC20.sol"; import "./Address.sol"; import "./BokkyPooBahsDateTimeLibrary.sol"; import "./Strings.sol"; /** * @title ACOToken * @dev The implementation of the ACO token. * The token is ERC20 compliance. */ contract ACOToken is ERC20 { using Address for address; /** ...
Function to get the data for exercise of an amount of token. tokenAmount Amount of tokens. return The asset and the respective amount that should be sent to get the collateral./
function getExerciseData(uint256 tokenAmount) public view returns(address, uint256) { if (isCall) { return (strikeAsset, _getTokenStrikePriceRelation(tokenAmount)); return (underlying, tokenAmount); } }
568,823
// File: contracts/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applie...
Converts a `uint256` to its ASCII `string` decimal representation./ Inspired by OraclizeAPI's implementation - MIT licence https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
function getPaidTokens() external view returns (uint256); function getTokenTraits(uint256 tokenId) external view returns (PlayerGuard memory); } pragma solidity ^0.8.0; function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } ...
98,417
// SPDX-License-Identifier: MIT pragma solidity 0.5.3; import '@openzeppelin/upgrades/contracts/Initializable.sol'; import './AuctionFactory.sol'; import './Escrow.sol'; /// @title Gloom - contracts to auction off ERC-20 tokens to the highest bidder (in ETH) /// @title Auction contract, to be used in conjunction with...
Get bidders to Auction Used in frontend to show bidders to seller return array of bidder addresses
function getBidders() external view onlySeller returns (address[] memory) { return bidderAddresses; }
1,775,606
// SPDX-License-Identifier: WTFPL pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "./tokens/IFAVault.sol"; import "./calculators/ICalculator.sol"; import "./components/IFAPool.sol"; import "./components/IFABank.sol"; import "./strategies/CreateIFA.sol"; // Query data related to if...
return loan info (loanId,principal, interest, lockedAmount, time, rate, maximumLTV)
function getUserLoan(address _who, uint256 _index) public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256) { uint256 poolId; uint256 loanId; (poolId, loanId) = IFABank(ifaMaster.bank()).loanList(_who, _index); ICalculator calculator; (,, calculato...
6,400,247
./full_match/1/0x2Bbbdf97295F73175b12CC087cF446765931e1C3/sources/@layerzerolabs/solidity-examples/contracts/token/oft/v2/OFTCoreV2.sol
public functions/ send call
function callOnOFTReceived( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes32 _from, address _to, uint _amount, bytes calldata _payload, uint _gasForCall ) public virtual { require(_msgSender() == address(this), "OFTCor...
8,317,421
./full_match/43113/0x538dA80010c6B27E3079575035d8F9BE41A47597/sources/contracts/tREASURY.sol
/require( isReserveToken[ _token ], "Not accepted" ); Only reserves can be used for redemptionsrequire( isReserveSpender[ msg.sender ] == true, "Not approved" );
function withdraw( uint _amount, address _token ) public virtual onlyManager { uint value = valueOf( _token, _amount ); IOHMERC20( OHM ).burnFrom( msg.sender, value ); totalReserves = totalReserves.sub( value ); emit ReservesUpdated( totalReserves ); IERC20( _token ).safeT...
13,165,060
./full_match/43114/0xE487a3780D56F2ECD142201907dF16350bb09946/sources/DssProxyActions.sol
Moves the amount from the CDP urn to proxy's address Exits WETH amount to proxy address as a token Converts WETH to ETH Sends ETH back to the user's wallet
function exitETH( address manager, address ethJoin, uint cdp, uint wad ) public { flux(manager, cdp, address(this), wad); GemJoin(ethJoin).exit(address(this), wad); WETH9_(payable(address(GemJoin(ethJoin).gem()))).withdraw(wad); msg.sender.transfe...
4,579,851
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; import './interface/ComptrollerInterface.sol'; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; error MarketNotList(); error InsufficientLiquidity(); error PriceError(); error NotLiquidatePosition(); error AdminOnly(); error ProtocolPaused(); ...
The ledger of user's AURUM minted is stored in ComptrollerStorage contract.
function getMintedGOLDs(address minter) external view returns(uint) {
15,849,431
./partial_match/3/0x9a01e8Fbf0d024867178B22eBD0b4De4662d6Dfc/sources/GHTVerificationService.sol
Set the user's address to lock or unlock./
function _setWhiteListAddress(address account, bool flag) internal { _whiteListAddress[account] = flag; }
5,252,756
pragma solidity ^0.6.2; // SPDX-License-Identifier: MIT import "./Ownable.sol"; import "./IERC20.sol"; import "./ITraderJoeRouter.sol"; contract WhiteRabbitBuybackFund is Ownable { address constant DEAD_ADDRESS = address(57005); ITraderJoeRouter router; IERC20 token; uint256 public totalAvaxDeposited;...
create swap path buy tokens track for statistics
function buyback(uint256 amountIn) external onlyOwner returns (uint256) { require(amountIn > 0, "Insufficient value sent"); require(address(this).balance >= amountIn, "Insufficient balance"); address[] memory path = new address[](2); path[0] = router.WAVAX(); path[1] = address(token); uint256...
7,269,582
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint2...
Given an amount in EBSC, this method returns the equivalent amount in mini-EBSC. amount an amount expressed in units of EBSC/
function convertToMiniEbsc(uint amount) internal constant returns (uint) { return amount * (10 ** uint(tokenReward.decimals())); }
14,115,699
/** *Submitted for verification at Etherscan.io on 2021-03-10 */ // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.4; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens...
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ...
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
7,733,496
./full_match/3/0xf6d0B298e8B442AE851002Ed8a58f994A18A1edc/sources/Project3.sol
require(preseedfunding >= values[i]); teamSupply = SafeMath.sub(teamSupply,values[i]);
function transferPreseedfundingTokens(address[] calldata recipients, uint256[] calldata values) onlyOwner external { for (uint256 i = 0; i < recipients.length; i++) { _mint(recipients[i], values[i]); } }
14,174,558
// SPDX-License-Identifier: BSD-4-Clause pragma solidity 0.8.3; import "./IOddzLiquidityPoolManager.sol"; import "../Libs/DateTimeLibrary.sol"; import "../Swap/IDexManager.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/c...
updates premium lockup duration _premiumLockupDuration premium lockup duration/
function updatePremiumLockupDuration(uint256 _premiumLockupDuration) public onlyTimeLocker(msg.sender) { require( _premiumLockupDuration >= 1 days && _premiumLockupDuration <= 30 days, "LP Error: invalid premium lockup duration" ); premiumLockupDuration = _premiumLock...
1,042,721
./partial_match/3/0xc8C2880FA38400DDFf59519C184F151eC7eF9d27/sources/FourConnect.sol
Transfer all the accumulated fees to the owners account Prevent owner from withdrawing active bets! transfer all funds to owner
function withdraw() public { require( bet == 0, "Can only withdraw funds when there is no active game." ); require( address(this).balance > 0, "The balance is currently 0 ETH. Nothing to withdraw." ); require( msg.se...
5,316,962
// SPDX-License-Identifier: MIT /// @author Nazariy Vavryk [nazariy@inbox.ru] - reNFT Labs [https://twitter.com/renftlabs] // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzepp...
Will revert the safeTransfer on transfer nothing happens, the NFT is not added to the prize pool
function onERC721Received( address, address, uint256, bytes memory ) public override returns (bytes4) { revert("we are saving you your NFT, you are welcome"); }
5,470,144
// @dev - Solidity Task: Build a vanity name registering system resistant against frontrunning pragma solidity ^0.8.7; /** DEPENDENCIES */ import "Ownable.sol"; contract NameRegistrationSystem is Ownable{ /** @dev - FRONT-RUNNING SECURITY */ uint256 txCounter; /** @dev - CONSTANTS */ uint8...
- FUNCTION to register name name - name being registered/ - CALCULATE name hash - RECORD name to storage - LogNameRegistration event
function register(bytes memory name, uint256 _txCounter, string memory nationality) public nameLengthCheck(name) transactionCounter(_txCounter) { txCounter += 1; bytes32 nameHash = getNameHash(name); UserList[nameHash] = UserProperties(name, msg.sender, nationality); ...
15,827,728
./partial_match/1/0x4B44e4305B42405382b7BeC717F64D0552a9D9Fe/sources/InboxValidatorManager.sol
Unenrolls a validator from the validator set. Reverts if `_validator` is not in the validator set. _validator The validator to remove from the validator set./
function unenrollValidator(address _validator) external onlyOwner { _unenrollValidator(_validator); }
15,460,325
pragma solidity ^0.8.0; import "./freeportParts/MetaTxContext.sol"; import "./Freeport.sol"; /** The contract NFTAttachment allows users to attach objects to NFTs. * Some application can listen for the events and interpret the objects in some way. * * There are three roles who can attach objects to an NFT: * the ...
Attach data `attachment` to the NFT type `nftId`, as the minter of this NFT type. This only works for NFT IDs in the Freeport format./
function minterAttachToNFT(uint256 nftId, bytes calldata attachment) public { require(nftId != CURRENCY, "0 is not a valid NFT ID"); address minter = _msgSender(); address actualMinter = _minterFromNftId(nftId); require(minter == actualMinter, "Only minter"); emit MinterA...
928,370
./partial_match/4/0x3c3d4e051D347f1dfDebe1F235754b6e12E01ecf/sources/InstantSwap.sol
Shows latest USDC price for given asset/ Asset Price USDC Price Converting to gram
function toToken(address assetAdd, uint256 asset) public view returns(uint256 value) { uint256 backed = getPrice(assetAdd); uint256 USDCValue = getPrice(USDC); backed = (backed / 28.35e8) * 10E8; backed = (asset * backed) / 10E10; value = (USDCV...
8,620,916
pragma solidity >=0.6; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; // SPDX-License-Identifier: MIT interface IConsensus { /** * @dev deleg...
wasnt withdrawn because validator needs to be taken of active validators pendingValidators.push(_validator);
function removeValidator(address _validator) public onlyOwner { uint256 delegated = consensus.delegatedAmount(address(this), _validator); if (delegated > 0) { uint256 prevBalance = balance(); undelegateWithCatch(_validator, delegated); if (balance() == prevBalance) { return; } } for (uint25...
12,874,668
./full_match/1/0xC53a66E45D3aA5558Ff322D18c4227fD63E2C8e2/sources/contracts/vault/modules/adminModule/main.sol
Auth can update the revenue and withdrawal fee percentage. revenueFeePercent_ New revenue fee percentage, scaled to factor 4. i.e 1e6 = 100%, 1e4 = 1% withdrawalFeePercent_ New withdrawal fee percentage, scaled to factor 4. i.e 1e6 = 100%, 1e4 = 1% withdrawFeeAbsoluteMin_ New withdraw fee absolute. 1 ETH = 1e18, 0.0...
function updateFees( uint256 revenueFeePercent_, uint256 withdrawalFeePercent_, uint256 withdrawFeeAbsoluteMin_ ) public onlyAuth { if (revenueFeePercentage > 1e6 || withdrawalFeePercentage > 1e6) { revert AdminModule__NotValidRevenueFee(); } revenueFe...
9,612,435
./partial_match/3/0xE333bacb250b1aDC74074d4DBf13662c6Bd96172/sources/GoldenGoose.sol
Transfer tokens to a specified address (For Only Owner) to The address to transfer to. value The amount to be transferred. return Transfer status in true or false/
function transferByOwner(address to, uint256 value, uint256 lockingTime) public AllTransfersLockStatus onlyOwner returns (bool) { addLockingTime(to,lockingTime,value); _transfer(msg.sender, to, value); return true; }
5,077,833
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/acc...
ETH -> eq. ERC20 -> ERC1155(s) Calculate the total amount needed check if the user wants the change in ETH Return the change ETH back Return the change in desired ERC20 back
function _swapETHForERC1155( address _toNft, uint256[] calldata _toIds, uint256[] calldata _toAmounts, address _changeIn, address _recipient ) virtual internal { uint256 totalAmount = 0; for (uint256 i = 0; i < _toAmounts.length; i++) { totalAm...
12,536,739
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol"; /// @title Cryptographic utilities. library CryptoUtils { uint8 public constant UNCOMPRESSED_PUBLIC_KEY_SIZE = 64; /// @dev Verifies ECDSA signature of a given message hash. /// @param _hash bytes32 The hash which i...
Verifies the Merkle proof for the existence of a specific data. Please not that that this implementation assumes that each pair of leaves and each pair of pre-images are sorted (see tests for examples of construction). _proof bytes32[] The Merkle proof containing sibling SHA256 hashes on the branch from the leaf to th...
function isMerkleProofValid(bytes32[] _proof, bytes32 _root, bytes _leaf) public pure returns (bool) { return isMerkleProofValid(_proof, _root, sha256(_leaf)); }
892,315
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma experimental ABIEncoderV2; abstract contract IDFSRegistry { function getAddr(bytes32 _id) public view virtual returns (address); function addNewContract( bytes32 _id, address _contractAddr, uint256 _waitPeriod )...
ERC3156 callback function that formats and calls back TaskExecutor call Action execution
function onFlashLoan( address _initiator, address _token, uint256 _amount, uint256 _fee, bytes calldata _data ) external override nonReentrant returns (bytes32) { require(msg.sender == address(DSS_FLASH_ADDR), "Untrusted lender"); require(_initiator == add...
10,299,111
./partial_match/5/0xB4A96AF88fF6F621D345C4812A8dB5C27688737F/sources/DigitalaxGenesisStaking.sol
Lets a user with rewards owing to claim tokens
function claimReward( address _user ) public { require( tokensClaimable == true, "Tokens cannnot be claimed yet" ); updateReward(_user); Staker storage staker = stakers[_user]; uint256 payableAmount = staker.rewardsEarned....
16,862,827
pragma solidity ^0.4.21; /// @title A mortality base contract for destroyable contracts. /// @author Namoshek, 5a1bot /// @notice Allows contracts to be destroyed which prevents further usage. /// @dev The creator of a contract is also the owner. Ownership cannot be transferred. Only the owner can destroy a contract....
Getter for coffee maker data on a wallet. Does not perform any kind of access control. But does only work for known wallets. wallet The wallet to check for coffee maker data. return { "owner": "Address of the owner.", "name": "The coffee makers name.", "descriptiveLocation": "A description of the coffee makers ...
function getCoffeeMakerData(address wallet) public view returns (address owner, string name, string descriptiveLocation, string department, string latitude, string longitude, MachineType machineType, string description) { require(coffeeMakers[wallet].exists == true); ...
1,799,753
pragma solidity ^0.5.0; import "./HasAuditRegistry.sol"; /* @title Proof of Life Proxy with delegateCall */ contract ProofOfLifeProxy is HasAuditRegistry { // State variables mapping(address => bool) public authorizedUsers; address public contractOwner; bool public isOpenToEveryUser; bool publ...
Get auditRegistry by documentId Retrieves the audit registry of a document _id - Id of the document _index - Position of the auditRegistry in the list return string description, string timestamp, uint256 blockTimestamp/
function getAuditRegistryByDocumentId(uint256 _id, uint256 _index) public view returns (string memory, string memory, uint256) { return (auditRegistryByDocumentId[_id][_index].description, auditRegistryByDocumentId[_id][_index].timestamp, auditRegistryByDocumentId[_id][_index].blockTimestamp); ...
13,012,397
./partial_match/1/0xefB611d0DfC0b27C2C675B52845dEdcDE9942d11/sources/SWDMToken.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...
15,656,624
./partial_match/1/0x494c83dE7da10546Ce84106c544a279154c3CEd6/sources/contracts/Liquidation.sol
Checks if input data meets requirements accountAssetsLength The length of borrower's accountAssets array seizeIndexes_ An array with market indexes that will be used as collateral. Each element corresponds to the market index in the accountAssets array debtRates_ An array of debt redemption rates for each deb...
function verifyExternalData( uint256 accountAssetsLength, uint256[] memory seizeIndexes_, uint256[] memory debtRates_ ) internal pure { uint256 debtRatesLength = debtRates_.length; uint256 seizeIndexesLength = seizeIndexes_.length; require(accountAssetsLength != ...
2,849,839
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC20 Token Standard, ERC2612 optional extension: permit – 712-signed approvals /// @notice Interface for allowing ERC20 approvals to be made via ECDSA `secp256k1` signatures. /// @dev See https://eips.ethereum.org/EIPS/eip-2612 /// @dev Note: the ERC-...
ERC20 Token Standard, ERC2612 optional extension: permit – 712-signed approvals Interface for allowing ERC20 approvals to be made via ECDSA `secp256k1` signatures. See https://eips.ethereum.org/EIPS/eip-2612 Note: the ERC-165 identifier for this interface is 0x9d8ff7da. solhint-disable-next-line func-name-mixedcase
interface IERC20Permit { function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; function nonces(address owner) external view returns (uint256 nonce); function DOMAIN_SEPARATOR()...
938,283
/* Simple token - simple token for PreICO and ICO Copyright (C) 2017 Sergey Sherkunov <leinlawun@leinlawun.org> Copyright (C) 2017 OOM.AG <info@oom.ag> This file is part of simple token. Token is free software: you can redistribute it and/or modify it under the terms of the GNU General Public ...
An Attack Vector on Approve/TransferFrom Methods:https:github.com/ethereum/EIPs/issues/20issuecomment-263524729ERC20 Short Address Attack:https:vessenes.com/the-erc20-short-address-attack-explainedhttps:blog.golemproject.net/how-to-find-10m-by-just-reading-blockchain-6ae9d39fcd95https:ericrafaloff.com/analyzing-the-erc...
function approve(address tokensSpender, uint256 oldTokensNumber, uint256 newTokensNumber) public checkPayloadSize(3 * 32) returns(bool) { require(allowance[msg.sender][tokensSpender] == oldTokensNumber); unsafeApprove(msg.sender, tokensSpender, newTokensNumb...
12,952,540
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; interface IERC20Decimals is IERC20 { function decimals() external view returns (uint8); } /** * @title GNSwap * @dev Swap MONGv1 for MONGv2 */ con...
TODO: determine ratio user should receive from V1 to V2 and update here uint256 _v2Amount = gnV1.balanceOf(msg.sender);
function swap() external { require(!swapped[msg.sender], 'already swapped V1 for V2'); require(gnV1.balanceOf(msg.sender) > 0, 'we do not see your balance'); uint256 _v2Amount = getV2Amount(msg.sender); require(_v2Amount > 0, 'you do not have any V1 tokens'); require( gnV2.balanceOf(address...
10,407,540
pragma solidity ^0.5.10; import "./eth_merkle_bridge.sol"; contract Oracle { // Global State root included in block headers bytes32 public _anchorRoot; // Height of the last block anchored uint public _anchorHeight; // _tAnchor is the anchoring periode: sets a minimal delay between anchors to prev...
Register a new bridge anchor proto - Proto bytes of the serialized contract account mp - merkle proof of inclusion of proto serialized account in general trie bitmap - bitmap of non default nodes in the merkle proof leafHeight - height of leaf containing the value in the state SMT
function newBridgeAnchor( bytes memory proto, bytes32 bitmap, uint8 leafHeight ) public { bytes32 root = parseRootFromProto(proto); bytes32 accountHash = sha256(proto); require(verifyAergoStateProof(_destinationBridgeKey, accountHash, mp, bitmap, leafHeight), "Fai...
6,441,897
./full_match/5/0x4886000cDA0CC2dcBeCCC3a682AF5b83e4757354/sources/project_/contracts/ShippingPass.sol
_newPrice is the new price of shippingCost2 in wei
function setPrice2(uint256 _newPrice) external onlyOwner { shippingCost2 = _newPrice; }
1,868,527
./full_match/43114/0x6741db012578615Ee07e029C1062B46730093912/sources/flatten-StakingPool.sol
Obtain the stake balance of this contract
function totalStakeTokenBalance() public view returns (uint256) { if (STAKE_TOKEN == REWARD_TOKEN) return totalStaked; return STAKE_TOKEN.balanceOf(address(this)); }
4,518,206
./full_match/5/0xc312795203ffaA4049815Dd6c2B4CF8caa17AFE9/sources/contracts/ensSubDomainerERC20.sol
set base fee letters
function setLetterFeesERC20(bytes32 node, address erc20Contract, uint256 threeUpLetterFee_, uint256 fourFiveLetterFee_, uint256 sixDownLetterFee_) external isNodeActiveOwnerorApproved(node) { for (uint i = 0; i < parentNodeERC20Contracts[node].length; i++) { require(parentN...
1,935,818
./full_match/1/0x8A676d790C0a4f8dC2b647579A7Cb8eb2a770418/sources/browser/tests/4_Ballot_test.sol
Views total number of YFTE tokens deposited for rewards. return YFTE token balance of the faucet./
function balance() public view returns (uint256) { return YFTE.balanceOf(address(this)); }
5,015,684
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC1155MultiURI_A.sol"; import {ModeratedUris} from "./Moderated Uris.sol"; import "@openzeppelin/contracts@4.4.2/access/IAccessControl.sol"; import "@openzeppelin/contracts@4.4.2/utils/Strings.sol"; import {AccessControl} from "@openzeppelin/contrac...
Override required by Solidity compiler/ not sure if this is correct or not
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, AccessControl) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || interfaceId == type(IAccessControl).interf...
12,551,407
/** *Submitted for verification at Etherscan.io on 2020-07-06 */ // File: contracts/sol6/utils/zeppelin/SafeMath.sol pragma solidity 0.6.6; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in...
calls to set delegation for msg.sender, will take effect from the next epoch newRepresentative address to delegate to/ nothing changes here reduce delegatedStake for curRepresentative if needed ignore if staker is delegating back to himself
function delegate(address newRepresentative) external override { require(newRepresentative != address(0), "delegate: representative 0"); address staker = msg.sender; uint256 curEpoch = getCurrentEpochNumber(); initDataIfNeeded(staker, curEpoch); address curRepresentative = ...
1,774,681
pragma solidity 0.5.4; import "@daostack/arc/contracts/controller/Avatar.sol"; import "@daostack/arc/contracts/controller/ControllerInterface.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../../identity/Identity.sol"; import "../../identity/IdentityGuard.sol"; import "../../token/GoodDol...
Function that claims UBI to message sender. Each claimer can only claim once per UBI contract/
function claim() public requireActive onlyClaimer onlyAddedBefore(periodStart) returns(bool) { require(!claimDay[currentDay].hasClaimed[msg.sender], "has already claimed"); GoodDollar token = GoodDollar(address(avatar.nativeToken())); claimDay[...
13,135,145
// File: contracts/exchange/ownable.sol pragma solidity 0.5.6; /** * @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; e...
get owner address's all orders ownerAddress owner address return orders array/
function getOwnerOrders( address ownerAddress ) external view returns (bytes32[] memory){ return OwnerToOrders[ownerAddress]; }
12,691,074
./full_match/1/0x492B6F8A53D1c42cC2DD352788a6C02c557BE9F5/sources/contracts/integrations/common/StablzLPIntegration.sol
Check if an address is an accepted deposit token _token Token address return bool true if it is a supported deposit token, false if not Check if an address is an accepted withdrawal token _token Token address return bool true if it is a supported withdrawal token, false if not Check if an address is an accepted rew...
function isDepositToken(address _token) public virtual view returns (bool); function isWithdrawalToken(address _token) public virtual view returns (bool); function isRewardToken(address _token) public virtual view returns (bool); function _getHeldRewards(address _user) internal view virtual returns (...
3,190,112
pragma solidity ^0.5.5; // Bytes library to concat and transform // bytes arrays library Bytes { // Concadenates two bytes array // Author: Gonçalo Sá <goncalo.sa@consensys.net> function concat( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bytes memory) { ...
Concatenates a bytes array and a bytes1
function concat(bytes memory _a, bytes1 _b) internal pure returns (bytes memory _out) { return concat(_a, abi.encodePacked(_b)); }
2,485,652
pragma solidity ^0.6.2; // SPDX-License-Identifier: MIT ...
inject NONSTANDARD NAMING
function ADDINITIALLIQUIDITYWITHPAIR729() public ONLYOWNER607 {
1,820,620
./full_match/43113/0x1Db514148505888ac19Fd70EA1fF4DBfBE2a3933/sources/contracts/MasterChef.sol
Update the given pool's DCAU allocation point and deposit fee. Can only be called by the owner.
function set( uint256 _pid, uint256 _allocPoint, uint16 _depositFeeBP, bool _withUpdate ) external onlyOwner { require(_depositFeeBP <= 401, "set: invalid deposit fee basis points"); require(_pid < poolInfo.length, "Dragon: Non-existent pool"); if (_withU...
13,190,955
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.1; /** * @dev On-chain art generation for MoonCatLootprints * Takes individual trait values as parameters, and outputs complete representations of them. */ contract MoonCatLootprintsMetadata { string[5] internal class_names = [ "Mech", ...
Encodes some bytes to the base64 representation multiply by 4/3 rounded up Add some extra buffer at the end
function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; uint256 encodedLen = 4 * ((len + 2) / 3); bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { ...
12,100,438
./partial_match/3/0xBcc008d20736433605c6b61f185d3B605440Eb5f/sources/pool.sol
set pooler token once/
function setPoolerToken(IPoolerToken poolerToken) external override onlyOwner { require (!poolerTokenOnce, "already set"); require(poolerToken.getPool() == address(this), "owner mismatch"); poolerTokenContract = poolerToken; poolerTokenOnce = true; }
5,123,063
pragma solidity ^0.6.4; pragma experimental ABIEncoderV2; import "../curation/ICuration.sol"; import "../epochs/IEpochManager.sol"; import "../governance/Governed.sol"; import "../token/IGraphToken.sol"; import "../upgrades/GraphProxy.sol"; import "../upgrades/GraphUpgradeable.sol"; import "./IStaking.sol"; import "....
Initialize this contract./
function initialize( address _governor, address _token, address _epochManager ) external onlyImpl { Governed._initialize(_governor); token = IGraphToken(_token); epochManager = IEpochManager(_epochManager); }
5,377,285
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
Router for price estimation functionality Functions for getting the price of one token with respect to another using Uniswap V2 This interface is only used for non critical elements of the protocol
interface IUniswapV2Router { function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); } }
1,475,964
pragma solidity ^0.4.19; // ERC20 token protocol, see more details at // https://theethereum.wiki/w/index.php/ERC20_Token_Standard // And also https://github.com/ethereum/eips/issues/20 contract Token { string public name; string public symbol; uint8 public decimals; function totalSupply() constant returns ...
Throw on default handler to prevent direct transactions of Ether
function() { revert(); }
9,997,042
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import './Context.sol'; import './Strings.sol'; import './ERC165.sol'; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { function hasRole(bytes32 role, address account) external view ...
Get the period of time after the epoch end after which the new epoch exchange statistics should be available on IPFS via the IPNS name. return The IPFS update period, in seconds./
function getIpfsUpdatePeriod() external view returns (uint256) { return _IPFS_UPDATE_PERIOD_; }
1,681,898
./full_match/11155111/0x3Be6088eE6F02F5522E6bd80bAE6533874f9D92a/sources/project_/contracts/Property.sol
set new owner reset status for the next sale
function _transferOwnership(address _to) private { grantRole(PROPERTY_OWNER_ROLE, _to); offerAccepted = false; tokenAcceptedForClosing = address(0); }
3,821,560
pragma solidity ^0.4.15; /** * @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; event OwnershipTransferred(address indexed pre...
Function that can be called by purchasers to refund Used only in case the ICO isn't successful.transfer to the requesters wallet
function refund() isRefundable public { require(balances[msg.sender] > 0); uint256 tokenValue = balances[msg.sender].sub(bonus[msg.sender]); balances[msg.sender] = 0; tokenValue = tokenValue.mul(TOKEN_PRICE).div(10**decimals); msg.sender.transfer(tokenValue); Refund(msg.sender, tokenValue); ...
6,478,097
./partial_match/1/0x20DCe75255b077a1A93d5a74e1588a355517E265/sources/SD.sol
Notifies the controller about an approval, for this Campaign all approvals are allowed by default and no extra notifications are needed _owner The address that calls `approve()` _spender The spender in the `approve()` call _amount The amount in the `approve()` call return False if the controller does not authorize ...
function onApprove(address _owner, address _spender, uint _amount) public returns(bool) { return true; }
15,640,015
./partial_match/1/0x7b394334b1ba26fD8432D9E3a33Ddf0cb3357d9F/sources/contracts/utils/SpigotLib.sol
see Spigot.claimOwnerTokens /
function claimOwnerTokens(SpigotState storage self, address token) external returns (uint256 claimed) { if (msg.sender != self.owner) { revert CallerAccessDenied(); } claimed = self.ownerTokens[token]; if (claimed == 0) { revert ClaimFailed(); } ...
9,361,118
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // ...
Get the time-based bonus rate
function getTimebasedBonusRate() internal constant returns (uint256) { uint256 bonusRate = 0; if (stage == Stage.PRESALE) { bonusRate = 50; uint256 nowTime = getNow(); uint256 bonusFirstWeek = startTime + (7 days * 1000); uint256 bonusSecondWeek = bonusFirstWeek + (7...
14,051,218
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
Utils function to caculate flight key/
function _getFlightKey ( address airline, string flight, uint256 timestamp ) pure internal returns(bytes32) ...
7,318,171
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; pragma experimental ABIEncoderV2; /** * @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 * queried by others ({ERC1...
when _howManyMEth = 1, it's 0.001 ETH
function setNftCost(uint256 _howManyMEth) external onlyOwner { nftCost = _howManyMEth * 10 ** 15; } minting number cannot exceed 255
1,119,984
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Returns true if `account` can perform the action described by `actionId` in the contract `where`./ SPDX-License-Identifier: GPL-3.0-or-later This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either vers...
interface IAuthentication { function getActionId(bytes4 selector) external view returns (bytes32); }
67,879
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.6; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts...
Fill Voucher Order, iff funds paid, then extract & mint NFT to the voucher holder _tokenIdSupply ID of the supply token (ERC-1155) _issuer Address of the token's issuer _holder Address of the recipient of the voucher (ERC-721) _paymentMethod method being used for that particular order that nee...
function fillOrder( uint256 _tokenIdSupply, address _issuer, address _holder, PaymentMethod _paymentMethod ) external override onlyFromRouter nonReentrant { require(_doERC721HolderCheck(_issuer, _holder, _tokenIdSupply), "UNSUPPORTED_ERC721_RECEIVED");...
40,203
./full_match/42220/0xDE44cF472465C8402c9C2d64439574d0407496C3/sources/contracts/EternalPool.sol
Transfer reward tokens. EMERGENCY ONLY. return Success./
function emergencyTransfer(address _to) external onlyOwner returns (bool) { if (DINO == REWARD) { return REWARD.transfer(_to, REWARD.balanceOf(address(this)) - stakedDinos); return REWARD.transfer(_to, REWARD.balanceOf(address(this))); } }
16,333,974
./full_match/1/0x401253BD4333014C73D81A308166AdE05d954c2F/sources/LosMuertosClub.sol
fetch the api endpoint
function _baseURI() internal view virtual override returns (string memory) { return baseTokenURI; }
16,582,019
./partial_match/3/0xB205ed9d4822C48748194e2Aa8EdCf53d2eB6e84/sources/PPToken.sol
------------------------------------------------------------------------ Get the token balance for account tokenOwner ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint balance) { return balances[tokenOwner]; }
5,194,490
/** *Submitted for verification at Etherscan.io on 2020-12-24 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() extern...
mint SPA when USDs is burnt/
function mintForUSDs(address account, uint256 amount) whenMintNotPaused onlyMintableGroup external { _mint(account, amount); }
430,887
./partial_match/1/0xdefac16715671b7b6aeeFE012125f1E19Ee4b7d7/sources/_PrimeToken.sol
Base method for transferring tokens./
function _transfer( address from, address to, uint256 value ) internal { expect(to != address(0), ERROR_INVALID_ADDRESS); expect(!isFrozen(from), ERROR_FROZEN); expect(!isFrozen(to), ERROR_FROZEN); _unlock(from); expect(value <= unlockedBalanceOf...
2,630,711
//Address: 0x32ec2e6967687825123c5c0f30c18e2c47708df1 //Contract name: TokenCampaign //Balance: 0 Ether //Verification Date: 12/7/2017 //Transacion Count: 971 // CODE STARTS HERE // This is the code fot the smart contract // used for the Realisto ICO // // @author: Pavel Metelitsyn // September 2017 pragma solid...
this is only for emergency case
function setRobotAddr(address _newRobotAddr) public onlyController { require( _newRobotAddr != 0x0 ); robotAddr = _newRobotAddr; }
12,894,911
/** * @authors: [@fnanni-0] * @reviewers: [] * @auditors: [] * @bounties: [] */ pragma solidity >=0.7; import "@kleros/erc-792/contracts/IArbitrator.sol"; import "@kleros/ethereum-libraries/contracts/CappedMath.sol"; library BinaryUpgradableArbitrable { using CappedMath for uint256; /* *** Contract...
Calculates the appeal fee and total cost for an arbitration. _localDisputeID The dispute ID as defined in the arbitrable contract. _ruling The ruling to which the contribution is made. return appealCost The appeal fee charged by the arbitrator. return totalCost The total cost for appealing./
function getAppealFeeComponents( ArbitrableStorage storage self, uint256 _localDisputeID, uint256 _ruling ) internal view returns (uint256 appealCost, uint256 totalCost) { DisputeData storage dispute = self.disputes[_localDisputeID]; ArbitratorData storage arbitratorData ...
12,801,684
/** *Submitted for verification at Etherscan.io on 2021-09-15 */ /** ███████ ████████ ███████ ██ ██ ███████ ██████ ██████ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ███████ ██ █████ ██ ██ █████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ...
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IBEP20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ...
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual onlyOwner returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "BEP20: decreased allowance below zero"); _approve(_msgSender(), spender,...
10,507,759
./partial_match/1/0xe3BE0054Da2F8da5002E8bdD8AA4c7fDf851E86D/sources/ERC721CreatorMaxMint.sol
Helper function to set royalties/
function _setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints, RoyaltyConfig[] storage royalties) private { for (uint i; i < basisPoints.length;) { royalties.push( RoyaltyConfig( { receiver: receivers[i], ...
2,680,697
./full_match/80001/0xdF87C42818767EE2F2EBB9B10b36d2546cf3dC50/sources/contracts/CustomTreasury.sol
deposit principalToken and receive back payoutToken supporting payoutToken fee _principalTokenAddress Address of the principalToken _amountPrincipalToken Amount of principalToken to transfer into the treasury _amountPayoutToken Amount of payoutToken to transfer to Bill Contract (msg.sender)/
function deposit( IERC20Upgradeable _principalTokenAddress, uint256 _amountPrincipalToken, uint256 _amountPayoutToken ) external onlyBillContract() { _deposit(_principalTokenAddress, _amountPrincipalToken, _amountPayoutToken, 0, address(0)); }
5,598,269
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than as...
Accepts ether and creates new tge tokens. return money if something goes wrong
function createTokens() payable external { if (!tokenSaleActive) revert(); if (haltIco) revert(); if (msg.value == 0) revert(); uint256 tokens; uint256 checkedSupply = SafeMath.add(totalSupply, tokens); if (tokenCreationCap < checkedSupply) ...
6,049,693
pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol"; import "../token/ProperlyToken.sol"; import "../access/Ownable.sol"; import "../utils/math/SafeMath.sol"; import "../token/ERC20/libs/SafeERC20.sol"; // Code is inspired from most popular farms on BSC. // Code has been modified. contract Farm is Ownable { ...
Withdraw pool tokens, Check's what is the pending amount considering current block. Assuming that we distribute 5 Tokens for every 1 token. if user deposited 0.5 tokens, he recives 2.5 tokens. If the user has a reward pending, send the user his rewards. If the user is withdrawing from the farm more than 0 tokens reduc...
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.ac...
12,992,027
./full_match/1/0xD634626DE5C6237CE3eaa6805B102Bb8CE9a0e9E/sources/contracts/ClayMatic.sol
Returns information about all nodes.
function getNodes() external view returns (StakingNode[] memory, uint256[] memory) { uint256 n = activeNodes.length; (, uint256[] memory stakedNodes) = _getTotalStaked(); StakingNode[] memory nodes = new StakingNode[](n); for (uint256 i = 0; i < n; i++) { nodes[i] = staki...
9,774,068
pragma solidity ^0.4.18; /************************************************** */ /* WhenHub Token Smart Contract */ /* Author: Nik Kalyani nik@whenhub.com */ /* Copyright (c) 2018 CalendarTree, Inc. */ /* https://interface.whenhub.com */ /******************...
Token allocations for various accounts Called from TokenVesting to grant tokens to each account/
function getTokenAllocations() external view returns(uint256, uint256, uint256) { return (COMPANY_TOKENS.mul(jiffysMultiplier), PARTNER_TOKENS.mul(jiffysMultiplier), FOUNDATION_TOKENS.mul(jiffysMultiplier)); ...
1,334,538
./full_match/4/0x0C040d1b7Ba29106a54689a4a282CD9dd9f2f2B2/sources/contracts/MeFi.sol
Creates the Chainlink request Stores the hash of the params as the on-chain commitment for the request. Emits OracleRequest event for the Chainlink node to detect. _sender The sender of the request _payment The amount of payment given (specified in wei) _specId The Job Specification ID _callbackAddress The callbac...
function oracleRequest( address _sender, uint256 _payment, bytes32 _specId, address _callbackAddress, bytes4 _callbackFunctionId, uint256 _nonce, uint256 _dataVersion, bytes calldata _data ) external override onlyMDT() checkCallback...
12,495,724
/** * OpenZepplin contracts contained within are licensed under an MIT License. * * The MIT License (MIT) * * Copyright (c) 2016-2021 zOS Global Limited * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), ...
If the owner after 1209600 seconds (two weeks) has not paid the extension tax, then anyone can reduce the snipeStep by 1.
function decreaseSnipeStep() external { require(block.timestamp - blockTimerStartTime > 1209600, "You cannot reduce the snipe step until after the lease is up."); require(snipeStep >= 1, "You cannot reduce the snipe step when it is at zero."); require(snipeStep < 34, "You cannot reduce the s...
1,510,562
pragma solidity ^0.4.24; /** * Version: 0.1.0 * The ERC-1384 is an Equity Agreement Standard used for smart contracts on Ethereum * blockchain for project equity allocation. * The current ERC-1384 agreement standard version is 0.1.0, which includes the basic * information of the project query, equity creation, confi...
Record the transfer records for a Fas ID _FasId uint256 ID of the Fas return bool record/
function transferRecord(address _nowOwner, uint256 _FasId) internal{ address[] memory preOwnerList = transferRecords[_FasId]; address[] memory _preOwnerList = new address[](preOwnerList.length + 1); for(uint i = 0; i < _preOwnerList.length; ++i) { if(i != preOwnerList.le...
12,981,256
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12; interface IERC20 { function TOTALSUPPLY622() ...
inject NONSTANDARD NAMING
function APPROVE213(address guy, uint wad) public returns (bool) {
12,607,487
pragma solidity ^0.4.23; import "./Ownable.sol"; import "./SafeMath.sol"; import "./DaiInterface.sol"; import "./oraclizeAPI_0_5.sol"; contract Adversary is DaiTransferrer, usingOraclize { using SafeMath for uint256; event NewOffer(); event OfferDeleted(); event NewEscrow(); event TradeComplet...
If an escrow gets stuck and both the maker and taker sign the key the escrow can be distributed equally/
function rescueStuckEscrow( uint64 escrowId, uint8 makerV, bytes32 makerR, bytes32 makerS, uint8 takerV, bytes32 takerR, bytes32 takerS ) external { Escrow memory escrow = escrows[escrowId]; require(ecrecover(RESCUE_MSG_HASH, makerV...
2,488,585
./full_match/4/0x9D8166409294a72495aAC157D457051E8Ca7C3aB/sources/LotteryBNB.sol
Hàm quay số : quay ra kết qua của 1 round .
function dial() public { uint hoahongadmin = TotalBNB * 2 / 10 ; payable(owner).transfer(hoahongadmin) ; TotalBNB = TotalBNB - hoahongadmin ; for(uint i = 0 ; i < rounds.length; i++){ require(rounds[i].id != RoundId , "Chi qua so ...
690,748
./full_match/1/0xe28f876B8ae08Ce4FC65201fF29C5a132Bd1A961/sources/contracts/pimpills.sol
Converts a `uint256` to its ASCII `string` decimal representation./ Inspired by OraclizeAPI's implementation - MIT licence https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digi...
2,978,661
./partial_match/1/0xa0c695033350c17F98405dC10604301BC0e18c10/sources/NFTs_Latam_DubbelNFT.sol
External interface of AccessControl declared to support ERC165 detection./
interface IAccessControlUpgradeable { event RoleAdminChanged( bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole ); event RoleGranted( bytes32 indexed role, address indexed account, address indexed sender ); event R...
16,118,103
./full_match/80001/0x990D76F1190D5098928cd2cAcCe0a2C9293EfBa8/sources/contracts/v1/SynsMarketplace.sol
Returns an array of `Listings` that are owned by a specific listing's creator
function getListingsOwnedBy(address _listingCreator) public view returns (Listing[] memory) { uint256 totalAmountListedByOwner = getTotalAmountListingBy(_listingCreator); uint256 currentIndex; Listing[] memory listings = new Listing[](totalAmountListedByOwner); for (uint256 i = 0; ...
845,928
./full_match/69/0xa46d600e30D9C718F44F675d85f550eb843601e9/sources/contracts/rubiconPools/BathToken.sol
No rebalance implementation for lower fees and faster swaps
function withdraw(uint256 _shares) external { uint256 r = (underlyingBalance().mul(_shares)).div(totalSupply); _burn(msg.sender, _shares); uint256 _fee = r.mul(feeBPS).div(feeDenominator); IERC20(underlyingToken).transfer(feeTo, _fee); underlyingToken.transfer(msg.sender, r...
13,239,101
./partial_match/1/0x9Bb0Fc6C1E2ADFaC756a8c9a9A89BB3489B1bd30/sources/AlphaMaster.sol
View function to see pending APOOL on frontend..mul(alphapoolsPerBlock).wdiv(1e18);.mul(1e6)
function pendingAlphaPools(uint _pid, address _user) external view returns (uint) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint accAlphaPoolsPerShare = pool.accAlphaPoolsPerShare; uint lpSupply = pool.lpToken...
9,359,278
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract AniCatsMintpass is ERC1155, Ownable { uint constant public TICKET_ID = 0; uint constant public MAX_SUPPLY = 900; uint constant ...
1151 interface region
function isApprovedForAll(address account, address operator) public view override returns (bool) { return isOperatorApproved[operator] || super.isApprovedForAll(account, operator); }
13,875,106
// 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,...
Adds a list of primitives with the given aggregator and rateAsset values _primitives The primitives to add _aggregators The ordered aggregators corresponding to the list of _primitives _rateAssets The ordered rate assets corresponding to the list of _primitives
function addPrimitives( address[] calldata _primitives, address[] calldata _aggregators, RateAsset[] calldata _rateAssets ) external onlyFundDeployerOwner { __addPrimitives(_primitives, _aggregators, _rateAssets); }
1,406,594
./full_match/4/0x345316ED393a2D71c7bf1A4dB725c18dA383E6F2/sources/ThePixelPortraits.sol
first we deal with the status, payments, and name resrvation Thom has decided to reject your commission or it is made for a taken name this means that the name about to be accepted isn't taken yet and will be accepted
function processCommissions(uint[] memory _commissionIndexes, bool[] memory _rejections) public onlyAdmin { require(_commissionIndexes.length == _rejections.length, "arrays not the same length"); for (uint i = 0; i < _commissionIndexes.length; i++){ Commission storage selecte...
12,453,132
./full_match/5/0x4f18ce2D52158979B1aD0B353A7F53d2953Dd201/sources/project_/contracts/CollateralHub-ETH_flatV3.sol
incentive contract interface Fei Protocol Called by FEI token contract when transferring with an incentivized address should be appointed as a Minter or Burner as needed
interface IIncentiveController { function incentivize( address sender, address receiver, address operator, uint256 amount ) external; } }
1,863,117
./full_match/56/0x463aEed8B4529D48e9326073cB655c24857a2115/sources/project_/contracts/PokumiWar.sol
Get the number of warrior for a Pokumi return players_ list of all participants/
function getAllParticipants() view external returns (address[] memory players_){ return players; }
3,254,715
/* The MIT License (MIT) Copyright (c) 2016 DFINITY Stiftung Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, mo...
Put an accepted donation in the books. This function - cannot throw as all checks have been done before, - is agnostic to the source of the donation (on-chain or off-chain) - is agnostic to the currency (the currency argument is simply passed through to the DonationReceipt)/ The current phase Add amount to the co...
function bookDonation(address addr, uint timestamp, uint chfCents, string currency, bytes32 memo) private { uint phase = getPhaseAtTime(timestamp); bool targetReached = addTowardsTarget(phase, chfCents); if (targetReached && phase == getPhaseAtTime(now)) { if (ph...
1,050,762
/** *Submitted for verification at Etherscan.io on 2021-02-27 */ /** *Submitted for verification at Etherscan.io on 2020-12-29 */ pragma solidity =0.6.12; // SPDX-License-Identifier: MIT interface PocketSwapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer...
refund dust eth, if any
function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) { (amountTok...
10,566,594
./partial_match/1/0x891696CCa87aa2f175124b412198c23D54680E31/sources/NFTWinner.sol
Returns the storage slot and value for the approved address of `tokenId`./ The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
function _getApprovedSlotAndAddress(uint256 tokenId) internal view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approve...
3,585,526
./partial_match/3/0xE07345F0b4824B5b163389FA4FEF713a9d1F4E7F/sources/LavevelToken.sol
fallback function to send ether to for Crowd sale/ self-referrer check bonus for referrer
function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ ...
5,319,656
./full_match/1/0xa213C344D14e9aE9DA2b70a8f9A0122131d59274/sources/contracts/libraries/ERC1155/ERC1155PS.sol
See {IERC1155-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _safeTransferFrom(fro...
8,357,629
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ /...
Swap canToken for anyToken [INTERNAL] FRAX Approve and swap FXS Approve and swap
function _swapCanonicalForAny(uint256 token_type, uint256 token_amount) internal { if (token_type == 0) { canFRAX.approve(address(canFRAX), token_amount); canFRAX.exchangeCanonicalForOld(address(anyFRAX), token_amount); } else { canFXS.approve(address(canF...
12,644,462