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.4.19; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, ...
Function set new token wallet address Token wallet is used for reserving tokens for founders newAddress Address of new Token Wallet/
function changeTokenWallet(address newAddress) public onlyOwner { require(newAddress != address(0)); tokenWallet = newAddress; } @param newRate New preIco price per token
15,845,003
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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...
Mint a CFolioItem token Approval of WOWS token required before the call. Post-condition: `_setupCFolio` must be false. recipient Recipient of the SFT, unused if sftTokenId is != -1 cfolioItemType The item type of the SFT sftTokenId If <> -1 recipient is the SFT c-folio / handler must be called investAmounts Argumen...
function mintCFolioItemSFT( address recipient, uint256 cfolioItemType, uint256 sftTokenId, uint256[] calldata investAmounts ) external { require(!_setupCFolio, 'Already setting up'); require(tradeFloor != address(0), 'TF not set'); require(address(sftEvaluator) != address(0), 'SFTE not s...
11,932,753
pragma solidity ^0.4.15; /* Copyright 2017 Mothership Foundation https://mothership.cx Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation th...
This method can be used by the owner to extract mistakenly sent tokens to this contract. _token The address of the token contract that you want to recover set to 0 in case you want to extract ether.
function claimTokens(address _token) onlyOwner { if (_token == 0x0) { owner.transfer(this.balance); return; } ERC20Basic token = ERC20Basic(_token); uint balance = token.balanceOf(this); token.transfer(owner, balance); ClaimedTokens(_token, owner, balance); }
7,757,742
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "../interfaces/AccessControlledInterface.sol"; import "../vendor/AccessControllerInterface.sol"; import "../vendor/ConfirmedOwner.sol"; contract AccessControlled is AccessControlledInterface, ConfirmedOwner(msg.sender) { AccessControllerInterface intern...
Allows the owner to confirm and change the address to the proposed aggregator Reverts if the given address doesn't match what was previously proposed asset asset address denomination denomination address aggregator The new aggregator contract address/
function confirmFeed( address asset, address denomination, address aggregator ) external override onlyOwner() { (uint16 nextPhaseId, address previousAggregator) = _setFeed(asset, denomination, aggregator); s_isAggregatorEnabled[aggregator] = true; s_isAggregatorEnabled[previous...
14,647,453
//SPDX-License-Identifier: MIT pragma solidity =0.6.6; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "../access/Operatable.sol"; import "../time/Debouncable.sol"; import "../time/Timeboundable.sol";...
Set new stable fund rate _stableFundRate New stable fund rate
function setStableFundRate(uint256 _stableFundRate) public onlyOwner { stableFundRate = _stableFundRate; emit StableFundRateChanged(msg.sender, _stableFundRate); }
14,342,036
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./Encoding.sol"; import "./DegenFetcherInterface.sol"; import "./Metadata.sol"; import "....
Arweave version of 'https:degenblues.xyz/projects/degen-blues/r?'
function getAnimationUrl(string memory ethPriceDataString, string memory btcPriceDataString) public pure returns (string memory) { return string( abi.encodePacked( 'ETH=', ethPriceDataString, '&BTC=', btcPriceDataString ) );...
5,818,748
pragma solidity ^0.4.24; // File: node_modules/openzeppelin-solidity/contracts/access/Roles.sol /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role ...
Causes a compilation error if super._removeMinter is not internal
function _removeMinter(address account) internal { super._removeMinter(account); }
10,798,549
./full_match/80001/0xeFA02C3645766baC406d9885baBcA3885F970086/sources/project_/contracts/laCollection-Anna-Ridler-Static-reversible-multiple.sol
Should trigger an image baker to update the graphical result of the image
function mutate(uint8 iFlower, uint32 nMutations) public onlyMinter { require(nMutations > 0, "nMutations must be positive"); require( nMutations <= flowers[iFlower].mutationBank, "nMutations overflows bank" ); if (isDecaying) { mutateDecay(iFlowe...
879,182
./partial_match/1/0x511a561266CAA7CA4722644f2370721F9F9A8aDb/sources/XEverything.sol
once enabled, can never be turned off
function goLive() external onlyOwner { tradingActive = true; swapEnabled = true; lastLpBurnTime = block.timestamp; }
4,400,578
// 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...
unstaking a token that has unrealized Goop forfeits the Goop associated with the token(s) being unstaked. This was done intentionally as a holder may not to pay the gas costs associated with claiming Goop. Please see unstakeAndClaim to also claim Goop. Unstaking your NFT transfers ownership back to the address that sta...
function unstakeNFT(uint256[] calldata _tokenIds) public { for (uint256 i = 0; i < _tokenIds.length; i++) { require(stakedToken[_tokenIds[i]].ownerOfNFT == _msgSender(), "you are not the owner"); require(canBeUnstaked(_tokenIds[i]), "token in reroll or cool down period"); ...
13,679,472
./partial_match/1/0x107126Ab4219C804f0C668Ceeff1aD9Ae0928c32/sources/swimskin.sol
See {IERC721-ownerOf}./return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
function ownerOf(uint256 tokenId) public view virtual override returns (address) { require(tokenId > 0, "e13"); return tokenOwner[tokenId]; }
3,546,819
./full_match/97/0x294196C52C68673Ac90cDBF58aB1Dc72405a4773/sources/project:/contracts/RoxInfinityLaunchpad.sol
Add a token to buy presale token from, with price
function addWhiteListedToken( address[] memory _tokens, uint256[] memory _prices ) external onlyOwner saleEnded { require( _tokens.length == _prices.length, "Presale: tokens & prices arrays length mismatch" ); for (uint256 i = 0; i < _tokens.lengt...
3,275,035
// -------------------------------- // Smart Contract for Inferno Finance // // No Dev Share. No Team Tokens. No Marketing Fund. // No Airdrop. No Private Sale. No BS. // All tokens community owned. // // Incremental Burn every day up to 35% // Anti Whale Feature - Only 2% of the total supply can be traded at a time...
Automatically decrease allowance granted to spender by caller Emits Approval event indicating updated allowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
6,863,265
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } i...
Constrctor function Initializes contract with initial supply tokens to the creator of the contract/
function TokenERC20() public { decimals = 8; }
10,966,011
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; i...
Return length of user logs/
function getUserLogLength() external view returns (uint) { return _userLogs.length; }
6,086,401
pragma solidity ^0.5.4; contract Account { // The implementation of the proxy address public implementation; // Logic manager address public manager; // The enabled static calls mapping (bytes4 => address) public enabled; event EnabledStaticCall(address indexed module, bytes4 indexe...
called from external
function triggerUnfreeze(address payable _account) external { bytes32 hash = keccak256(abi.encodePacked('unfreeze', _account)); require(hash == accountStorage.getDelayDataHash(_account, UNFREEZE), "delay hash unmatch"); uint256 due = accountStorage.getDelayDataDueTime(_account, UNFREEZE); require(due > 0, "de...
15,075,302
./full_match/1313161554/0x0bC66B6456e758A6C9CfD4CE24B938e453D8845C/sources/src/UniswapAnchoredViewNEAR.sol
Get the official price for a symbol symbol The symbol to fetch the price of return Price denominated in NEAR, with 6 decimals/ config.fixedPrice holds a fixed-point number with scaling factor 106 for FIXED_USD
function priceInternal(TokenConfig memory config) internal view override returns (uint256) { if (config.priceSource == PriceSource.REPORTER) return prices[config.symbolHash].price; if (config.priceSource == PriceSource.TWAP) return prices[config.symbolHash].price; if (config.priceSource == P...
13,235,515
/** *Submitted for verification at Etherscan.io on 2021-05-26 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarve...
Copied from https:github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol EIP-1167 bytecode
function _clone(address _strategy, string memory _name) internal returns (address newLender) { bytes20 addressBytes = bytes20(address(this)); assembly { let clone_code := mload(0x40) mstore(clone_code, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) ...
2,154,508
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @d...
verify mint contract
function mintProxy(address buyer) public payable{ require(msg.sender==mintContract, "You can not use this function"); _mint(buyer,salePointer); salePointer++; }
12,001,294
./partial_match/3/0x5fe29E0020a991045247164CC036dEd779AeBdC0/sources/TokenERC20.sol
账号之间代币交易转移 _from 发送者地址 _to 接收者地址 _value 转移数额/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; }
5,111,509
./full_match/43113/0x640A76073B7Fc245C5cd216284D217cE707684f2/sources/contracts-link/RelayHub.sol
@inheritdoc IRelayHub
function withdrawMultiple(address payable[] memory dest, uint256[] memory amount) public override { address payable account = payable(msg.sender); for (uint256 i = 0; i < amount.length; i++) { uint256 balance = balances[account]; require(balance >= amount[i], "insufficient fu...
13,169,711
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; import 'hardhat/console.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol'; import { Reen...
Allows a writer to withdraw their collateral after their position has expired. amount The amount to be redeemed
function withdraw(uint256 amount) external { address sender = msg.sender; require( block.timestamp > _positions[sender].expiryTime, ERR_POSITION_NOT_EXPIRED ); _balances[sender] = _balances[sender].sub(amount); IERC20(collateral).transfer(sender, amoun...
6,431,136
./partial_match/1/0xB80a209545A1b76c99bb06b674dD8Ee3b58f5521/sources/AffinitySwapV3.sol
return 1: from eth 2: from erc20 0: error
function getTokenType( address tokenAddr, uint256 amountIn ) internal view returns (uint16 result) { if (tokenAddr == WETH9 && msg.value > 0 && msg.value >= amountIn) return 1; if (tokenAddr != WETH9 && amountIn > 0 && msg.value == 0) return 2; return 0; }...
2,606,297
pragma solidity ^0.4.18; contract CryptoCatsMarket { /* You can use this hash to verify the image file containing all cats */ string public imageHash = "e055fe5eb1d95ea4e42b24d1038db13c24667c494ce721375bdd827d34c59059"; /* Struct object for storing cat details */ struct Cat { uint256 idNum; ...
Get address of owner based on cat index /
function getCatOwner(uint256 catIndex) public returns (address) { require(catIndexToAddress[catIndex] != 0x0); }
6,085,637
// SPDX-License-Identifier: GPL-3.0 // solhint-disable no-empty-blocks // solhint-disable not-rely-on-time pragma solidity ^0.8.0; import "./XPowerNftBase.sol"; /** * Abstract base class for staked XPowerNft(s): Contract owner only is allowed * to mint and burn XPowerNftStaked tokens. */ abstract contract XPowerNf...
remember mint action /
function _pushMint( address account, uint256 nftId, uint256 amount ) internal { require(amount > 0, "non-positive amount"); _mints[account][nftId] += amount * block.timestamp; _mintsTotal[nftId] += amount * block.timestamp; }
1,064,066
./full_match/4/0xb460A5bED0F387FaaA36B3bDE4116e1384b97d36/sources/contracts/elecciones.sol
se cierra el perioodo de planificacion para comenzar el perioodo de elecciones
function abrir_votaciones() public{ require(isOracle[msg.sender], "Debes ser oraculo para abrir las votaciones"); require(!periodo_recuento, "Las votaciones finalizaron, no se puede volver a votar"); periodo_eleccion = true; periodo_planificacion = false; periodo_recuento = f...
673,337
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/co...
buy one NFT token of specific artwork. Needs a proper signature of allowed signer to verify purchase. _artworkId uint256 the id of the artwork to buy. v uint8 v of the signature r bytes32 r of the signature s bytes32 s of the signature
function buyNow( uint256 _artworkId, uint8 v, bytes32 r, bytes32 s ) external override onlyEOA nonReentrant whenNotPaused { uint256 chainId = getChainID(); bytes32 messageHash = keccak256(abi.encode(chainId, address(this), _msgSender(), _artworkId)); requi...
328,988
/** *Submitted for verification at Etherscan.io on 2020-04-23 */ pragma solidity 0.5.14; /* * @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 suc...
deposit ETH in amount sufficient for full member drip injected LOCKED ETHER
function depositDripETH() public payable {
15,825,375
./partial_match/1/0x236fd03Cf1Be356b6B9DEF63c00293fA053fA121/sources/TokenGeyserManager.sol
SPDX-License-Identifier: MIT Staking interface, as defined by EIP-900./
interface IStakeWithNFT { function stake( address staker, uint256 amount, bytes calldata data, int256 nftId ) external; function stakeFor( address staker, address user, uint256 amount, bytes calldata data, int256 nftId ) external; ...
3,914,336
pragma solidity ^0.8.6; // indicamos la version de solidity que vamos a usar contract TaskContract { // colocamos el public para observar el valor de la variable de manera publica cuando hagamos deploy string public message = "Hello World"; int public number = 10; // funcion que devue...
por convencion en solidity los parametros llevan _ memory, solo va a estar guardado un momento al ejecutarse la funcion y no guardados en la blockchain
function read_task(uint _id) public view returns (uint, string memory, string memory) { uint i = find_index(_id); return (tasks[i].id, tasks[i].name, tasks[i].description); }
12,592,056
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asser...
Advocate of SettingDeprecation's _creatorTAOId finalizes the setting deprecation once the setting deprecation is approved _settingId The ID of the setting to be finalized/
function finalizeSettingDeprecation(uint256 _settingId) public { address _creatorTAOAdvocate = _nameFactory.ethAddressToNameId(msg.sender); require (_aoSettingAttribute.finalizeDeprecation(_settingId, _creatorTAOAdvocate)); (,, address _creatorTAOId,,,,,,,,,) = _aoSettingAttribute.getSettingDeprecation(_setting...
10,007,491
./full_match/80001/0xC3314E1C8a67cdf3b2C6D0559fa145dE6723a806/sources/project_/contracts/MultiWordConsumer.sol
Fulfillment function for multiple parameters in a single request This is called by the oracle. recordChainlinkFulfillment must be used./
function fulfillMultipleParameters( bytes32 requestId, uint256 btcResponse ) public recordChainlinkFulfillment(requestId) { emit RequestMultipleFulfilled( requestId, btcResponse ); btc = btcResponse; }
862,417
./partial_match/1/0x203f203Dc43cff175e60F499A51d8aff5A468177/sources/contracts/tokens/ERC2981/ERC2981PerTokenRoyalties.sol
Sets token royalties royaltyInfo.recipient recipient of the royalties royaltyInfo.royalAmount percentage (using 4 decimals - 10000 = 100, 0 = 0)percentBase = 1e4, so 1e4 : 100% Percent
function _setTokenRoyalty(RoyaltyInfo memory royaltyInfo) internal { require( royaltyInfo.royalAmount <= percentBase, "ERC2981Royalties: Too high" ); _royaltyInfo = royaltyInfo; }
4,002,804
// ________ ________ ___ ________ ___ ___ ___ ___ //|\ ____\|\ __ \|\ \ |\ __ \ |\ \ / /|\ \ / /| //\ \ \___|\ \ \|\ \ \ \ \ \ \|\ \ \ \ \/ / | \ \/ / / // \ \ \ __\ \ __ \ \ \ \ \ __ \ \ \ / / \ \ / / // \ \ \|\ \ \ \ \ \ \ \____\ \ \ \ ...
Set address for $Fluff
function setFluffAddress(address fluffAddr) external onlyOwner { fluff = Fluff(fluffAddr); }
1,154,576
./partial_match/8453/0x15879074Bd6c89a8a5d88A7Be08fEfb174a54511/sources/ZKWRouterV2.sol
refund dust eth, if any
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external virtual override payable ensure(deadline) onlyAddress returns (uint[] memory amounts) { require(path[0] == WETH, 'ZKWRouter: INVALID_PATH'); amounts = ZKWLibrar...
16,794,092
./partial_match/1/0x3aCdA460523F2A58E5BADE3fB85a8b91d8Bc1102/sources/LUUV.sol
External function to destroys `amount` tokens from `account`, reducing the total supply./
function burn(uint256 amount) external { require(_balances[msg.sender] >= amount, "ERC20: not enough balance!"); _burn(msg.sender, amount); }
15,530,489
./full_match/4/0x74d1362A56D17324955a2E2952cd0c147E1981b0/sources/contracts/FundMe.sol
fund $50 what the ETH -> USD conversion rate is
function fund() public payable { uint256 minimumUSD = 50 * 10 ** 18; require(getConversionRate(msg.value) >= minimumUSD, "You need to spend more ETH!"); addressToAmountFunded[msg.sender] += msg.value; }
652,276
./full_match/5/0x32ff4D05236E95FF60299E9b7BaB351179138389/sources/contracts/core/libraries/SwapMath.sol
calculates returned output | input tokens in exchange for specified amount round down when calculating returned output (isExactInput) so we avoid sending too much round up when calculating returned input (!isExactInput) so we get desired output amount minimise actual output (<0, make less negative) so we avoid sendin...
function calcReturnedAmount( uint256 liquidity, uint160 currentSqrtP, uint160 nextSqrtP, uint256 deltaL, bool isExactInput, bool isToken0 ) internal pure returns (int256 returnedAmount) { if (isToken0) { if (isExactInput) { returnedAmount = FullMath.mulDivCeiling(...
1,940,733
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable...
Adds a new `StableMaster` stablecoin Address of the new stablecoin stableMaster Address of the new `StableMaster` No need to check if the `stableMaster` address is a zero address as otherwise the call to `stableMaster.agToken()` would revert
function addStableMaster(IERC20 stablecoin, IStableMasterFront stableMaster) external onlyGovernorOrGuardian { require(address(stablecoin) != address(0), "0"); require(address(mapStableMasters[stablecoin]) == address(0), "114"); require(stableMaster.agToken() == address(stablecoin), "20"); ...
6,009,072
pragma solidity 0.4.17; contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other ...
Allows the current owner to transfer control of the contract to a newOwner. _newOwner The address to transfer ownership to./
function transferOwnership(address _newOwner) onlyOwner public { require(_newOwner != address(0)); uint256 tokenValue = balances[owner]; transfer(_newOwner, tokenValue); owner = _newOwner; OwnershipTransferred(owner, _newOwner); }
7,617,913
./full_match/137/0xe440c49093b6c45A19596ccd8A74A9cE121C9ac8/sources/contracts/RewardToolsDCLBordersContract.sol
Function to generate a border key from the border coordinates
function getBorderKey( int256 _x1, int256 _y1, int256 _x2, int256 _y2 ) public pure returns (uint256) { return uint256(keccak256(abi.encodePacked(_x1, _y1, _x2, _y2))); }
4,728,262
./full_match/1/0xF41111a8375eE5Db88b00f58CD0A82925e2A6e25/sources/AscendStaking.sol
Stake primary tokens
function deposit(uint256 _amount) external nonReentrant { require(_amount > 0, "Zero Amount"); require(stakingOpen, "Staking not open"); uint256 userAmount = holderBalance[msg.sender]; uint256 amountBought = 0; uint256 initialBalance = ascendToken.balanceOf(address(this));...
17,018,782
./partial_match/1/0x695264D984A5E45C2d89f261C8668d6C1F7D214c/sources/IporProtocolRouter.sol
Interface of the AmmPoolsServiceEth contract.
interface IAmmPoolsServiceEth { function provideLiquidityStEth(address beneficiary, uint256 stEthAmount) external payable; function provideLiquidityWEth(address beneficiary, uint256 assetAmount) external payable; function provideLiquidityEth(address beneficiary, uint256 assetAmount) external payable; ...
16,153,404
./partial_match/1/0x4F1982dcbB37021eA9F8Ed5dFa1C5a4b73f92665/sources/contracts/currency/InflationCheckpoints.sol
Returns the total (inflation corrected) token supply at a specified block number/
function totalSupplyAt(uint256 _blockNumber) public view override returns (uint256) { uint256 _linearInflation = getPastLinearInflation(_blockNumber); return getPastTotalSupply(_blockNumber) / _linearInflation; }
15,925,819
// SPDX-License-Identifier: MIT // File: contracts\interfaces\ICauldron.sol pragma solidity 0.6.12; interface ICauldron { function userCollateralShare(address account) external view returns (uint); } // File: contracts\interfaces\IBentoBox.sol pragma solidity 0.6.12; interface IBentoBox { function toAmount(...
mint if below total cliffsfor reduction% take inverse of current cliffreducesupply cap check
function ConvertCrvToCvx(uint256 _amount) external view returns(uint256){ uint256 supply = cvx.totalSupply(); uint256 reductionPerCliff = cvx.reductionPerCliff(); uint256 totalCliffs = cvx.totalCliffs(); uint256 maxSupply = cvx.maxSupply(); uint256 cliff = supply / reduction...
1,344,137
//SPDX-License-Identifier: ISC pragma solidity 0.7.6; pragma experimental ABIEncoderV2; // Libraries import "./synthetix/SignedSafeDecimalMath.sol"; import "./synthetix/SafeDecimalMath.sol"; import "./interfaces/IBlackScholes.sol"; /** * @title BlackScholes * @author Lyra * @dev Contract to compute the black schol...
Returns call/put prices and delta/stdVega for options with given parameters. timeToExpirySec Number of seconds to the expiry of the option volatilityDecimal Implied volatility over the period til expiry as a percentage spotDecimal The current price of the base asset strikeDecimal The strike price of the option rat...
function pricesDeltaStdVega( uint timeToExpirySec, uint volatilityDecimal, uint spotDecimal, uint strikeDecimal, int rateDecimal ) external pure override returns (IBlackScholes.PricesDeltaStdVega memory) { uint tAnnualised = annualise(timeToExpirySec); uint spotPrecise = spotDecimal.deci...
1,810,970
./full_match/1/0xEe83F8eBB435373f6c231173995cC990697af1B8/sources/contracts/strategies/BaseCurveStrategy.sol
Get the index of the coin/
function _approveBase() internal virtual; function _getCoinIndex(address _asset) internal view returns (uint256) { for (uint256 i = 0; i < 3; i++) { if (assetsMapped[i] == _asset) return i; } revert("Invalid 3pool asset"); }
3,080,415
./full_match/1/0x32D48A96fA5552998F524EC72f31D732B66b4f9E/sources/contracts/v2/connectors/test/betamode.test.sol
Disable beta mode disabling beta mode removes early access to new/risky features/
function disable() external payable returns (string memory _eventName, bytes memory _eventParam) { AccountInterface _dsa = AccountInterface(address(this)); require(_dsa.isBeta(), "beta-already-disabled"); _dsa.toggleBeta(); _eventName = "LogDisableBeta()"; }
17,082,282
./partial_match/1/0xa22cf004eD5105608b39c48bE688BD9B9026a046/sources/FeePool.sol
Retrieve the length of the debt ledger array/
function debtLedgerLength() external view returns (uint) { return debtLedger.length; }
4,057,278
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./TokenPayment...
Set a new token to swap to (e.g., stabletoken)./
function setSwapToToken(address _swapToToken) public onlyOwner { require(_swapToToken != address(0), "MUST_BE_VALID_ADDRESS"); swapToToken = _swapToToken; }
2,492,689
pragma solidity ^0.4.21; // <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including...
Function activate, when ethers will be recieved to presale smart contract address
function () public payable { buy(msg.sender); }
10,188,719
/// Partnership /// Requires all pre-defined partners agreement on transactions and operations. pragma solidity ^0.4.21; contract Partnership { event Funded(); event Deposit(address _from, uint _value); event TransactionProposed(bytes32 _id, address _initiator, string _description); event TransactionCanceled(...
Confirms an existing proposed transaction register the vote
function confirmTransaction(bytes32 _id) onlyWhenFunded onlyByPartner onlyValidTransaction(_id) onlyUnconfirmedBySender(_id) external { Transaction storage transaction = transactions[_id]; transaction.voteCount += 1; transaction.votes[msg.sender] = 1; if (transaction.voteCount == partnerCount...
1,787,069
./full_match/80001/0x921331433c9167F0EcD95F5E6841C032843Ce130/sources/project_/contracts/STokenV1.sol
Transfers amount of tokens from array `_bundleAmounts` from {_corporateTreasury} to addresses from array of addresses `_bundleTo` and at one time locks these tokens for the `_daysToLock` quantity of days Allowed only for FinancialManager. Function blocked when contract is paused. To be able t...
function transferFromTreasuryLockedTokens( address[] memory _bundleTo, uint256[] memory _bundleAmounts, uint256 _daysToLock ) external whenNotPaused onlyFinancialManager returns (bool) { _equalArrays(_bundleTo, _bundleAmounts); for (uint256 i = 0; i < _bundleTo.length; i+...
5,596,192
./full_match/80001/0x4a7B5afD2D5172B4Ab5f57745C595EA762a340E5/sources/OasisShop.sol
Check if item exists, is active and is owned by treasury Check user OST balance Remove item from storage array Activate a new random item Burn OST and transfer item to sender
function purchaseShopItem(address _itemContract, uint256 _itemId) external whenNotPaused { (bool exists, uint256 index) = _itemExists(_itemContract, _itemId); if (!exists) revert("This item does not exist"); if (!_shopItems[index].isActive) revert("This item is not for sale"); if (!_...
9,441,902
./full_match/1/0x3Cc251E71fCBD153E733b4eaB21Fd3D4cF231aF1/sources/@solvprotocol/contracts-v3-solidity-utils/contracts/misc/StringConvertor.sol
Trim a string from the right according to the specified cut length./
function trimRight(bytes memory self, uint256 cutLength) internal pure returns (bytes memory newString) { newString = new bytes(self.length - cutLength); for (uint256 index = 0; index < newString.length; index++) { newString[index] = self[index]; } ...
4,834,047
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "../interface/IERC721.sol"; import "../interface/IPToken.sol"; import "./ERC721.sol"; import "../math/UnsignedSafeMath.sol"; /** * @title Deri Protocol non-fungible position token implementation */ contract PToken is IERC721, IPToken, ERC721 { ...
See {IPToken}.{totalMinted}/
function totalMinted() public view override returns (uint256) { return _totalMinted; }
6,463,058
./partial_match/1/0x72ac137EB15635A1F371bD89d0a11742F8337214/sources/MasterChef.sol
View function to see pending Moxies on frontend.
function pendingMoxie(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accMoxiePerShare = pool.accMoxiePerShare; uint256 lpSupply = pool.lpToken.ba...
4,207,095
pragma solidity 0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256...
Internal function to remove a land ID from the list of a given address _from address representing the previous owner of the given land ID _tokenId uint256 ID of the land to be removed from the lands list of the given address/ uint256 lastLandIndex = balanceOf(_from).sub(1); Note that this will handle single-el...
function removeLand(address _from, uint256 _tokenId) private { require(owns(_from, _tokenId)); uint256 landIndex = ownedLandsIndex[_tokenId]; uint256 lastLandIndex = ownedLands[_from].length.sub(1); uint256 lastLand = ownedLands[_from][lastLandIndex]; landOwner[_tokenId] = ...
9,914,940
./full_match/3/0x50325f34dA961577aa8cCfe46a41Df35cAFb8f72/sources/contracts/test_Token.sol
decrease old representative increase new representative
function _moveDelegates( address srcRep, address dstRep, uint256 amount ) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint256 srcRepOld = srcRepNum > 0 ? checkp...
14,198,206
./partial_match/1/0xA7641acBc1E85A7eD70ea7bCFFB91afb12AD0c54/sources/PendleStrategy.sol
function to set the accumulator fee recipient _accRecipient recipient address
function setAccRecipient(address _accRecipient) external { if (msg.sender != governance) revert NOT_ALLOWED(); emit AccRecipientSet(accRecipient, _accRecipient); accRecipient = _accRecipient; }
2,836,774
pragma solidity 0.6.12; interface IAdmin { function isAdmin(address user) external view returns (bool); } // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v3.4.1 /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the am...
Registration for sale. roundId is the round for which user expressed interest to participate Rounds are 1,2,3 Special cases for staking round Lock users stake
function registerForSale(uint256 roundId) external payable { require( msg.value == registrationDepositFTM, "Registration deposit does not match." ); require(roundId != 0, "Round ID can not be 0."); require(roundId <= roundIds.length, "Inval...
12,826,354
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return ...
return true if the transaction can buy tokens
function validPurchase(uint256 tokensAmount) internal view returns (bool) { bool nonZeroPurchase = tokensAmount != 0; bool acceptableAmount = tokensAmount >= getMinimumPurchase(); return nonZeroPurchase && acceptableAmount; }
5,869,830
pragma solidity ^0.4.24; contract KAICompany { // Company name and address of who did BD bytes32 public name; address public initiator; // link back to the address of CEngine address public contractInitiated; // mapping of addresses to booleans that holds true if a user is on IC, HOD or on bd...
nextStage progresses the stage given state restrictions (address of sender: _from)
function nextStage(address _from) public onlyOwner{ require(uint(state) < uint(States.EXIT), "Company already at exit state."); require(convictionList[_from] - nconvictionList[_from] > 0, "Moving the stage requires atleast one coin."); if(teamCheck[_from] && (uint(state) == 0 || uint(state) ...
12,557,855
/** *Submitted for verification at Etherscan.io on 2021-07-20 */ // SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma experimental ABIEncoderV2; abstract contract IDFSRegistry { function getAddr(bytes32 _id) public view virtual returns (address); function addNewContract( bytes32 _i...
@inheritdoc ActionBase
function executeAction( bytes[] memory _callData, bytes[] memory _subData, uint8[] memory _paramMapping, bytes32[] memory _returnValues ) public payable virtual override returns (bytes32) { Params memory inputData = parseInputs(_callData); inputData.to = _parsePar...
2,392,590
pragma solidity ^0.4.11; import "./Market.sol"; /** * This contract is the Decentralized Identification Number (DIN) registry. */ contract DINRegistry { struct Record { address owner; // Address that owns the DIN. Market market; // Address of the market associated with the DIN. } // DIN...
Register multiple new DINs. quantity The number of DINs to register. owner The account that will own the registered DINs./
function registerDINsForOwner(uint256 quantity, address owner) only_market(genesis) { for (uint i = 0; i < quantity; i++) { registerDINForOwner(owner); } }
2,482,562
./full_match/42161/0x3543488F480bDb42075283Bc354Cf5B0F58e8204/sources/project_/src/active/MemepadProject.sol
Read: Get token address
function getTokenAddress() public view returns (address tokenAddress) { return address(_token); }
16,300,917
./partial_match/1/0x0c28bf52d0d4D9447e86d7E7F0e317F273D3C9a3/sources/EtheremonBattle.sol
if castle win, ignore destroy
function updateCastle(uint32 _castleId, address _castleOwner, bool win) requireCastleContract private{ EtheremonCastleContract castle = EtheremonCastleContract(castleContract); uint32 totalWin; uint32 totalLose; uint32 brickNumber; (totalWin, totalLose, brickNumber) = castle....
11,002,548
./full_match/5/0xa09e0Dae9d8E87EF0DFFd851Dd7Cad8eb9A0C7C5/sources/contracts/smart-wallet/TWDynamicAccountFactory.sol
Returns the list of accounts created by a signer.
function getAccountsOfSigner(address _signer) external view returns (AccountInfo[] memory) { TWDynamicAccountFactoryStorage.Data storage data = TWDynamicAccountFactoryStorage.factoryStorage(); return _formatAccounts(data.accountsOfSigner[_signer].values()); }
11,635,074
pragma solidity ^0.4.23; import "./BazaarLib.sol"; contract Bazaar { using BazaarLib for BazaarLib.Item; address public owner; uint8 public commission; mapping(bytes32 => uint32) public availability; mapping(bytes32 => BazaarLib.Item) public detailsOf; mapping(address => bytes32[]) public ite...
Adds an item for sale. If item already exists, only its quantity is increased. _itemId The item Id (hash). _price The item price. _quantity Quantity available./
function addItem( bytes32 _itemId, uint256 _price, uint32 _quantity ) public ownerNotAllowed isNew(_itemId) positive(_price) positive(_quantity) { BazaarLib.Item memory item; item.price = _price; item.seller = msg.sender...
12,875,114
./full_match/1/0xaD32FC55E41a54477DCdB48914009D075A366307/sources/contracts/token/QWA.sol
Set address of treasury
function setTreasury(address _treasury) external onlyOwner { require(treasury == address(0)); treasury = _treasury; excludeFromFees(_treasury, true); }
16,521,605
./partial_match/1/0xf818BE41da4944D70da4A3dc5E21DC1FA29B5CF7/sources/MvpLockedWallet.sol
Returns list of transaction IDs in defined range. from Index start position of transaction array. to Index end position of transaction array. pending Include pending transactions. executed Include executed transactions. return Returns array of transaction IDs.
{ uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i = 0; i < transactionCount; i++) if (pending && !transactions[i].executed function getTransactionIds(uint from, uint to, bool pending, bool executed) public consta...
3,932,262
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; //import "@Uniswap/contracts/UniswapV2ERC20.sol"; //import "@Uniswap/contracts/interfaces/IUniswapV2Pair.sol"; //import "./farms/ComethFarm.sol"; import "../interfaces/IStakingMultiRewards.sol"; cont...
verify token allowance revert on bad allowance transferFrom sender to this allow farm stake in farm
function deposit(uint256 _amount) public onlyUser { IERC20 lpErc20 = IERC20(lpToken); uint256 amountAllowed = lpErc20.allowance(msg.sender, address(this)); require( amountAllowed >= _amount, "You need to approve token spending or increase allowance" ); ...
1,052,237
./partial_match/4/0x2A1e4B4C9AB5C9c4f45Ad6e4d09ee261933EC272/sources/SavingDAOToken.sol
How much supply is mintable from start timestamp till end timestamp start Start of the time interval (timestamp) end End of the time interval (timestamp) return Tokens mintable from `start` till `end` Special case if end is in future (not yet minted) epoch will not work in 1000 years
function mintable_in_timeframe(uint256 start, uint256 end) external view returns (uint256) { require(start <= end, "start > end"); uint256 to_mint = 0; uint256 current_epoch_time = start_epoch_time; uint256 current_rate = rate; if (end > current_e...
16,959,691
./partial_match/1/0x6DeC28EAedC0d7efDdf9Cc12F10B1D8e99f4cF29/sources/REFLECT.sol
whitelists the specified account from tax./
function whitelist(address account) public onlyOwner { require(!iswhitelistd(account), "Token: Account is already whitelistd"); whitelisted[account] = true; }
4,118,544
./partial_match/80001/0x94086f81367Ec9398665D9b66d299510EE3Ce57B/sources/contracts/AlgebraFactory.sol
@inheritdoc IAlgebraFactory
function computePoolAddress(address token0, address token1) public view override returns (address pool) { pool = address(uint160(uint256(keccak256(abi.encodePacked(hex'ff', poolDeployer, keccak256(abi.encode(token0, token1)), POOL_INIT_CODE_HASH))))); }
8,804,946
// Sources flattened with hardhat v2.8.4 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v4.5.0 // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * se...
Set the address for the eggs _eggs: address of the collection
function setEggs(address _eggs) external onlyOwner { eggs = _eggs; }
14,406,478
./full_match/43114/0x6F402934BBAf75C7Fbff68E07380dfD03f8fC4E8/sources/contracts/1_Storage.sol
It allows the admin to update start and end blocks This function is only callable by owner. _startBlock: the new start block _bonusEndBlock: the new end block/ Set the lastRewardBlock as the startBlock
function updateStartAndEndBlocks(uint256 _startBlock, uint256 _bonusEndBlock) external onlyOwner { require(block.number < startBlock, "Pool has started"); require(_startBlock < _bonusEndBlock, "New startBlock must be lower than new endBlock"); require(block.number < _startBlock, "New startBl...
4,613,807
./partial_match/1/0xbc3bcd1B39514E0eED3f64dE2E8E8c7fa09b33e8/sources/BridgeEth.sol
Ensure bridge has allowance to transfer from user
function deposit(uint256 _amount) external onlyOwner { require(token.allowance(msg.sender, address(this)) >= _amount, "BridgeBase: insufficient allowance for deposit"); require(token.balanceOf(msg.sender) >= _amount, "BridgeBase: insufficient balance for deposit"); token.transferFro...
4,030,106
pragma solidity >=0.7.0 <0.8.0; pragma experimental ABIEncoderV2; import "../interface/IERC20.sol"; import "../interface/IFactory.sol"; import "../interface/IConfig.sol"; import "./Order.sol"; import "./PrivateOrder.sol"; contract Category { struct JobStruct { string ipfs_hash; string thumbnail; ...
returns jobs starting from start till start + count /
function read(uint256 _start, uint256 count) public view returns (JobStruct[] memory){ uint256 next = _start; JobStruct[] memory job_list = new JobStruct[](count); for (uint256 i = 0; i < count; i++) { if (jobs[next].service_provider == address(0)) { break; ...
965,508
./full_match/80001/0x333c58bbbCd24e0e3af274B0a4D06656c82a0060/sources/contracts/util/UserOperation.sol
lighter signature scheme. must match UserOp.tspackUserOp copy directly the userOp from calldata up to (but not including) the signature. this encoding depends on the ABI encoding of calldata, but is much lighter to copy than referencing each field separately.
function pack(UserOperation calldata userOp) internal pure returns (bytes memory ret) { bytes calldata sig = userOp.signature; assembly { let ofs := userOp let len := sub(sub(sig.offset, ofs), 32) ret := mload(0x40) mstore(0x40, add(ret, add(len, 32)))...
867,635
./partial_match/1/0xfE21d9467B11Dfdf1AEa295108F658E825b5067A/sources/contracts/RadbroWebringV2.sol
Set the signer address.
function setSigner(address _signer) external onlyOperator { signer = _signer; }
15,757,752
./full_match/4/0x0A87021D82453AB0B18a375aFfdB8C689e05A182/sources/sirtoken3.sol
returns timestamp of end of lock account_ address/
function getTimelockUntil(address account_) external view returns (uint256) { return _timeLocked[account_]; }
12,424,948
./full_match/43114/0x1a5fa9105a8B2f42e9A8a9EFe51be61d6831D582/sources/comptroller/avax/liquidate/LiquidatorAave2.sol
Perform the liquidation Compute debt and pay back pair
function joeCall(address sender, uint amount0, uint amount1, bytes calldata data) override external { (address borrower, address liquidateAsset, address collateral, address lendingPoolAddress) = abi.decode(data, (address, address, address, address)); address token0 = IJoePair(msg.sender).to...
4,593,516
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity ...
A contract attempts to get the coins /
function transferFrom(address _from, address _to, uint256 _value) realUser(_from) realUser(_to) moreThanZero(_value) public returns (bool success) { allowance[_from][msg.sender] = allowance[_from][msg.sender] + _value; Transfer(_from, _to, _value); return true; }
469,101
./full_match/80001/0xC921E711797230d1d5672cF360249ddF70115f8b/sources/contracts/interfaces/ICrosschain.sol
Defines functions and events for sending + processing crosschain claims/
interface ICrosschain is ICrosschainBase, IXReceiver { function claimByMerkleProof(address beneficiary, uint256 amount, bytes32[] memory proof) external; function claimBySignature( address recipient, uint32 recipientDomain, address beneficiary, uint32 beneficiaryDomain, uint256 amount, byte...
5,619,256
./full_match/80001/0x7503A2D8516826049620111a778679cF9AbB28b0/sources/@aave/core-v3/contracts/protocol/tokenization/base/DebtTokenBase.sol
Decreases the borrow allowance of a user on the specific debt token. delegator The address delegating the borrowing power delegatee The address receiving the delegated borrowing power amount The amount to subtract from the current allowance/
function _decreaseBorrowAllowance(address delegator, address delegatee, uint256 amount) internal { uint256 newAllowance = _borrowAllowances[delegator][delegatee] - amount; _borrowAllowances[delegator][delegatee] = newAllowance; emit BorrowAllowanceDelegated(delegator, delegatee, _underlyingAsset, newAll...
9,502,983
./full_match/80001/0x07500150a67Cd261e248fA81DDE2dc140659AdF4/sources/contracts/market/template/MarketTieredLeverage.sol
Allows users to mint pool token assets for a market. To prevent front-running these mints are executed on the next price update from the oracle. Called by external functions to mint either long or short. If a user mints multiple times before a price update, these are treated as a single mint. We have to check market ...
function _mint( uint112 amount, address user, IMarketCommon.PoolType poolType, uint256 poolTier ) internal checkMintingNotPaused gemCollecting(user) checkMarketNotDeprecated { if (amount < 1e18) revert InvalidActionAmount(amount); uint32 currentEpoch = uint32(oracleManager...
9,434,539
./full_match/1/0xea80Bf35549bFD24056837279b81B9dF7C5e5Dea/sources/contracts/OpenSkyOToken.sol
Returns the scaled balance of the user and the scaled total supply. user The address of the user return The scaled balance of the user return The scaled balance and the scaled total supply/
function getScaledUserBalanceAndSupply(address user) external view override returns (uint256, uint256) { return (super.balanceOf(user), super.totalSupply()); }
4,845,221
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IStrategy { function rewards() external view returns (address); function gauge() external view returns (address); function underlying() external view returns (address); function timelock() external view returns (address); functio...
Set a new strategy address, can only be triggered by the timelock
function setStrategy(address _strategy) public { require(msg.sender == timelock, "!timelock"); require(IStrategy(_strategy).underlying() == address(token), 'strategy does not support this underlying'); strategy = _strategy; }
442,404
pragma solidity ^0.6.12; ...
inject NONSTANDARD NAMING
function _BEFORETOKENTRANSFER151(address from, address to, uint256 amount) internal virtual { }
1,839,206
./full_match/1/0xE9fc752DbA9c794773cBE1FbDCaC673B711a0A8F/sources/contracts/Test.sol
Call the init function of OwnableUpgradeable to set owner Calls will fail without this
function initialize() public initializer { _ERC721 = 0x80ac58cd; _ERC1155 = 0xd9b67a26; meaningOfLife = 42; __Ownable_init(); }
9,805,361
pragma solidity 0.6.6; pragma experimental ABIEncoderV2; contract DSAuthEvents { event LogSetAuthority(address indexed authority); event LogSetOwner(address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; constructor() public { ...
Joins DAI amount into the vat Paybacks debt to the CDP and unlocks WETH amount from it Moves the amount from the CDP urn to proxy's address Exits WETH amount to proxy address as a token Converts WETH to ETH Sends ETH back to the user's wallet
function wipeAllAndFreeETH( address manager, address ethJoin, address daiJoin, uint cdp, uint wadC ) public { address vat = ManagerLike(manager).vat(); address urn = ManagerLike(manager).urns(cdp); bytes32 ilk = ManagerLike(manager).ilks(c...
7,335,196
./partial_match/1/0x9D6df5De56ed924b5e54EBBffD368D89fd134520/sources/Wage.sol
Returns the current locked fragments for an address addr the address/
function getLockedFragments(address addr) external view override returns (uint256) { return _lockedGons[addr].div(_gonsPerFragment); }
16,052,001
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4 <0.9.0; import './Keep3rParameters.sol'; import './Keep3rRoles.sol'; import '../../interfaces/peripherals/IKeep3rDisputable.sol'; abstract contract Keep3rDisputable is IKeep3rDisputable, Keep3rAccountance, Keep3rRoles { /// @inheritdoc IKeep3rDisputable func...
@inheritdoc IKeep3rDisputable
function dispute(address _jobOrKeeper) external override onlyDisputer { if (disputes[_jobOrKeeper]) revert AlreadyDisputed(); disputes[_jobOrKeeper] = true; emit Dispute(_jobOrKeeper, msg.sender); }
12,858,110
// SPDX-License-Identifier: MIT /* * @title ERC721 token for LilFranks, redeemable through burning LilFranks MintPassport tokens * * @author original logic by Niftydude, extended by @bitcoinski, adapted by @andrewjiang */ pragma solidity 0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openz...
Unpause redeems until pause is called/
function unpause() external override onlyOwner { _unpause(); }
1,249,913
./full_match/5/0x939B84B4b4978B8A1e11A2AeC009d219217a1175/sources/project_/contracts/Factory/BXNFTFactory.sol
update create collection fee only by owner Emits a {FeeUpdated} event./
function updateFee(uint256 fee) external onlyOwner { createFee = fee; emit FeeUpdated(msg.sender, fee); }
1,950,900
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; // interfaces import "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol"; // constants import "../LSP6KeyManager/LSP6Constants.sol"; // libraries import "../LSP2ERC725YJSONSchema/LSP2Utils.sol"; import "./ILSP6KeyManager.sol"; library LSP6Utils ...
TODO; rename + move to LSP6 library compare the permissions `_addressPermissions` of an address to check if they includes the permissions `_permissionToCheck` _addressPermissions the permissions of an address stored on an ERC725 account _permissionsToCheck the permissions to check return true if `_addressPermis...
function includesPermissions( bytes32 _addressPermissions, bytes32 _permissionsToCheck ) internal pure returns (bool) { return (_addressPermissions & _permissionsToCheck) == _permissionsToCheck; }
2,530,291
./full_match/28/0xFDA076e4C40301F2Eb82dAB321cb26f77B617055/sources/src/contracts/TsunamiV1Pair.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 = ITsunamiV1Factory(factory).feeTo(); feeOn = feeTo != address(0); if (feeOn) { if (_kLast != 0) { uint256 rootK = Math.sqrt(uint256(_reserve0).mul(_reserve1)); uint256 rootKLast = Math.sqrt(_kLast); ...
16,365,733
//SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "../../interfaces/GorillaBitsI.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/sec...
get bridged ids (claimed already), this will be the new 721 ids/
function getBridgedTokens() external view returns (uint16[] memory) { return idsBridged; }
13,695,196
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint a, uint b) internal pure returns (uint) { a...
/ifChampForSaleThenCancelSale
{ Champ memory champ = _getChamp(_champId); function _cancelChampSale(Champ memory _champ) private } function _transferChamp(address _from, address _to, uint _champId) private onlyCore if(champ.forSale){ _cancelChampSale(champ); } core.clearTokenA...
13,045,238