file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0x31F41455974dCFEBED0d9193685620de8205a580/sources/AlienMilady.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Alien Milady", "ALIEN") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair =...
15,735,835
pragma solidity 0.4.24; import "@aragon/templates-shared/contracts/BaseTemplate.sol"; import { IHookedTokenManager as HookedTokenManager } from "./external/IHookedTokenManager.sol"; import {IIssuance as Issuance} from "./external/IIssuance.sol"; import {ITollgate as Tollgate} from "./external/ITollgate.sol"; impor...
acl.createPermission(issuance, hookedTokenManager, hookedTokenManager.ISSUE_ROLE(), disputableVoting); acl.createPermission(issuance, hookedTokenManager, hookedTokenManager.ASSIGN_ROLE(), disputableVoting); acl.createPermission(issuance, hookedTokenManager, hookedTokenManager.REVOKE_VESTINGS_ROLE(), disputableVoting);
function _createHookedTokenManagerPermissions( ACL acl, DisputableVoting disputableVoting, HookedTokenManager hookedTokenManager, Issuance issuance ) internal { acl.createPermission( issuance, hookedTokenManager, hookedTokenManager.MINT...
5,461,932
./partial_match/1/0x314CEf817c95182f73C787eBB9D0BD2c4213acB5/sources/ANDY.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer( address sender, address recipient, uint256 amount ) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); emit Log("The best way to predict th...
16,001,574
pragma solidity 0.4.24; import "../interfaces/ERC20.sol"; import "../interfaces/ProxySupportedERC20Interface.sol"; import "./AdminProxy.sol"; /** * @title ERC20 Proxy contract that forwards ERC20 functionality to an actual * token contract implementation. */ contract ERC20Proxy is ERC20, AdminProxy { /** ...
Returns the symbol of the token. return Symbol of the token./
function symbol() public view returns (string) { return ERC20(token).symbol(); }
12,939,196
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can...
function canTransition(uint256 _vaultId, OLib.State _state) external view returns (bool); SPDX-License-Identifier: AGPL-3.0 Global values used by many contracts This is mostly used for access control/
interface IRegistry is IAccessControl { function paused() external view returns (bool); function pause() external; function unpause() external; function enableFeatureFlag(bytes32 _featureFlag) external; function disableFeatureFlag(bytes32 _featureFlag) external; function getFeatureFlag(bytes32 _feature...
14,555,317
./full_match/43113/0x15BC25e8140dBee142247ea751bA068Ca50e46C4/sources/LendingPool_flat.sol
mint it 1:1 to the amount put inuint256 isFirstDeposit = balances[msg.sender].isFirstDeposit;if (isFirstDeposit == 0) { get fee set first deposit to false balances[msg.sender].isFirstDeposit = 1;} Updates User balancebalances[msg.sender].balance = balances[msg.sender].balance.add(_amount); Update total deposited in ...
function deposit(uint256 _amount) external { require(_amount > 0, "Can't deposit 0"); _mint(msg.sender, _amount); }
7,154,133
./full_match/1/0x86B32fb3d8b08278cE9EB643EFE59a1a85c15203/sources/bot.sol
If `self` starts with `needle`, `needle` is removed from the beginning of `self`. Otherwise, `self` is unmodified. self The slice to operate on. needle The slice to search for. return `self`/
function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) { if (self._len < needle._len) { return self; } bool equal = true; if (self._ptr != needle._ptr) { assembly { let length := mload(needle) ...
4,891,417
./full_match/5/0xd9d8b4dfD53319aDDfcDb2E6cE6c317FE288D19B/sources/contracts/ecosystem/RandToken.sol
Function to allow admins to move funds without multiple approve and transfer steps Aims to allow simple UX owner is the address who's tokens are approved and transferred recipient is the address where to transfer the funds amount is the amount of transfer
function safetyModuleTransfer( address owner, address recipient, uint256 amount ) external whenNotPaused { require( REGISTRY.getAddressOf(SAFETY_MODULE) == _msgSender(), "RND: Not accessible by msg.sender" ); _transfer(owner, recipient, amo...
1,876,454
./partial_match/1/0x5505054d8a85a6024d81857BF43f52D767970587/sources/Treasury.sol
Returns amount of excess reserves return value_ Excess reserves
function excessReserves() external view returns (uint256 value_) { uint256 _balance = IERC20(WETH).balanceOf(address(this)); uint256 _value = (_balance * 1e9) / BACKING; if (IERC20(QWT).totalSupply() > _value) return 0; return (_value - IERC20(QWT).totalSupply()); }
11,029,685
./full_match/1/0xD975C2E388179B741401F0e88879090751bb1acD/sources/contracts/doods.sol
require(freemintActive, "free mint is not active.");
function flipSale() public onlyOwner { saleActive = !saleActive; }
9,823,447
./full_match/11155111/0xb12C52dc4D8ADb4fe7DB08A2D9b1D191abb4AB04/sources/src/TokenFactory.sol
deploy contract with CREATE2 opcode/
function deploy( bytes memory bytecode, uint256 salt ) internal returns (address addr) { assembly { addr := create2( callvalue(), add(bytecode, 0x20), mload(bytecode), salt ) if iszero(ext...
3,812,575
./full_match/5/0x02B727D7ac6B48e7D110E2ac3F9c98e9177AfCE7/sources/contracts/shnucoin.sol
Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./
function _burn(address account, uint256 amount) public isOwner virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: bu...
1,868,671
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/Marketplace.sol
Verifies Brightlist For Presale Fixed Price Sale/
function VerifyBrightListWithPriority(uint SaleIndex, address _Wallet, bytes32 _Root, bytes32[] calldata _Proof) public view returns (bool, uint) { bytes32 _Leaf = keccak256(abi.encodePacked(_Wallet)); return (false, 69420); }
8,471,328
/** *Submitted for verification at Etherscan.io on 2020-08-11 */ pragma solidity 0.6.0; /** * @title Offering contract * @dev Offering logic and mining logic */ contract Nest_NToken_OfferMain { using SafeMath for uint256; using address_make_payable for address; using SafeERC20 for ERC20; ...
Create offer ethAmount Offering ETH amount erc20Amount Offering erc20 amount erc20Address Offering erc20 address/ Check offer conditions Create offering contract Record price
function createOffer(uint256 ethAmount, uint256 erc20Amount, address erc20Address, bool isDeviate, uint256 mining) private { require(ethAmount >= _leastEth, "Eth scale is smaller than the minimum scale"); require(ethAmount % _offerSpan == 0, "Non comp...
7,993,948
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.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...
------- Internal functions below here:
function createTokenWithId(uint256 tokenId, bytes32 uuid, address to) internal { require(!_exists(tokenId), "Token already exists."); _safeMint(to, tokenId); uuidToTokenId[uuid] = tokenId; tokenIdToUuid[tokenId] = uuid; emit TokenCreated(bytes32ToUUIDString(uuid), to); }...
485,234
./partial_match/4/0x8619ce3bd7827AA4bD0E9787EE27e74FBb3A2Dfa/sources/SmolStudio.sol
Will emit a specific URI log event for corresponding token _tokenIDs IDs of the token corresponding to the _uris logged _URIs The URIs of the specified _tokenIDs/
function _logURIs(uint256[] memory _tokenIDs, string[] memory _URIs) internal { require(_tokenIDs.length == _URIs.length, "erc1155metadata#_loguris: INVALID_ARRAYS_LENGTH"); for (uint256 i = 0; i < _tokenIDs.length; i++) { emit URI(_URIs[i], _tokenIDs[i]); } }
8,581,220
./partial_match/56/0x956BcE4F086dC4579B960ED80336Ef79737cDaa3/sources/StrategyVenusBNBV2.sol
Updates the risk profile and rebalances the vault funds accordingly. _borrowRate percent to borrow on each leverage level. _borrowDepth how many levels to leverage the funds./
function rebalance(uint256 _borrowRate, uint256 _borrowDepth) external onlyOwner { require(_borrowRate <= BORROW_RATE_MAX, "!rate"); require(_borrowDepth <= BORROW_DEPTH_MAX, "!depth"); _deleverage(); borrowRate = _borrowRate; borrowDepth = _borrowDepth; ...
11,337,917
./full_match/11155111/0x298F37fFd4B31d216B8954968cEe7EC5273CB891/sources/src/Streams.sol
Extracts streamId from a `StreamConfig` `config` has value: `streamId (32 bits) | amtPerSec (160 bits) | start (32 bits) | duration (32 bits)` By bit shifting we get value: `zeros (224 bits) | streamId (32 bits)` By casting down we get value: `streamId (32 bits)`
function streamId(StreamConfig config) internal pure returns (uint32) { return uint32(StreamConfig.unwrap(config) >> 224); }
3,819,411
./partial_match/1/0x0429D0A028D6A8a6Ea50eAaCfe1137bB30156E9d/sources/TradeAccounting.sol
File: contracts/interface/ISystemSettings.sol
interface ISystemSettings { function issuanceRatio() external view returns(uint); }
2,670,621
./full_match/4/0xFa7C4A968A072beB9210ecb93C98d1ccE61e189c/sources/browser/GameShop.sol
check if accounts already contains the address of the player
function containsAddress(address _address) private returns (bool){ return accounts[_address]; }
13,339,268
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import './Mars26.sol'; import './MarsStorage.sol'; /** * @title Mars ...
Returns the set token URI, i.e. IPFS v0 CID, of {initialSequenceIndex}./ If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
function tokenURIOfInitialSequenceIndex(uint256 initialSequenceIndex) public view returns (string memory) { require(_startingIndex > 0, "Tokens have not been assigned yet"); string memory tokenCID = initialSequenceTokenCID(initialSequenceIndex); string memory base = _baseURI(); if ...
7,025,237
./partial_match/5/0xc54455e1Ac910e3e4Edd7dbdb8EA46F97f806E69/sources/MISOLiquidityLauncher.sol
Single gateway to initialize the MISO Liquidity Launcher with proper address Can only be initialized once/
function initMISOLiquidityLauncher(address _accessControls, address _WETH) external { require(!initialised); initialised = true; accessControls = MISOAccessControls(_accessControls); WETH = _WETH; emit MisoInitLiquidityLauncher(msg.sender); }
16,860,346
//Address: 0x3aaa175924a77ee4b40606f714b727331e430ece //Contract name: MonsterCreatorInterface //Balance: 0 Ether //Verification Date: 1/19/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.11; contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original...
users won't be able to rename a monster that is part of an auction some string checks...?
function changeMonsterNickname(uint256 _tokenId, string _name) public { require(_owns(msg.sender, _tokenId)); monsterIdToNickname[_tokenId] = _name; }
932,342
/** *Submitted for verification at Etherscan.io on 2022-04-19 */ /** https://t.me/peacawk https://twitter.com/PeacawkETH */ // SPDX-License-Identifier: MIT pragma solidity 0.8.9; abs...
exclude from paying fees or having max transaction amount
constructor() ERC20("PEACAWK", "PEACAWK") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair =...
10,889,446
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; /** __ __ __________ _____ _____.__ _________ / \ / \ ____ ____\______ \_____ _/ ____\/ ____\ | ____ / _____/ ___________ \ \/\/ // __ \ / \| _/\__ \\ __\\ __\| | _/ __ \ \_____...
mints allowed only by the whitelisted addresses with signature
function whitelistMint(uint256 _quantity, bytes memory _signature) external payable whenNotPaused nonReentrant { require(block.timestamp >= WHITELIST_START_TIME, "Whitelist sale has'nt yet started"); require(addressToMints[msg.sender]+ _quantity<=MAX_PER_WHITELISTED_WALLET,"Max mints reached"); ...
14,836,948
//Address: 0x2c1bf16a6ab64c2d55d916ba928138e488d3785a //Contract name: XRTToken //Balance: 0 Ether //Verification Date: 2/9/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.19; contract Token { function totalSupply() public constant returns (uint256 supply) {} function balanceOf(address...
generate a public event on the blockchain
{ function _transfer(address _from, address _to,uint256 _value) internal { require(_to != 0x0); require(balances[_from] >= _value); require(balances[_to] + _value > balances[_to]); balances[_from] -= _value; balances[_to] += _value; Transfer(_from,_to,_value); ...
6,427,802
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "../upgrades/GraphUpgradeable.sol"; import "../utils/TokenUtils.sol"; import "./IStaking.sol"; import "./StakingStorage.sol"; import "./libs/MathUtils.sol"; impor...
Delegate tokens to an indexer. _delegator Address of the delegator _indexer Address of the indexer to delegate tokens to _tokens Amount of tokens to delegate return Amount of shares issued of the delegation pool/ Only delegate a non-zero amount of tokens Only delegate to non-empty address Only delegate to staked ind...
function _delegate( address _delegator, address _indexer, uint256 _tokens ) private returns (uint256) { require(_tokens > 0, "!tokens"); require(_indexer != address(0), "!indexer"); require(stakes[_indexer].tokensStaked > 0, "!stake"); DelegationPool stor...
6,055,188
./full_match/44787/0xBDb3FAF8fD6668cc92931191e9388B5335cbfBe1/sources/contracts/OffsetHelper.sol
Allow users to withdraw tokens they have deposited./
function withdraw(address _erc20Addr, uint256 _amount) public { require(balances[msg.sender][_erc20Addr] >= _amount, "Insufficient balance"); IERC20(_erc20Addr).safeTransfer(msg.sender, _amount); balances[msg.sender][_erc20Addr] -= _amount; }
13,286,469
./full_match/5/0xfd16CEC145F5C3BD9a21aB34d505CF564d1cD1d4/sources/src/Narwhal.sol
take AUM snapshot at closing
function adminOpenDeposit(bool open) external whenNotPaused onlyOwner { poolOpen = open; if (open) { poolSettle = false; } else { for (uint256 i = 0; i < supportedTokens.length; ++i) { address token = supportedTokens[i]; for (u...
7,089,749
./full_match/1/0x930AAD10a036b44708e9B371D284DA4a547B95AE/sources/browser/ETHERBOOBS.sol
Provable function/
function updatePrice() public payable { if (provable_getPrice("URL") > address(this).balance) { LogNewProvableQuery("Provable query was NOT sent, please add some ETH to cover for the query fee"); LogNewProvableQuery("Provable query was sent, standing by for the answer.."); } ...
17,054,621
./full_match/1/0x4fd5Ae48A869c5ec0214CB050D2D713433515D8d/sources/contracts/feeders/QuickswapLPFeeder.sol
get current timmestamp return _getTimestamp();
function getTimestamp() external view override returns (uint256) { return now; }
9,715,984
// File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually...
Function to pause all the circulation in the case of emergency./
function pause() public onlyOwner { paused = true; }
2,289
./full_match/1/0xe05447ae2426c4bEb7733c90058C00cC32ABfe49/sources/src/Kong/Treasury.sol
Withdraw stuck token from treasury _amount Amount of token to remove _token Address of token to remove
function withdrawStuckToken(uint256 _amount, address _token) external onlyOwner { require(_token != uniswapV2Router.WETH(), "Can not withdraw WETH"); require(_token != uniswapV2Pair, "Can not withdraw LP"); IERC20(_token).transfer(msg.sender, _amount); }
8,304,421
./full_match/5/0x23c4aC6762A6BfFED15dee634D3C8Dc42EE2Bd11/sources/contracts/CrowdFunding.sol
mapping of the compaign
function donatedToCampaign(uint256 _id) public payable { uint256 amount = msg.value; Campaign storage campaign = campaigns[_id]; campaign.donators.push(msg.sender); campaign.donations.push(amount); if (sent) { campaign.amountCollected = campaign.amountCollected ...
1,952,393
pragma solidity 0.4.24; pragma experimental "v0.5.0"; /* Copyright 2018 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENS...
Gets if a position is currently margin-called. positionId Unique ID of the position return True if the position is margin-called/
function isPositionCalled( bytes32 positionId ) external view returns (bool) { return (state.positions[positionId].callTimestamp > 0); }
1,594,124
./full_match/3/0x7295C2BE0Fabca03ED3514C3dd99658EbC25f3f3/sources/browser/Contract_Code_v2_Min.sol
Create store user information (db) addr user address code user invite Code rCode recommend code/
function _registerUser(address addr, string memory code, string memory rCode) internal { db.registerUser(addr, code, rCode); }
8,114,052
./partial_match/1/0xF0a707dad7F2448dFB2B9D85BED522A6CbbfAE13/sources/lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC4626Upgradeable.sol
Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way./
function _tryGetAssetDecimals(IERC20Upgradeable asset_) private view returns (bool, uint8) { (bool success, bytes memory encodedDecimals) = address(asset_).staticcall( abi.encodeWithSelector(IERC20MetadataUpgradeable.decimals.selector) ); if (success && encodedDecimals.length >= ...
3,906,782
/** *Submitted for verification at Etherscan.io on 2020-09-18 */ /** *Submitted for verification at Etherscan.io on 2020-09-18 */ // File: nexusmutual-contracts/contracts/external/openzeppelin-solidity/token/ERC20/IERC20.sol pragma solidity 0.5.7; /** * @title ERC20 interface * @dev see https://github.com/ethe...
Changes the existing Short Term Load Period (STLP) value.
function _changeSTLP(uint _stlp) internal { stlp = _stlp; }
7,286,923
// Copied from https://github.com/OpenZeppelin/openzeppelin-contracts-ethereum-package/blob/v3.0.0/contracts/Initializable.sol // Added public isInitialized() view of private initialized bool. // SPDX-License-Identifier: MIT pragma solidity 0.6.10; /** * @title Initializable * * @dev Helper contract to support ini...
Internal function for loan repayment If _amount is sufficient, then this also settles the loan _sender account sending token to repay _amount amount of token to repay/
function _repay(address _sender, uint256 _amount) internal onlyAfterWithdraw { require(_amount <= debt.sub(_balance()), "LoanToken2: Cannot repay over the debt"); emit Repaid(_sender, _amount); token.safeTransferFrom(_sender, address(this), _amount); if (isRepaid()) { se...
1,718,048
./full_match/43114/0x54e1778e3E618429005dAeD5213791073B948C2D/sources/joe.sol
Total number of tokens Creates `_amount` token to `_to`. Must only be called by the owner (MasterJoe).
function mint(address _to, uint256 _amount) public onlyOwner { require( totalSupply().add(_amount) <= maxSupply, "JOE::mint: cannot exceed max supply" ); _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); }
4,515,677
// This file is MIT Licensed. // // From: https://gist.githubusercontent.com/chriseth/f9be9d9391efc5beb9704255a8e2989d/raw/4d0fb90847df1d4e04d507019031888df8372239/snarktest.solidity // // Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this soft...
Convenience method for a pairing check for two pairs.
function pairingProd2(G1Point a1, G2Point a2, G1Point b1, G2Point b2) constant internal returns (bool) { G1Point[] memory p1 = new G1Point[](2); G2Point[] memory p2 = new G2Point[](2); p1[0] = a1; p1[1] = b1; p2[0] = a2; p2[1] = b2; return pairing(p1, p2); }
6,444,237
// 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...
Approve all required tokens
function _approveToken(uint256 _amount) internal override { collateralToken.safeApprove(pool, _amount); collateralToken.safeApprove(address(yToken), _amount); }
10,367,768
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function _CALLOPTIONALRETURN137(IERC20 token, bytes memory data) private {
14,087,539
// File: contracts\token\ERC721\IERC721Metadata.sol // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.5; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they sh...
Gets the owner of a tokenId/
function ownerOf(uint256 tokenId) public view virtual returns (address) { return _tokenOwners[tokenId].owner; }
11,952,421
./full_match/421613/0x1C8959eC205bb7663Da438F505079E2b412d888B/sources/src/staking/StakedERC721.sol
Calculates the rewards for specific tokens under an address account - account to check tokenIds - token ids to check against return rewards/
function calculateRewards( address account, uint256[] memory tokenIds ) external view returns (uint256[] memory rewards) { rewards = new uint256[](tokenIds.length); for (uint256 i; i < tokenIds.length; i++) { rewards[i] = _calculateReward(account, tokenIds[i]); ...
11,565,273
./full_match/80001/0x3a5AFce26bc4ba6bdeC6C15533Ef74F1e5D994B3/sources/contracts/IERC721.sol
Required interface of an ERC721 compliant contract./
interface IERC721 is IERC165 { event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); event Approval( address indexed owner, address indexed approved, uint256 indexed tokenId ); event ApprovalForAll( address inde...
9,521,562
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, sinc...
Interface to C-folio item bridge/
interface ICFolioItemBridge { function safeBatchTransferFrom( address from, address to, uint256[] memory tokenIds, uint256[] memory amounts, bytes memory ) external; function burnBatch( address from, uint256[] calldata tokenIds, uint256[] calldata amounts ) external; function...
13,471,507
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, s...
Get the tokens that exist for this wallet
{ uint256 ownerTokenCount = balanceOf(_owner); uint256[] memory tokenIds = new uint256[](ownerTokenCount); function walletOfOwner(address _owner) public view returns (uint256[] memory) for (uint256 i; i < ownerTokenCount; i++) { tokenIds[i] = tokenOfOwnerByIndex(_owner, i); } return tokenI...
14,782,020
pragma solidity^0.4.24; contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is ...
Get information about the latest campaign or the next campaign if the last campaign has ended, but no new one has started
function latestData() external view returns( uint price, uint jackpot, uint char, uint64 deadline, uint presses, address lastPresser ) { price = this.price(); jackpot = this.jackpot(); char = this.charityBalance(); deadline = this.deadline(); presses = this.pr...
7,266,148
./partial_match/1/0x51DF59fa999b56c351B92E933aFD177Ef9c0003f/sources/PaymentSplitter.sol
releases payments for all payees for ETH and all tokensfor each payeefor each token
function _withdraw() internal virtual { for (uint256 i = 0; i < _payees.length; i++) { for (uint256 j = 0; j < _tokenList.length; j++) { IERC20 token = _tokenList[j]; _releaseToken(token, payable(_payees[i])); } _release(payable(_payees[i...
3,564,135
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\\ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\\ //@@@@@@@@@@@@@@@...
set the configuration of the LayerZero messaging library of the specified version _version - messaging library version _chainId - the chainId for the pending config change _configType - type of configuration. every messaging library has its own convention. _config - configuration in the bytes. can encode arbitrary ...
interface ILayerZeroUserApplicationConfig { function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external; function setSendVersion(uint16 _version) external; function setReceiveVersion(uint16 _version) external; functi...
2,422,513
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "./IO.sol"; import "./Storage.sol"; import "./Constants.sol"; import "../lib/ABDKMath64x64.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/Saf...
Gets the amount of assets backing each Basket token return (the addresses of the assets, the amount of backing 1 Basket token)
function getOne() public view returns (address[] memory, uint256[] memory) { uint256[] memory amounts = new uint256[](assets.length); uint256 supply = totalSupply(); for (uint256 i = 0; i < assets.length; i++) { amounts[i] = ERC20(assets[i]).balanceOf(address(this)).mul(1e18).d...
1,427,436
pragma solidity ^0.4.14; import "github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol"; import "github.com/OpenZeppelin/zeppelin-solidity/contracts/token/MintableToken.sol"; contract HappySeptember is Ownable { address public tokenAddress = 0x97d961543CBf38BE1335b123C4f87767e58ae2...
The msg.sender must call approve(this, balance) beforehand so that transferFrom() will work and not throw. 0-9 x10 10-19 x5 20-29 x3 30-39 x2 40-49 x2 50-99 x0
function play(uint _amount) returns (uint) { require(_amount > 0 && allowance(msg.sender) == _amount); token.transferFrom(msg.sender, this, _amount); bytes32 randomHash = sha3(block.blockhash(block.number-1),_amount, msg.sender); uint random100 = uint(randomHash) % 100; uint...
14,097,483
// File: contracts/GodMode.sol /**************************************************** * * Copyright 2018 BurzNest LLC. All rights reserved. * * The contents of this file are provided for review * and educational purposes ONLY. You MAY NOT use, * copy, distribute, or modify this software without * explicit writte...
The allowance for a spender on an account _tokenOwner The account that allows withdrawels _spender The account that is allowed to withdraw return The amount remaining in the allowance
function allowance(address _tokenOwner, address _spender) public constant returns(uint remaining) { return allowances[_tokenOwner][_spender]; }
416,166
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/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 functi...
Calculate the amount of underlying token available to withdraw when withdrawing via only single token account the address that is withdrawing tokens tokenAmount the amount of LP token to burn tokenIndex index of which token will be withdrawn return availableTokenAmount calculated amount of underlying token available...
function calculateRemoveLiquidityOneToken( address account, uint256 tokenAmount, uint8 tokenIndex ) external view virtual returns (uint256 availableTokenAmount) { return swapStorage.calculateWithdrawOneToken( account, tokenAmount, ...
35,131
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.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 functions. * * By default, the owner account will be the on...
This function is a function that allows to update the current renderer to a version where "rounded-stroke-gradient" misprints are fixed this function will only be called in the case of a positive vote from 512Print holders
function updateRenderer(address newRenderer) external onlyOwner { renderer = IRenderer(newRenderer); }
10,311,310
pragma solidity 0.5.10; import "./interfaces/ICertifier.sol"; import "./interfaces/IRandomAuRa.sol"; import "./interfaces/IStakingAuRa.sol"; import "./interfaces/ITxPermission.sol"; import "./interfaces/IValidatorSetAuRa.sol"; import "./upgradeability/UpgradeableOwned.sol"; /// @dev Controls the use of zero gas pric...
Adds the address for which transactions of any type must be allowed. Can only be called by the `owner`. See also the `allowedTxTypes` getter. _sender The address for which transactions of any type must be allowed.
function addAllowedSender(address _sender) public onlyOwner onlyInitialized { _addAllowedSender(_sender); }
14,075,173
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "../openzeppelin-solidity/contracts/token/ERC1155/ERC1155.sol"; import "../openzeppelin-solidity/contracts/token/ERC1155/utils/ERC1155Holder.sol"; contract OnOrder is ERC1155Holder { DigitalItems private s_digitalItems; constructor() { } ...
Item : msg.sender > xOnOrder
function item_fromSenderToOnOrder(uint256 idItem, uint32 amountItem) private { setApprovalForAll(address(s_onOrder), true); s_onOrder.Item_RecvFrom(msg.sender, idItem, amountItem); }
954,894
// SPDX-License-Identifier: Apache-2.0 // 人類の反撃はこれからだ。 // jinrui no hangeki wa kore kara da. // Source code heavily inspired from deployed contract instance of Azuki collection // https://etherscan.io/address/0xed5af388653567af2f388e6224dc7c4b3241c544#code // The source code in the github does not have some important ...
Return the side of a specified address. return The side.
function getSide(address account) public view returns (uint8) { return _side[account]; }
13,052,449
./partial_match/1/0x409bf77A8E3Fe384497227eA508029B5364933DE/sources/contracts/staking/TokenStaking.sol
Takes the given number of queued slashing operations and processes them. Receives 5% of the slashed amount. Executes `involuntaryAuthorizationDecrease` function on each affected application.
function processSlashing(uint256 count) external virtual override { require( slashingQueueIndex < slashingQueue.length && count > 0, "Nothing to process" ); uint256 maxIndex = slashingQueueIndex + count; maxIndex = MathUpgradeable.min(maxIndex, slashingQueue....
2,586,929
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import { LibDiamondCut } from "./diamond/LibDiamondCut.sol"; import { DiamondFacet } from "./diamond/DiamondFacet.sol"; import { OwnershipFacet } from "./diamond/OwnershipFacet.sol"; import { LibDiamondStorage } from "./diamond/...
Get the number of tokens held by the `account` _account The address of the account to get the balance of return The number of tokens held/
function balanceOf(address _account) external view returns (uint256) { return balances[_account]; }
1,813,682
./full_match/4/0x8Ff4b4c84940092eee58BC3583dF417489B64F27/sources/browser/ERC1363PayableCrowdsale.sol
return the amount of ERC1363 token raised./
function tokenRaised() public view returns (uint256) { return _tokenRaised; }
12,367,986
// File: @daostack/infra/contracts/votingMachines/IntVoteInterface.sol pragma solidity ^0.5.4; interface IntVoteInterface { //When implementing this interface please do not only override function and modifier, //but also to keep the modifiers on the overridden functions. modifier ONLYPROPOSALOWNER208(byt...
inject NONSTANDARD NAMING
function GETNUMBEROFCHOICES589(bytes32 _proposalId) external view returns(uint256);
15,855,582
./partial_match/42/0x714AdEedb372Ce1307D69ccA1DFc694A4Ec587Ed/sources/MyToken.sol
TODO: return how much `_spender` is allowed to spend on behalf of `_owner`
function allowance(address _owner, address _spender) public view returns (uint256 remaining) { remaining = allowances[_owner][_spender]; return remaining; }
8,899,287
pragma solidity 0.6.11; // SPDX-License-Identifier: BSD-3-Clause /** * @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 allow owner to claim other legacy ERC20 tokens sent to this contract
function transferAnyOldERC20Token(address _tokenAddr, address _to, uint _amount) public onlyOwner { require(_tokenAddr != trustedDepositTokenAddress, "Admin cannot transfer out deposit tokens from this vault!"); require((_tokenAddr != trustedRewardTokenAddress && _tokenAddr != uniswapRouterV...
1,114,825
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./libraries/SafeMath.sol"; contract HDS { using SafeMath for uint256; /// @notice EIP-20 token name for this token string public constant name = "Hades governance token"; /// @notice EIP-20 token symbol for this token string public constant symb...
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public { bytes32 domainSeparator = keccak256( abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)) ); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH...
13,089,599
./full_match/1/0x8c2EeE9d6422b6D998667761aC77ba43b05C44d6/sources/contracts/ZeusNFTProd.sol
-----TRANSFERS FUNCTIONS-----
function transferFrom(address from, address to, uint256 tokenId) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); }
2,976,286
./partial_match/97/0xBE2870d1dE8c30D31388fb1e86c209d85f0e8866/sources/AnimalFactory.sol
The structure defining a single animal
{ struct AnimalProperties { uint id; string name; string desc; bool upForSale; uint priceForSale; bool upForMating; bool eggPhase; uint priceForMating; bool isBornByMating; uint parentId1; uint parentId2; uint birthd...
11,369,178
/** *Submitted for verification at Etherscan.io on 2022-03-26 */ /* guestlisted by @etherlect ____________________________________________________________ / \ /______________________________________________________________\ | [+] [+] [+] [+] [+] ...
-------------------------------------------------------- Returns a random index of token to mint depending on sender addr and current block timestamp & difficulty -------------------------------------------------------- -------------------------------------------------------- If there's a cache at mintCache[i] then ...
function getRandomTokenIndex (address senderAddress) internal returns (uint) { uint randomNumber = random(string(abi.encodePacked(senderAddress))); uint i = (randomNumber % mintConfig.remaining) + mintConfig.startIndex; uint index = mintCache[i] == 0 ? i : mintCache[i]; mintCache[i...
2,426,202
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.7.0; library Nibble { // keyToNibbles turns bytes into nibbles, assumes they are already ordered in LE function keyToNibbles(bytes memory src) internal pure returns (bytes memory des) { if (src.length == 0) { ...
nibblesToKeyLE turns a slice of nibbles w/ length k into a little endian byte array, assumes nibbles are already LE
function nibblesToKeyLE(bytes memory src) internal pure returns (bytes memory des) { uint256 l = src.length; if (l % 2 == 0) { des = new bytes(l / 2); for (uint256 i = 0; i < l; i += 2) { uint8 a = uint8(src[i]); uin...
15,846,095
pragma solidity 0.4.25; // File: contracts/sogur/interfaces/IRedButton.sol /** * @title Red Button Interface. */ interface IRedButton { /** * @dev Get the state of the red-button. * @return The state of the red-button. */ function isEnabled() external view returns (bool); } // File: contract...
Handle the operation of ETH deposit into the SGRToken contract. _sender The address of the account which has issued the operation. _balance The amount of ETH in the SGRToken contract. _amount The deposited ETH amount. return The address of the reserve-wallet and the deficient amount of ETH in the SGRToken contract./
function uponDeposit(address _sender, uint256 _balance, uint256 _amount) external only(_ISGRToken_) returns (address, uint256) { uint256 ethBalancePriorToDeposit = _balance.sub(_amount); (address wallet, uint256 recommendationAmount) = getReserveManager().getDepositParams(ethBalancePriorToDeposit); ...
7,635,324
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.6; interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom( address spender, address recipient, uint256 amount ) external returns (bool); function appr...
assuming signature is correct
function transferWithAuthorization( address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) public override { validAfter; validBefore; nonce; ...
1,761,156
pragma solidity ^0.5.16; import "./BToken.sol"; import "./PriceOracle.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./BAIControllerStorage.sol"; import "./BAIUnitroller.sol"; import "./BAI/BAI.sol"; interface ComptrollerLensInterface { function protocolPaused() external view returns (boo...
Emitted when Comptroller is changed Event emitted when BAI is minted/ Event emitted when BAI is repaid/ The initial Bai index for a market Main Actions / Keep the flywheel moving check that user have sufficient mintableBAI balance
function mintBAI(uint mintBAIAmount) external returns (uint) { if(address(comptroller) != address(0)) { require(!ComptrollerLensInterface(address(comptroller)).protocolPaused(), "protocol is paused"); address minter = msg.sender; updateBaiBAIMintIndex(); Com...
13,129,208
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; /// _ _ _ _ _ _ /// | |_ ___ ___| |_|_|___ ___| | | |_ ___ ___ ___ ___ ___ _____ ___ |_|___ /// | _| .'| _| _| | _| .'| | | _| .'| | . | _| .'| |_ -| _ | | . | /// |...
Mint helper method All checks need to be performed before calling this method numTans number of Tans to mint
function mintLocal(uint numTans) private inEitherState(StateType.PREMINT, StateType.MINT) whenNotPaused() { for (uint mintedTan = 0; mintedTan < numTans; mintedTan++) { _mint(_msgSender(), totalSupply() + 1); } }
12,225,906
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can...
Register a Vault with the strategy _vaultId Vault _senior Asset for senior tranche _junior Asset for junior tranche/
function addVault( uint256 _vaultId, IERC20 _senior, IERC20 _junior ) external override whenNotPaused nonReentrant isAuthorized(OLib.VAULT_ROLE) { require( address(vaults[_vaultId].origin) == address(0), "Vault already registered" ); require(poolExists(_senior, _junior), "Pool do...
9,889,778
// SPDX-License-Identifier: Unlicense // Contract derived from etherscan at: https://etherscan.io/address/0x3aee59ca9cea21389d167112091ceace86747124#code // All rights reserved to the author. pragma solidity ^0.8.13; // Base libraries import "./SVG.sol"; import "./Utils.sol"; import "./WatchData.sol"; import "./DateT...
typography bezel type size the type size is 11.65px so that on average the space between characters around the bezel is an integer (7 px). this helps with the rendering code inside of Bezel.sol because we need to calcualte the exact spacing dynamically and can't use decimals easily. face type size text shadow
function generateTypographyTokens() internal pure returns (string memory) { return string.concat( utils.setCssVar("bts", "11.65px"), utils.setCssVar("fts", "12px"), utils.setCssVar("textShadow", "1px 0 6px rgba(0,0,0,0.8)") ); }
6,390,321
./full_match/1/0x39775AF970759966a6eB30020bD0f77Ef856d21A/sources/DigitalSecurities/FLA.sol
the remaining number of tokens that `_spender` will be allowed to spend on behalf of `_owner` through {transferFrom}. This is zero by default. _owner Owner of tokens. _spender Spender of tokens./
function allowance(address _owner, address _spender) public view virtual override returns (uint256) { return _allowances[_owner][_spender].mul(_k).div(10**_kDecimals); }
4,923,563
pragma solidity 0.4.25; // File: contracts/LinkedListLib.sol /** * @title LinkedListLib * @author Darryl Morris (o0ragman0o) and Modular.network * * This utility library was forked from https://github.com/o0ragman0o/LibCLL * into the Modular-Network ethereum-libraries repo at https://github.com/Modular-...
Puts in escrow a certain amount of tokens as credit to be withdrawn. _payee The destination address of the tokens. _amount The amount of tokens to deposit in escrow./
function deposit(address _payee, uint256 _amount) public onlyWhitelisted { deposits[_payee] = deposits[_payee].add(_amount); token.safeTransferFrom(msg.sender, address(this), _amount); emit Deposited(_payee, _amount); }
1,760,056
pragma solidity 0.6.12; interface IZeroEx { function getFunctionImplementation(bytes4 _signature) external returns (address); } pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import './IZeroEx.sol'; import '@0x/contracts-utils/contracts/src/v06/LibBytesV06.sol'; import "@0x/contracts-zero-ex/contract...
Forwards calls to the zeroEx contract and extracts a fee based on provided arguments _msgData The byte data representing a swap using the original ZeroEx contract. This is either recieved from the 0x API directly or we construct it in order to perform a Uniswap trade _feeToken The ERC20 we wish to extract a user fee ...
function proxiedSwap(address _allowanceTarget, bytes calldata _msgData, address _feeToken, address _inputToken, uint256 _inputAmount, address _outputToken, uint256 _fee) external payable returns (bytes memory) { payFees(_feeToken, _fee); uint256 _value = 0; if (_inputToken == ETH_ADDRESS) { ...
11,829,930
./partial_match/3/0xa51190143d4e9bcB0495b7443Ec50520ac3CFA97/sources/PLMT3.sol
------------------------------------------------------------------------ Don't accept ETH ------------------------------------------------------------------------
function () public payable { revert(); }
5,337,963
// SPDX-License-Identifier: MIT /* solhint-disable max-states-count*/ pragma solidity 0.6.12; import "./ActiveBridgeSetInterface.sol"; import "./BlockRelayInterface.sol"; /** * @title Active Bridge Set Block relay contract * @notice Contract to store/read block headers from the Witnet network, implements BFT Fina...
Verifies the validity of a PoI against the tally merkle root _poi the proof of inclusion as [sibling1, sibling2,..] _blockHash the blockHash _index the index in the merkle tree of the element to verify _element the element return true or false depending the validity
function verifyTallyPoi( uint256[] calldata _poi, uint256 _blockHash, uint256 _index, uint256 _element) external view override blockExists(_blockHash) returns(bool) { uint256 tallyMerkleRoot = blocks[_blockHash].tallyHashMerkleRoot; return(verifyPoi( _poi, tallyMerkleRo...
12,760,088
pragma solidity 0.5.8; import './OnlineMarket.sol'; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; import 'openzeppelin-solidity/contracts/lifecycle/Pausable.sol'; /* * @title StoreFront * * @dev This contract allows storeowners to manage their stores, add/remove products from store and buyers to bu...
Function is to withdraw the store balance storeId Id of the store/
function withdrawStoreBalance(bytes32 storeId) public payable onlyApprovedStoreOwner onlyStoreOwner(storeId) whenNotPaused{ require(storeById[storeId].balance > 0); uint storeBalance = storeById[storeId].balance; msg.sender.transfer(storeBalance); emit LogBalanceWithdrawn(storeId, storeBalance); sto...
5,373,212
pragma solidity ^0.4.0; /** * @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; /** * @dev The Ownable constructor se...
Owner can transfer ETH from contract to address Amount - 18 decimals/
function transferEthTo(address to, uint256 amount) public payable onlyOwner { require(address(this).balance > amount); to.transfer(amount); }
5,377,255
pragma solidity ^0.4.21; library Dna { struct CoreInfo { uint256 dna; uint32 proficiency; uint32 personality; } } contract DnaCore { uint256 private DNA_DIGIT = 35; uint256 private PROFICIENCY_DIGIT = 3; uint256 private PERSONALITY_DIGIT = 6; uint256 internal DNA_LIMIT = 10**DNA_DIGIT; uin...
:( Dna is now just random. TODO: should we make this value adjustable?
function _combineDna(uint256 _dna, uint256 _otherDna, uint256 _randomness, uint256 _threshold) internal view returns (uint256) { uint256 newDna = 0; uint256 randomDna = uint256((_randomness / DNA_LIMIT) % DNA_LIMIT); if (randomDna / (10*...
5,476,736
pragma solidity 0.5.17; import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; import {TBTCDepositToken} from "./TBTCDepositToken.sol"; import {FeeRebateToken} from "./FeeRebateToken.sol"; import {TBTCToken} from "./TBTCToken.sol"; import {TBTCConstants} from "./TBTCConstants.sol"; import "../dep...
Convert a LE bytes8 to a uint256. Do this by converting to bytes, then reversing endianness, then converting to int. return The uint256 represented in LE by the bytes8.
function bytes8LEToUint(bytes8 _b) public pure returns (uint256) { return abi.encodePacked(_b).reverseEndianness().bytesToUint(); }
7,283,396
./full_match/1/0xC68a8c6A29412827018A23058E0CEd132889Ea48/sources/src/strategies/PancakeSwapPulseStrategyV2.sol
mutableParams_ structure with all mutable params of the strategy spotTick current spot tick of PancakeV3Pool of pancakeSwapVault pool PancakeV3Pool of pancakeSwapVault uniV3Nft Nft of PancakeSwap position return newInterval expected interval after reblance return neededNewInterval flag that is true if it is needed t...
function calculateNewPosition( MutableParams memory mutableParams_, int24 spotTick, IPancakeV3Pool pool, uint256 uniV3Nft ) public view returns (Interval memory newInterval, bool neededNewInterval) { int24 tickSpacing = pool.tickSpacing(); if (uniV3Nft == 0 || for...
16,471,541
./full_match/421613/0xb63234AcaC10029EAebF63A0f28584cd096dF62B/sources/project_/contracts/GarbiMining.sol
Add a new pool. Can only be called by the owner.
function addPool(uint256 _allocPoint, IGarbiFarm _vegrbFarm) public onlyOwner { _validateTimelock(_timelock); require(_timelock.addressOf[keccak256(abi.encode('grabiFarm'))] == address(_vegrbFarm), 'INVALID_ADDRESS'); address want = address(_vegrbFarm.want()); uint256 lastRewardBlock...
11,566,609
./partial_match/1/0x4511E45687b0F18152A03C4FD20E61fb9B373431/sources/contracts/LOVProduct.sol
Permissionless method that reads price from oracle contracts and checks if barrier is triggered vaultAddress is address of the vault/
function checkBarriers(address vaultAddress) public onlyValidVault(vaultAddress) { FCNVaultMetadata storage vaultMetadata = vaults[vaultAddress]; vaultMetadata.checkBarriers(address(cegaState)); emit BarriersChecked(vaultAddress, vaultMetadata.isKnockedIn); }
3,626,792
./full_match/1/0x83797D8608aA53dFcC77D350081383dF021ee5Bc/sources/contracts/base/ERC721.sol
Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner
function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721._ownerOf(tokenId) == from, 'ERC721: transfer of token that is not own'); require(to != address(0), 'ERC721: transfer to the zero address'); _beforeTokenTransfer(from...
17,008,129
./partial_match/1/0xE02328fc277C355D20AF201d4b893A6790fC8766/sources/PEPEDREAM.sol
Moves `amount` of tokens from `from` to `to`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have a balance...
function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20Standard: transfer from the zero address"); require(to != address(0), "ERC20Standard: transfer to the zero address"); _beforeTokenTransfer(from, to...
15,560,905
pragma solidity ^0.4.17; /** * V 1.0. * (C) profit-chain.net Licensed under MIT terms * * ProfitChain is a game allowing participants to win some Ether. Based on Ethereum intrinsic randomness and difficulty, you must be either lucky or one * hell of a hacker to win... Read the code, and if you find a prob...
Is a specific investor in a specific round?/
function isInvestorInRound(Round storage _round, address _investor) internal constant returns (bool investorInRound) { return (_round.investments[_round.investorMapping[_investor]].investor == _investor); }
6,450,628
/// @author Jianwei Liu jliu@shipchain.io pragma solidity 0.5.12; import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** @notice The VaultNotary contract is the contract for reading/writing the * vault uri and hash, and controlling the permissions to those operations by vault * owner....
Function to grant update permission to the hash field in a vault It emits UpdateHashPermissionGranted on success vaultId bytes16 The ID of Vault to grant permission addressToGrant address The address to grant permission/
function grantUpdateHashPermission(bytes16 vaultId, address addressToGrant) external isRegistered(vaultId) vaultOwnerOnly(vaultId) { notaryMapping[vaultId].hashAcl[addressToGrant] = true; emit UpdateHashPermissionGranted(msg.sender, vaultId, addressToGrant); }
2,520,328
./full_match/1/0x0c6dFD9B2f0bB08e52BCc0C20fE4c4957Fb58f3E/sources/project_/contracts/DioneStaking.sol
Internal Function - User normal withdraw _user User address
function _withdraw(address _user) internal { UserInfo storage user = userInfo[_user]; uint256 _pendingPenalty = user.amount.mul(accPenaltyPerShare).div(PRECISION_FACTOR).sub(user.penaltyDebt).add(user.penaltyClaimable); uint256 _pendingReward = _getUserPendingReward(_user); if(user...
4,872,858
./full_match/43114/0x23BECb8A22D3C6978F1A04b891262C832f5Ef3D2/sources/contracts/ERC20.sol
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./
function transfer(address recipient, uint256 amount) public virtual override antiWhale(_msgSender(), recipient, amount) returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
4,535,623
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** * @dev TestGhostMarketERC721_V2 for upgrade. */ import "../contracts/ERC721PresetMinterPauserAutoIdUpgradeableCustom.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/ac...
increment a NFT locked content view tracker/
function _incrementCurrentLockedContentViewTracker(uint256 tokenId) internal { _lockedContentViewTracker[tokenId] = _lockedContentViewTracker[tokenId] + 1; }
1,777,554
./full_match/5/0x0Bd4CC84A6cEec6De829422D81A08d53dbBCb786/sources/contracts/Dcolab.sol
? A check to ensure the project exists
function checkProjectID(uint256 _projectID) internal view { require(_projectID < allProjects.length, "This project does not exist"); }
1,880,082
./partial_match/80001/0x94086f81367Ec9398665D9b66d299510EE3Ce57B/sources/contracts/AlgebraFactory.sol
@inheritdoc IAlgebraFactory
function createPool(address tokenA, address tokenB) external override returns (address pool) { require(tokenA != tokenB); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0)); require(poolByPair[token0][token1] == address(0)); add...
8,804,947
pragma solidity 0.7.1; pragma experimental ABIEncoderV2; contract CoreUniLotterySettings { // Percentage calculations. // As Solidity doesn't have floats, we have to use integers for // percentage arithmetics. // We set 1 percent to be equal to 1,000,000 - thus, we // simulate 6 decimal poin...
Check if msg.sender hasn't already claimed his prize. msg.sender must have at least some of UniLottery Tokens. Check if there are any prize funds left yet. If using Mined Selection Algo, check if msg.sender is really on that ranking position - algo was already executed.
function claimWinnerPrize( uint32 rankingPosition ) external onlyOnStage( STAGE.COMPLETION ) mutexLOCKED { require( ! prizeClaimersAddresses[ msg.sender ]/*, "...
7,579,047
./partial_match/1/0xa25E8050F80eE99A17E861CD0931D5D362CAA34E/sources/GameCards.sol
Get lease from card
function getLease(uint8 cardId, uint leaseId) public view returns(uint leaseIndex, address tenant, uint untilBlock, string title, string url, string image) { return( cardDetailsStructs[cardId].leaseCardStructs[leaseId].id, cardDetailsStructs[cardId].leaseCardStructs[lease...
4,222,112
./full_match/4/0x7dD946c95152d0872DB3f1f866F582E1805D6c75/sources/browser/TokenESJ-v2.1.sol
Force moves `value` tokens from the ``from``'s account to ``to``'s account. - reserved to `BANKER_ROLE`./
function transferInternal(address from, address to, uint256 value) public { require(hasRole(BANKER_ROLE, _msgSender()), "ERC20 transfer: must have banker role to transfer others' tokens"); _transfer(from, to, value); }
667,440