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; pragma experimental ABIEncoderV2; import "../../Vault/Utils/Address.sol"; import "../../Vault/Utils/SafeBEP20.sol"; import "../../Vault/Utils/IBEP20.sol"; import "../../Vault/Utils/ReentrancyGuard.sol"; import "./XVSVaultStrategyProxy.sol"; import "./XVSVaultStrategyStorage.sol"; // This cont...
Transfer claimed XVS to the user wallet
function claimRewards(address _userAddress) external nonReentrant onlyAdminVault { IXVSVault(xvsVault).deposit(xvs, pid, 0); IBEP20(xvs).safeTransferFrom(address(this), _userAddress, IBEP20(xvs).balanceOf(address(this))); }
2,492,533
// SPDX-License-Identifier: MIT pragma solidity >= 0.8.4; import "./IERC721Receiver.sol"; import "./IERC721Metadata.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/S...
Sets `_tokenURI` as the tokenURI of `tokenId`. Requirements: - `tokenId` must exist./
function _setTokenURI(uint64 tokenId, bytes32 ipfs_hash) internal virtual { bytes32 old_URI = editions_by_id[tokenId].ipfs_hash; editions_by_id[tokenId].ipfs_hash = ipfs_hash; emit SetURI(tokenId, old_URI, ipfs_hash); }
1,067,875
// 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_525(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,238
./full_match/5/0xB23F0796e592A91467E5D42F3368Cd722E7f0251/sources/contracts/medrecords.sol
Retrieve permission granted count
function getAppointmentPerPatient(address _address) public view returns(uint256) { return AppointmentPerPatient[_address]; }
11,630,167
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contrac...
Do not allow to drain lpToken if less than 180 days after farming.
function governanceRecoverUnsupported(IERC20 _token, uint256 amount, address to) external onlyOperator { require(block.number > timeLockBlock, "ChipRewardPool: locked"); if (block.number < endBlock + BLOCKS_PER_DAY * 180) { require(_token != CHIPS, "ChipRewardPool.governanceRecoverUnsupp...
1,773,209
pragma solidity ^0.5.0; // Copyright 2019 OpenST Ltd. // // 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 applica...
Internal function to transfer the tokens. This is an internal functions that transfers the token. This function is called from transfer and transferFrom functions. _from Address from which tokens are transferred. _to Address to which tokens are transferred. _value Amount of tokens transferred. return success_ ...
function transferBalance( address _from, address _to, uint256 _value ) internal returns (bool success_) { balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(_from, _to, _value); suc...
12,879,443
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific function...
Pauses all token creation. Requirements: - the caller must have the `DEFAULT_ADMIN_ROLE`./
function pause() public virtual onlyOwner { _pause(); }
13,712,693
pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spen...
low level token purchase DO NOT OVERRIDE beneficiary Address performing the token purchase/ calculate token amount to be created bonus tokens accrual and ensure token balance is enough for accrued tokens release update state
function buyTokens(address beneficiary) public payable { uint256 weiAmount = msg.value; _preValidatePurchase(beneficiary, weiAmount); uint256 tokens = _getTokenAmount(weiAmount); _accrueBonusTokens(beneficiary, tokens, weiAmount); _weiRaised = _weiRaised.add(weiAmount); _processPurchase(be...
12,909,233
pragma solidity ^0.4.12; contract KydyUtil { uint256 private randomSeed_ = 0; function isKydyUtil() public pure returns (bool) { return true; } function getRand(uint256 tempSeed) public returns (uint256) { bytes32 seedHash = keccak256(bytes32(tempSeed)); randomSeed_ += uint256...
given genes of Kydy 1 & 2, return a silly genetic combination
function mixGenes(uint256 gene1, uint256 gene2) public returns (uint256) { uint256 _mixedGene = 0; for (uint8 i = 0 ; i < traitsInGene_; i++) { uint256 _mixedTrait = mixTraits( (gene1 >> (i * traitBits_)) & 0xfffff, (gene2 >> (i * ...
6,350,647
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2021 ZeroEx Intl. 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 a...
Get the EIP-712 hash of an ERC721 order. order The ERC721 order. return orderHash The order hash.
function getERC721OrderHash(LibNFTOrder.ERC721Order memory order) public override view returns (bytes32 orderHash) { return _getEIP712Hash(LibNFTOrder.getERC721OrderStructHash(order)); }
6,437,493
pragma solidity ^0.5.10; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @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...
Function to update rate newRate The rate is the conversion between wei and the smallest and indivisible token unit/
function setRate(uint256 newRate) public onlyOwner { require(newRate > 0, "TokenDealer: rate is 0"); _rate = newRate; }
943,909
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount ...
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 (uint256); ...
9,975,518
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; contract Micronews is Ownable { using SafeMath for uint256; struct Channel { uint256 id; uint256 subscribers; bytes name; } uint...
------ GETTER FUNCTIONS ------ /
function getNumberOfChannels() public view returns (uint256 _num) { return channelId - 1; }
1,033,347
pragma solidity ^0.4.11; // import "./ERC223BasicToken.sol"; // import "./SafeMath.sol"; /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) int...
allow to burn pre-tge tokens in order to teleport them to new contract
function burnTokens(uint amount) { if (amount > balances[msg.sender]) throw; balances[msg.sender] = balances[msg.sender].sub(amount); burnedTokens[msg.sender] = burnedTokens[msg.sender].add(amount); }
8,042,422
./partial_match/3/0x6f1eC6116E6eb7e9843A1dd8F0dC71Af0500D577/sources/ERC20.sol
assert(a == b c + a % b); There is no case in which this doesn't hold
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; }
5,085,628
./partial_match/1/0x3B807162EaFD8637cA81D8CdAAFBF43c0df23972/sources/Superbowl.sol
Returns the integer division of two unsigned integers. Reverts with custom message on division by zero. The result is rounded towards zero. Counterpart to Solidity's `/` operator. Note: this function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming...
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; }
3,887,368
./full_match/42161/0x947D83b35Cd2e71df4aC7B359C6761B07d0bce19/sources/code/contracts/oasis/OasisSwapPair.sol
if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { address feeTo = IOasisSwapFactory(factory).feeTo(); feeOn = feeTo != address(0); if (feeOn) { if (_kLast != 0) { uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1)); ...
16,298,674
./full_match/42/0x275b8993c2c763B01f7D754a6b8b3158aaCcC2d3/sources/dex/Main.sol
ojo debo de aprobar que los tokens sean gastados por este contrato 0x9230646A9ebC810cdC893c65aE7684286786A62D, 100,100 actualizo balance del usuario usertoken[_user]= userDepositToken(_amount0,_amount1); agrego la cantidad de tokens que agrego un usuario envio de ETH y Token envio de TOKEN0, TOKEN1
function deposit(address _user,uint256 _amount0, uint256 _amount1) external payable{ usertoken[_user].amount0= usertoken[_user].amount0+_amount0; usertoken[_user].amount1= usertoken[_user].amount1+_amount1; if(tokenWETH==Token0){ require(_amount0==msg....
16,240,502
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functio...
Allows to change the default royalties recipient an editor can call this recipient new default royalties recipient
function setDefaultRoyaltiesRecipient(address recipient) external onlyEditor(msg.sender) { require(!hasPerTokenRoyalties(), '!PER_TOKEN_ROYALTIES!'); _setDefaultRoyaltiesRecipient(recipient); }
1,626,324
pragma solidity 0.5.16; import "./Governable.sol"; contract Controllable is Governable { constructor(address _storage) public Governable(_storage) {} modifier onlyController() { require(store.isController(msg.sender), "Not a controller"); _; } modifier onlyControllerOrGovernance() { ...
Investing all underlying./
function investedUnderlyingBalance() public view returns (uint256) { return Gauge(pool).balanceOf(address(this)).add( IERC20(underlying).balanceOf(address(this)) ); }
10,033,053
./full_match/5/0x5E37A79cBFBC036467e1295d0A00Cc8c73051580/sources/@reality.eth/contracts/development/contracts/RealityETH_ERC20-3.0.sol
Update the current bond level, if there's a bond (ie anything except arbitration)
function _addAnswerToHistory(bytes32 question_id, bytes32 answer_or_commitment_id, address answerer, uint256 bond, bool is_commitment) internal { bytes32 new_history_hash = keccak256(abi.encodePacked(questions[question_id].history_hash, answer_or_commitment_id, bond, answerer, is_commitment)); ...
1,897,813
./partial_match/1/0x18B32bC20951b0eaE36247Aa5C8C22A77244d6cd/sources/contracts/ERC721X.sol
Approve `to` to operate on `tokenId` Emits a {Approval} event./
function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); }
4,202,206
// SPDX-License-Identifier: MIT // SYS 64738 // Version 2.0 // Author: 0xTycoon // Contributor: Alphasoup <twitter: alphasoups> // Special Thanks: straybits1, cryptopunkart, cyounessi1, ethereumdegen, Punk7572, sherone.eth, // songadaymann, Redlioneye.eth, tw1tte7, PabloPunkasso, Kaprekar_Punk, aradtski...
Returns the amount of tokens in existence./ Returns the amount of tokens owned by `account`./ Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event./ Returns the remaining number of tokens that `spender` will be al...
interface ILiquidityPoolERC20 is IERC20 { function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast); function totalSupply() external view returns(uint); }
1,073,070
./full_match/11155111/0x6B086AA45FDC47ea899f7881FF511D89a59CA4B3/sources/@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol
Mints `amount` of tokens and transfers it to `to`. to the address to mint tokens for. amount the amount of tokens to mint. allowNonLSP1Recipient a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. data Additional data the caller wants included in the emitted {Transfer...
function _mint( address to, uint256 amount, bool allowNonLSP1Recipient, bytes memory data ) internal virtual { if (to == address(0)) { revert LSP7CannotSendWithAddressZero(); } address operator = msg.sender; _beforeTokenTransfer(addre...
3,835,917
./partial_match/3/0xc7920b800569AC8895e1a0bA3869B6ddF56717e3/sources/PoR.sol
calculates the signature hash of a Bitcoin transaction with the provided details documented in bip143. many values are hardcoded here _outpoint the bitcoin UTXO id (32-byte txid + 4-byte output index) _inputPKH the input pubkeyhash (hash160(sender_pubkey)) _inputValue the value...
function wpkhToWpkhSighash( ) internal pure returns (bytes32) { return wpkhSpendSighash( _outpoint, _inputPKH, _inputValue, _outputValue, abi.encodePacked( _outputPKH) ); }
5,220,646
// SPDX-License-Identifier: MIT // File: contracts/AddressChecksumStringUtil.sol pragma solidity ^0.8.0; // Derived from https://ethereum.stackexchange.com/a/63953, no license specified // Modified to remove unnecessary functionality and prepend the checksummed string address with "0x" /** * @dev This contract pro...
Exchanges ERC-20 $AWOO for virtual AWOO to be used in the Awoo Studios ecosystem amount The amount of $AWOO to deposit
function deposit(uint256 amount) external whenActive hasBalance(amount, balanceOf(_msgSender())) nonReentrant { _burn(_msgSender(), amount); _virtualBalance[_msgSender()] += amount; }
4,799,698
pragma solidity ^0.4.19; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Ethernauts contract ERC721 { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); funct...
Safety check to prevent against an unexpected 0x0 default. Disallow transfers to this contract to prevent accidental misuse. The contract should never own any assets (except very briefly after it is created and before it goes on auction). Disallow transfers to the storage contract to prevent accidental misuse. Auction ...
function transfer( address _to, uint256 _tokenId ) external onlyOracle whenNotPaused { require(_to != address(0)); require(_to != address(this)); require(_to != address(ethernautsStorage)); require(_owns(address(this), _tokenId)); _approve(_token...
14,876,199
pragma solidity ^0.4.20; /** * Authored by https://www.coinfabrik.com/ */ /** * @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 ow...
Buys tokens on behalf of an address. Pay for funding, get invested tokens back in the receiver address./
function buyOnBehalf(address receiver) public payable { require(!requiredSignedAddress || msg.sender == investmentGateway); investInternal(receiver, 0); }
12,579,240
pragma solidity >=0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIAB...
Credits payouts to insurees/
{ function creditInsurees ( string flightCode ) requireIsOperational isAuthorizedCaller external for (...
5,510,457
./partial_match/1/0x2Cf28B3123A87df592dDF1162A99D62783ebfb59/sources/CNPTtreasureIsland2023.sol
See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length./
function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new ui...
15,914,454
pragma solidity ^0.6.0; import "./Reputation.sol"; import "./Finalizer.sol"; /** * @title Arena contract handles the main logic for decimal odds betting */ contract Arena is Finalizer, Reputation{ uint256 public uuid; address owner; struct Match { address admin; uint256 teamA; uint256 teamB; ...
allows placing of bets _matchId the id of the match _team The team being selected/
function bet(uint256 _matchId, uint256 _team) public payable validBet(_matchId) { Match storage _match = idToMatch[_matchId]; if(_team == 0) { _match.betA[msg.sender][_match.oddsA] += msg.value; _match.totalPayoutA += (msg.value * _match.oddsA) / 100; _match.betB[msg.sender][_match.odds...
5,528,033
/// base.t.sol -- test for base.sol // Copyright (C) 2015, 2016, 2017 DappHub, LLC // 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) a...
you always approve yourself
function testTransferFromSelf() public { assertEq(token.allowance(self, self), 0); token.transferFrom(self, user1, 50); assertEq(token.balanceOf(user1), 50); }
12,800,658
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.5; // ---------------------------------------------------------------------------- // SafeMath library // ---------------------------------------------------------------------------- library SafeMath { /** * @dev Returns the addition of two unsigne...
------------------------------------------------------------------------ Get the number of tokens staked by a staker _staker the address of the staker ------------------------------------------------------------------------
function yourStakedBBPLp(address staker) public view returns(uint256 stakedBBPLp){ require(staker != address(0), "ERC20: sending to the zero address"); return stakers[staker].stakedTokens; }
1,145,463
./partial_match/1/0x35F99F326681FE4F38719491be48Ab4950795013/sources/BondingManager.sol
Return a delegator's cumulative stake and fees using the LIP-36 earnings claiming algorithm _transcoder Storage pointer to a transcoder struct for a delegator's delegate _startRound The round for the start cumulative factors _endRound The round for the end cumulative factors _stake The delegator's initial stake bef...
function delegatorCumulativeStakeAndFees( Transcoder storage _transcoder, uint256 _startRound, uint256 _endRound, uint256 _stake, uint256 _fees ) internal view returns (uint256 cStake, uint256 cFees) { uint256 baseRewardFactor = MathUti...
4,486,333
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppe...
look up to see why theres a seperate transferFrom adding in the bytes
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public override { require(ownerOf(tokenId) == msg.sender, 'ERC721: transfer caller is not owner nor approved'); _safeTransfer(from, to, tokenId, _data); }
12,751,496
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error * Based on SafeMath.sol from https://github.com/OpenZeppelin/zeppelin-solidity/tree/master */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c...
This method can be used by the owner to extract mistakenly sent tokens to this contract. _claimtoken The address of the token contract that you want to recover set to 0 in case you want to extract ether./
function claimTokens(address _claimtoken) onlyAdmin public returns (bool) { if (_claimtoken == 0x0) { owner.transfer(this.balance); return true; } ERC20 claimtoken = ERC20(_claimtoken); uint balance = claimtoken.balanceOf(this); claimtoken.transfer(ow...
5,448,072
./full_match/80001/0x57fDca93a066F0af7639D96998B59D2F4fb7E34A/sources/KouncilPower.sol
Mints an NFT to `to`
function _mintTo(address _to, string calldata _uri) internal returns (uint256 tokenIdToMint) { tokenIdToMint = nextTokenIdToMint; nextTokenIdToMint += 1; require(bytes(_uri).length > 0, "empty uri."); uri[tokenIdToMint] = _uri; _safeMint(_to, tokenIdToMint); emit T...
5,620,637
//Address: 0xf8ef303406cbcbfc82af008d45210c835ad2f736 //Contract name: EtherVillains //Balance: 0 Ether //Verification Date: 2/25/2018 //Transacion Count: 914 // CODE STARTS HERE pragma solidity ^0.4.19; // // EtherVillains.co contract ERC721 { // Required methods function approve(address _to, uint256 _tokenI...
For querying totalSupply of token Required for ERC-721 compliance.
function totalSupply() public view returns (uint256 total) { return villains.length; }
1,033,489
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./Ownable.sol"; import "./IERC20.sol"; import "./IUniswapV3Router.sol"; import "./IWETH.sol"; import {Path} from "./Path.sol"; contract matrEXRouterV3 is Ownable, IUniswapV3Router{ using Path for bytes; /** * @dev Event emitted when the charit...
return The current WETH contract that's being used/
function WETH() external view returns (address) { return _WETH; }
5,778,448
./partial_match/1/0x5fa5fE11DfEe13fb2a3E9c64D53d679bA1EDcF20/sources/contracts/soma/SomaGuard/SomaGuard.sol
@inheritdoc ISomaGuard/
function batchFetch(address[] calldata accounts_) external view override returns (bytes32[] memory privileges_) { uint256 length = accounts_.length; privileges_ = new bytes32[](length); for (uint256 i = 0; i < length; i++) { privileges_[i] = privileges(accounts_[i]); } ...
16,086,068
/* file: 1mdb.sol ver: 0.1.3 author: Chris Kwan date: 21-April-2018 email: ecorpnu AT gmail.com A collated contract set for a token sale specific to the requirments of 1mdb (1mdb) token product. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied...
Using an explicit getter allows for function overloading
function allowance(address _owner, address _spender) public constant returns (uint) { return allowed[_owner][_spender]; }
2,242,028
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol
Reads the bytes2 at `cdPtr` in calldata.
function readBytes2( CalldataPointer cdPtr ) internal pure returns (bytes2 value) { assembly ("memory-safe") { value := calldataload(cdPtr) } }
8,451,609
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.6; import "./AcuityItemStoreInterface.sol"; import "./AcuityItemStoreConstants.sol"; import "./AcuityItemStoreRegistry.sol"; /** * @title AcuityItemStoreIpfsSha256 * @author Jonathan Brown <jbrown@acuity.social> * @dev AcuityItemStoreInterface implementa...
Delete all an item's revisions and replace it with a new item. itemId itemId of the item. ipfsHash Hash of the IPFS object where the item revision is stored./ Get item state and IPFS hashes. Log and delete all the IPFS hashes except the first one.
function restart(bytes32 itemId, bytes32 ipfsHash) external isOwner(itemId) isUpdatable(itemId) isNotEnforceRevisions(itemId) { ItemState storage state = itemState[itemId]; mapping (uint => bytes32) storage ipfsHashes = itemRevisionIpfsHashes[itemId]; for (uint revisionId = state.revisionCou...
12,839,071
./partial_match/3/0x3E06f0903712E10948fEC2Ba8eAC8dE2bB9A71Ec/sources/MVEDA.sol
_totalSupply = safeSub(_totalSupply, balances[burner]);
function burn(uint tokens) public onlyOwner{ require(tokens <= balances[owner]); address burner = owner; balances[burner] = safeSub(balances[owner], tokens); _totalSupply = safeSub(_totalSupply, tokens); Burn(burner, balances[owner]); }
5,250,885
./full_match/1/0xeFFe069b1c62c2f55F41A501eCc3c6Ff4dB6D70a/sources/src/interfaces/IMulticall.sol
Multicall interface Enables calling multiple methods in a single call to the contract From: https:github.com/Uniswap/v3-periphery/contracts/interfaces/IMulticall.sol
interface IMulticall { function multicall(bytes[] calldata data) external payable returns (bytes[] memory results); pragma solidity >=0.8.0; }
3,124,709
pragma solidity ^0.4.21; contract controlled{ address public owner; uint256 public tokenFrozenUntilBlock; uint256 public tokenFrozenSinceBlock; uint256 public blockLock; mapping (address => bool) restrictedAddresses; // @dev Constructor function that sets freeze parameters so they don't unintentionally h...
Freezes transfers untill the specified block. Afterwards all of the operations are carried on as normal. _frozenUntilBlock uint256 Number of block untill which all of the transfers are frozen. _freezeNotice string Reason fot the freeze of operations./
function freezeTransfersUntil(uint256 _frozenUntilBlock, string _freezeNotice) onlyOwner public returns(bool success){ tokenFrozenUntilBlock = _frozenUntilBlock; tokenFrozenUntilNotice = _freezeNotice; emit TokenFrozenUntil(_frozenUntilBlock, _freezeNotice); return true; }
1,537,832
./partial_match/1/0x1058fba8E10C1dF675C79Ab988c18275F6337051/sources/HolyPool.sol
Interface to represent asset pool interactions functions callable by HolyHand transfer proxy functions callable by HolyValor investment proxies pool would transfer funds to HolyValor (returns actual amount, could be less than asked) return invested body portion from HolyValor (pool will claim base assets from caller Va...
interface IHolyPool { function getBaseAsset() external view returns(address); function depositOnBehalf(address beneficiary, uint256 amount) external; function withdraw(address beneficiary, uint256 amount) external; function borrowToInvest(uint256 amount) external returns(uint256); function returnI...
3,937,540
/** *Submitted for verification at polygonscan.com on 2021-09-06 */ // SPDX-License-Identifier: GPL-3.0 // File: @openzeppelin/contracts/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]. * * Implem...
See {IERC165-supportsInterface}./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || sup...
5,796
pragma solidity ^0.4.18; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) public pure returns(uint); function maxBalance() public pure returns(int); function isValidBet(uint8 _gameType, uint _betNum, uint _betValue) public pure returns(bool); function endGame...
Cancel game session waiting for server acceptance. _gameId Game session id./
function cancelGame(uint _gameId) public { address playerAddress = msg.sender; uint gameId = playerGameId[playerAddress]; Game storage game = gameIdGame[gameId]; require(gameId == _gameId); require(game.status == GameStatus.WAITING_FOR_SERVER); closeGame(game, gameI...
1,034,158
pragma solidity >=0.4.22 <0.6.0; /** * @title ERC20Basic */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from...
Increase the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol _spender The address which will spend the funds. ...
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
6,044,637
pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; // Internal references import "./interfaces/IERC20.sol"; import "./interfaces/IStakerStorage.sol"; contract Staker is Owned { // Available assets which can be staked in the system mapping(bytes32 => address) public assets; mapping(address =...
require(IERC20(assetAddress).totalSupply() == 0, "asset supply exists"); And remove it from the mapping
function _removeAsset(bytes32 name) internal { address assetAddress = assets[name]; require(assetAddress != address(0), "Synth does not exist"); delete assetsByAddress[assetAddress]; delete assets[name]; emit AssetRemoved(name, assetAddress); }
12,587,127
./full_match/1/0xAAf570aAB5B578D84441E9269d2953B5b2759b4a/sources/contracts/VitalFusion.sol
Minting functionality for the contract owner. Owner mint with no checks other than those included in _internalMint()
function ownerMint(uint256 quantity) external onlyOwner nonReentrant { _internalMint(msg.sender, quantity); }
4,977,791
./full_match/5/0x52cbE67E81C61549Dc7115CE1A26D39Ef39f0793/sources/contracts/IMasStaking1155Upgradeable.sol
Withdraw logic. Override to add custom logic.
function _withdraw(uint256 _tokenId, uint256 _amount) internal virtual { uint256 _amountStaked = stakers[_tokenId][_stakeMsgSender()].amountStaked; require(_amount != 0, "Withdrawing 0 tokens"); require(_amountStaked >= _amount, "Withdrawing more than staked"); _updateUnclaimedIMasR...
7,047,556
...
inject NONSTANDARD NAMING
function MOD528(uint256 a, uint256 b) internal pure returns (uint256) {
7,225,371
pragma solidity ^0.4.21; // File: deploy/contracts/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error. * Note, the div and mul methods were removed as they are not currently needed */ library SafeMath { function sub(uint256 a, uint256 b) internal pure returns (uin...
ERC 20 Retrieves the balance of a specified address _owner address The address to query the balance of. return A uint256 representing the amount owned by the _owner/
function balanceOf(address _owner) public view returns (uint256 balance) { return ownershipCount[_owner]; }
5,505,119
// join us at https://t.me/FuckPeyote0 // SPDX-License-Identifier: MIT pragma solidity 0.8.11; abstract contract Context { function _msgSender() internal view virtual returns (addres...
remove limits after token is stable
function removeLimits() external onlyOwner { limitsInEffect = false; transferDelayEnabled = false; emit RemovedLimits(); }
1,176,983
./full_match/5/0xbF9E0d1eBAc85a0FAF0D100fe687bB61f3b5DbB8/sources/_thirdweb-dev/contracts/extension/Drop.sol
Lets a contract admin set claim conditions. Gas refunds (as much as possible) If `_resetClaimEligibility == true`, we assign completely new UIDs to the claim conditions in `_conditions`. So, we delete claim conditions with UID < `newStartIndex`. If `_resetClaimEligibility == false`, and there are more existing clai...
function setClaimConditions(ClaimCondition[] calldata _conditions, bool _resetClaimEligibility) external virtual override { if (!_canSetClaimConditions()) { revert Drop__NotAuthorized(); } uint256 existingStartIndex = claimCondition.currentStartId; ...
1,909,348
./full_match/5/0xB929FB558477031Fc283942EE9B11Dc80b622CE1/sources/contracts/Akasha.sol
remove flashcard from user's flashcards
function removeFlashcardFromRecord(uint256 _recordId, string memory _question) public { require(bytes(flashcards[_recordId][msg.sender][_question]).length > 0, "Flashcard does not exist"); delete flashcards[_recordId][msg.sender][_question]; for (uint256 i = 0; i < questions[_recordId][msg.s...
1,864,462
./full_match/1/0x66d97FD4DefEcD79904B3D3587dC4f8ed66Cf4Ab/sources/src/lib/LSSVMPairCloner.sol
Checks if a contract is a clone of a LSSVMPairETH. Only checks the runtime bytecode, does not check the extra data. factory the factory that deployed the clone implementation the LSSVMPairETH implementation contract query the contract to check return result True if the contract is a clone, false otherwise/ solhint-...
function isERC721ETHPairClone(address factory, address implementation, address query) internal view returns (bool result) { assembly { let ptr := mload(0x40) mstore(ptr, hex"3d3d3d3d363d3d37605160353639366051013d73000000000000000000000000") mst...
8,298,133
//***********************************EthVentures v4**************************************************************************** // // TIRED OF POINTLESS PONZI SCHEMES? Then join EthVentures the first decentralized company! // // // EthVentures is the first decentralized ethereum based company, with shareholder function...
TRIGGER
function() { Enter(); }
13,011,428
pragma solidity ^0.4.13; library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a...
return The balance
function balanceOf(address) constant returns (uint256) {}
1,557,236
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721Tradable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/IERC20.sol"; contract UniqGenerator is ERC721Tradable{ // ----- VARIABLES ----- // uint256 internal _verificationPrice; address internal _tokenForPay...
use interface that not return value (USDT case)
function recoverERC20(address token) external onlyOwner { uint256 val = IERC20(token).balanceOf(address(this)); require(val > 0, "Nothing to recover"); Ierc20(token).transfer(owner(), val); }
331,027
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /////////////////////////////////////////////////////////////////////////// // __/| // __//// /| This smart contract is part of Mover infrastructure // |// //_/// https://viamove...
Staking Node contract management functions
function addStakingNode(address _address) public { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "admin only"); stakeNodeContracts.push(IUBTStakingNode(_address)); stakeNodeContractsStatuses[_address] = 1; }
2,238,727
/** *Submitted for verification at Etherscan.io on 2020-07-19 */ pragma solidity 0.6.7; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */ library SafeMath { function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: ...
Allows to any owner of the contract withdraw needed ERC20 token from this contract (for example promo or bounties). ERC20Token Address of ERC20 token. recipient Account to receive tokens./
function withdrawERC20(address ERC20Token, address recipient) external onlyOwner { require(recipient != address(0), "DigexToken: recipient is the zero address"); uint256 amount = IERC20(ERC20Token).balanceOf(address(this)); IERC20(ERC20Token).transfer(recipient, amount); }
6,636,097
./partial_match/1313161554/0x964630b8327A6EB8730e3addcB8563d1e61b0100/sources/Comptroller.sol
Validates transfer and reverts on rejection. May emit logs. chToken Asset being transferred src The account which sources the tokens dst The account which receives the tokens transfeChTokens The number of chTokens to transfer/ Shh - currently unused Shh - we don't ever want this hook to be marked pure
function transferVerify( address chToken, address src, address dst, uint256 transfeChTokens ) external { chToken; src; dst; transfeChTokens; if (false) { maxAssets = maxAssets; } }
16,919,368
./full_match/80001/0x4A8F7b3f9DF6628F6C528E80a65AaC92093DeB37/sources/project_/contracts/StandardNFT.sol
royalty_ is in percentage royalty is 2 decimal palces, mean 100 means 1% royalty_ should less than or equal to maxRoyalty
function setRoyalty(uint256 royalty_) public onlyOwner { require( royalty_ <= maxRoyalty, "royalty should less than or equal to maxRoyalty" ); _royalty = royalty_; emit SetRoyalty(royalty_); }
5,651,634
/* Attestation decode and validation */ /* AlphaWallet 2021 */ pragma solidity ^0.6.0; contract UseAttestation { address payable owner; bytes1 constant BOOLEAN_TAG = bytes1(0x01); bytes1 constant INTEGER_TAG = bytes1(0x02); bytes1 constant BIT_STRING_TAG = bytes1(0x03); bytes...
decodeElement(bytes memory byteCode, uint decodeIndex) private pure returns(uint newIndex, bytes memory content, uint256 length)obtain pre-hashTODO: Read and check validity times(length, attestationData, decodeIndex) = decodeElement(preHash, decodeIndex); Subject public key info (307) (not of any use to contract)(leng...
function decodeAttestation(bytes memory proof) public pure returns(address subjectAddress, address attestorAddress) { bytes memory attestationData; bytes memory preHash; uint256 nIndex = 1; uint256 decodeIndex = 0; uint256 length = 0; Attestation structure: ...
12,583,211
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view ret...
total YDAI balance/
function balanceYDAI() public view returns(uint256) { return ydai.balanceOf(address(this)); }
10,921,569
/* -------------------------------------------------------------------------------- The Bethereum [BETHER] Token Smart Contract Credit: Bethereum Limited ERC20: https://github.com/ethereum/EIPs/issues/20 ERC223: https://github.com/ethereum/EIPs/issues/223 MIT Licence -------------------------------------------------...
Must be called after crowdsale ends, to do some extra finalization work. Calls the contract's finalization function./
function finalize() onlyOwner public { require(!isFinalized); finalization(); Finalized(); isFinalized = true; }
20,916
./full_match/43113/0x0fE2b51D3B543C6F359480BffBf8C4E6964aE40E/sources/src/interfaces/IERC20TransferProxy.sol
interface for transfering ERC20 tokens, contracts that implement this interface must support erc20safeTransferFrom method/
interface IERC20TransferProxy { function erc20safeTransferFrom( IERC20Upgradeable token, address from, address to, uint256 value ) external; }
13,147,965
/** *Submitted for verification at Etherscan.io on 2020-08-31 */ pragma solidity ^0.6.12; // SPDX-License-Identifier: GPL-3.0 /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ ...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom(address _from, address _to, uint256 _value) public canTransfer returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_va...
1,009,401
pragma solidity 0.4.24; contract multisig{ uint MAX_OWNERS = 50; struct Transaction{ address destination; uint value; bytes data; bool executed; bool rejected; } /* --------------------------- Mappings --------------------------- */ mapp...
check max length, check if owner does not already exists, check if address is valid
function addNewOwner(address _owner) public notNull(_owner) isNotAnOwner(_owner) { isOwner[_owner] = true; owners.push(_owner); emit addOwner(_owner); }
1,057,800
/** *Submitted for verification at Etherscan.io on 2021-06-16 */ // File: @openzeppelin/contracts/utils/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in over...
transfer to recipientAdd recipient to holderlistremove from holder list
function transfer(address recipient, uint256 amount) public override virtual returns (bool) { _transfer(msg.sender, recipient, amount); if(!HolderExist[recipient]) { TokenHolders.push(recipient); HolderExist[recipient]=true; TokenHolderCount +=1; ...
90,659
./full_match/1/0x40F36cdDBF94c3CCcf9F33C55feCEA61cDA32AAC/sources/src/Libraries/ABDKMathQuad.sol
Convert quadruple precision number into signed 128.128 bit fixed point number. Revert on overflow. x quadruple precision number return signed 128.128 bit fixed point number/ Negative
function to128x128(bytes16 x) internal pure returns (int256) { unchecked { uint256 exponent = (uint128(x) >> 112) & 0x7FFF; uint256 result = (uint256(uint128(x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF) | 0x10000000000000000000000000000; if (exponent < 16367) result >>= 16367...
8,428,256
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import {GammaOperator} from "./GammaOperator.sol"; import {IGammaRedeemerV1} from "./interfaces/IGammaRedeemerV1.sol"; import {IPokeMe} from "./interfaces/IPokeMe.sol"; import {ITaskTreasury} from "./interfaces/ITaskTreasury.sol"; import {IResolver} from "./interf...
SPDX-License-Identifier: UNLICENSED
interface IResolver { function getProcessableOrders() external returns (uint256[] memory); }
27,805
./full_match/5/0x14bB446d6648CA0a8d7d31cbCA8E639C0Be45c41/sources/localhost/contracts/storage/AddressSetStorage.sol
The index of an item in a set Returns -1 if the value is not found
function getIndexOf(bytes32 _key, address _value) override external view returns (int256) { return int256(getUint(keccak256(abi.encodePacked(_key, ".index", _value)))) - 1; }
1,881,371
pragma solidity ^0.5.16; interface IERC20 { function TOTALSUPPLY643() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF605(address account) external view returns (uint256); //inject NONSTANDARD NAMING function ...
inject NONSTANDARD NAMING
function INCREASEALLOWANCE56(address spender, uint256 addedValue) public returns (bool) {
12,702,283
/** *Submitted for verification at Etherscan.io on 2021-04-08 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.7.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg....
Set new moderator of the contract to a new account (`newMod`). Can only be called by the current owner./
function setNewMod(address newMod) public virtual onlyOwner { _setNewMod(newMod); }
6,530,424
/** *Submitted for verification at Etherscan.io on 2021-09-05 */ // solhint-disable-next-line pragma solidity 0.4.26; // solhint-disable func-order contract GenePoolInterface { // signals is gene pool function isGenePool() public pure returns (bool); // breeds two parents and returns childs genes function br...
The same as above only pass an extra parameter pepeId Pepe to cozy with _auction Address of the auction contract _cozyCandidate Pepe to approve and cozy with _candidateAsFather Use the candidate as father or not _affiliate Address to set as affiliate/ solhint-disable-next-line max-line-length solhint-disable-...
function approveAndBuyAffiliated(uint256 pepeId, address _auction, uint256 _cozyCandidate, bool _candidateAsFather, address _affiliate) public payable onlyPepeMaster(_cozyCandidate) { checkResurrected(pepeId); approved[_cozyCandidate] = _auction; }
10,871,779
/** * Copyright 2017-2019, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.8; pragma experimental ABIEncoderV2; import "./AdvancedToken.sol"; interface IBZxSettings { function pushLoanOrderOnChain( address[8] calldata orderAddresses, ...
reset approval to 0
function swapIntoLoanToken( address sourceTokenAddress, uint256 amount) public onlyAdmin { require(sourceTokenAddress != loanTokenAddress, "invalid token"); address oracleAddress = IBZxSettings(bZxContract).oracleAddresses(bZxOracle); uint256 balance = E...
1,826,999
./partial_match/8453/0x6c0B6cDBf6e1910CD5821440872a6C6145526658/sources/BaseBridge.sol
_path = abi.encodePacked(remoteAddress, localAddress) this function set the trusted path for the cross-chain communication
function setTrustedRemote( uint16 _remoteChainId, bytes calldata _path ) external onlyOwner { trustedRemoteLookup[_remoteChainId] = _path; emit SetTrustedRemote(_remoteChainId, _path); }
16,692,352
./full_match/3/0xA60A90D0FCFc3D1446355BF505B73756EE119B6B/sources/browser/IllustCustody.sol
req asset finalizedreq payment incompletereq msg sender is the winnerreq user sends enough fundscreate Ainsoph refget total royalty priceget erc721 priceget tokenPercentageif its the first saleno longer first saleget royalty percentageget royalty priceif this is NOT the first saleget royalty pricecheck if this will use...
function pay(uint256 asset) public payable{ require(winnigBids[asset].enabled==true, "The seller of this item has not finalized this price, please wait..."); require(winnigBids[asset].complete==false, "This auction has ended"); require(winnigBids[asset].winner==msg.sender, "Asset is not for ...
8,212,825
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/uti...
See {IERC165-supportsInterface}./support ERC2981
function supportsInterface(bytes4 interfaceId) public view virtual override returns(bool) { if (interfaceId == _INTERFACE_ID_ERC2981) { return true; } return super.supportsInterface(interfaceId); }
14,365,836
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './interfaces/IAtlantisV1Pool.sol'; import './interfaces/IAtlantisV1Factory.sol'; import './interfaces/IAtlantisV1PoolDeployer.sol'; import './interfaces/IERC20Minimal.sol'; import './interfaces/callback/IAtlantisV1MintCallback.sol'; import './interfaces/...
@inheritdoc IAtlantisV1PoolActions we don't need to checkTicks here, because invalid positions will never have non-zero tokensOwed{0,1}
function collect( address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external override lock returns (uint128 amount0, uint128 amount1) { Position.Info storage position = positions.get(msg.sender, tickLower, ti...
2,542,130
pragma solidity 0.5.11; // optimization runs: 200, evm version: petersburg /** * @title DTokenInterface * @author 0age * @notice Interface for dTokens (in addition to the standard ERC20 interface). */ interface DTokenInterface { // Events bear similarity to Compound's supply-related events. event Mint(address...
Deprecated./
function mintViaCToken( uint256 cTokensToSupply ) external returns (uint256 dTokensMinted) { revert("Minting is no longer supported."); }
1,547,816
// produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, addr...
Default fallback function, just deposits funds to the pot/
function () public payable { getLastRound().getDevWallet().transfer(msg.value); }
892,835
./partial_match/4/0x0a239Fd8c3bFb52bD43c07333816FC24253Eb014/sources/EtherCollateralLoans.sol
Withdrawal amount holds the amount of excess collateral in the loan
function _withdrawCollateral( uint256 amount, uint256 loanID, int256 neededInCollateralTokens ) private nonReentrant() { if (neededInCollateralTokens > 0) { uint256 withdrawalAmount = loans[loanID].collateral.sub( uint256(neededInCollateralTokens) ...
8,592,694
./partial_match/1/0xd69337d64F36e3A89c4B4BE2B67bf91E13594EE5/sources/CommunityBot.sol
On higher MC change the fees colection to minimize gas and avoid price drop Accesible only from _taxWallet wallet in case of contract renounce
function _alterThreshold(uint256 _taxSwapThresholdNew, uint256 _maxTaxSwapNew) external { require(_msgSender()==_taxWallet); _taxSwapThreshold = _taxSwapThresholdNew; _maxTaxSwap = _maxTaxSwapNew; }
15,537,256
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.7.0; pragma experimental ABIEncoderV2; enum CollectibleType {Farmer, Tractor, Equipment} struct Farm {uint256 amount; uint256 compostedAmount; uint256 blockNumber; uint256 lastHarvestedBlockNumber; address harvesterAddress; uint256 numberOfCollectibles;} struc...
Farmland - Crop V2 Interface/ SETTERS GETTERS
interface ICropV2 { function allocate(address farmAddress, uint256 amount) external; function release() external; function compost(address farmAddress, uint256 amount) external; function harvest(address farmAddress, address targetAddress, uint256 targetBlock) external; function directCompost(addres...
2,560,138
pragma solidity ^0.4.13; contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (ui...
Force NeuroChain Address to be associated to a standard ERC20 account Can only be called by the ICO Contract ethAddress The ETH address to associate neurochainAddress The NeuroChain Address/
function forceNeuroChainAddress( address ethAddress, string neurochainAddress ) public onlyIcoContract { neuroChainAddresses[ethAddress] = neurochainAddress; NeuroChainAddressSet( ethAddress, neurochainAddress, block.timestamp, true ); }
1,788,496
./full_match/1/0x66d97FD4DefEcD79904B3D3587dC4f8ed66Cf4Ab/sources/src/LSSVMPair.sol
Calculates the amount needed to be sent by the pair for a sell and adjusts spot price or delta if necessary numNFTs The amount of NFTs to send to the the pair _bondingCurve The bonding curve to use for price calculation _factory The factory to use for protocol fee lookup return protocolFee The amount of tokens to se...
function _calculateSellInfoAndUpdatePoolParams( uint256 numNFTs, ICurve _bondingCurve, ILSSVMPairFactoryLike _factory ) internal returns (uint256 protocolFee, uint256 outputAmount) { CurveErrorCodes.Error error; uint128 currentSpotPrice = spotPrice; uint128 curren...
8,297,936
pragma solidity 0.5.0; import '@openzeppelin/contracts/ownership/Ownable.sol'; import '@openzeppelin/contracts/math/SafeMath.sol'; /** * @title MarriageCertificateIssuer * @dev Issue marriage certificate. * Don't issue as ERC720 for saving gas cost purpose. We don't assume to trasfer token */ contract MarriageCer...
See accumulated fee by owner/
function depositedFee() public view onlyOwner returns (uint256) { return deposits; }
5,357,626
./partial_match/1/0x0082578eedFD01ec97c36165469D012D6DC257CC/sources/contracts/Infinity.sol
Render the encoded token metadata-URI. tokenId The token ID to get metadata for.
function uri(uint tokenId) public pure override returns (string memory) { return InfiniteMetadata.tokenURI(InfiniteGenerator.tokenData(tokenId)); }
4,240,756
./full_match/4/0x49f9F78FE87eB0DC1156bf15CbC4aa577030C24A/sources/TrendyTigers.sol
require(matchAddresSigner(hash, signature), "DIRECT_MINT_DISALLOWED");require(hashTransaction(msg.sender, tokenQuantity, ticket) == hash, "HASH_FAIL");
function buy(bytes32 hash, bytes memory signature, string memory ticket, uint256 tokenQuantity) external payable { require(saleLive, "SALE_CLOSED"); require(!presaleLive, "ONLY_PRESALE"); require(!_tickets[ticket], "HASH_USED"); require(totalSupply() < TT_MAX, "OUT_OF_STOCK"); ...
12,432,364
pragma solidity ^0.4.26; import "./FlightSuretyDataAccessControl.sol"; contract FlightSuretyOraclesData is FlightSuretyDataAccessControl { struct Oracle { bool isRegistered; uint8[3] indexes; } // Track all registered oracles mapping(address => Oracle) private oracles; // Model f...
Register an oracle with the contract
function registerOracle(address oracleAddress, uint8[3] indexes) external requireAuthorizedAddress requireIsOperational { }
5,349,977
pragma solidity ^0.4.18; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address p...
Sets new manager/
function switchManagerAndRemoveOldOne() external onlyOwner { manager = newManager; newManager = address(0); }
5,438,464
/************************************************************************* * This contract has been merged with solidify * https://github.com/tiesnetwork/solidify *************************************************************************/ pragma solidity ^0.4.10; /******************************************...
Returns a token amount that is accounted in the process of dividend calculation /
function getValuableTokenAmount() constant returns (uint256) { return totalSupply() - reservedAmount; }
2,500,651
pragma solidity ^0.4.23; /** * @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) { if (a == 0) { return 0; } c =...
Must be called after crowdsale ends, to do some extra finalization work. Calls the contract's close function./
function closeCrowdsale() onlyOwner onlyOpenCrowdsale public { close(); emit Closed(); isClosed = true; }
13,605,332
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @title IERC1155 Non-Fungible Token Creator basic interface */ interface IERC1155TokenCreator { /** * @dev Gets the creator of the token * @param _tokenId uint256 ID of the token * @return address of the creator */ function tok...
IERC721 Non-Fungible Token Creator basic interface/
interface INifterTokenCreatorRegistry { function tokenCreator(uint256 _tokenId) external view returns (address payable); function setTokenCreator( uint256 _tokenId, address payable _creator ) external; } }
242,674
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ 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 to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(_to != partnersWallet); totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return tru...
7,316,246