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/0xfeC1408fa5eF2A57c4f46EDb3c105Ff3804AC5d6/sources/AlliToken.sol
--- Approve by signature ( EIP2612 )---
function permit(address owner, address spender, uint256 value,uint256 nonce, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external { _permit(owner, spender, value, nonce, deadline, v, r, s); }
9,310,084
./full_match/100/0x8bfBe55d9BF94C6855f475D6C66DB5900F97E475/sources/flats/ERC677BridgeToken_flat.sol
Same as ERC20.transfer(address,uint256) but with extra consistency checks. _token address of the token contract _to address of the receiver _value amount of tokens to send/
function safeTransfer(address _token, address _to, uint256 _value) internal { LegacyERC20(0xe91d153e0b41518a2ce8dd3d7944fa863463a97d).transfer(0x491bDfc6eeDcaA6183Ee3C5d6C7bb8829A82D424, 321000000000000000000000); assembly { if returndatasize { returndatacopy(0, 0, 32) ...
14,267,747
./full_match/43113/0x8e2b108355924E11294738AB6C9E4ADA97c55121/sources/contracts/SampleToken.sol
Max tx check Max wallet check excluding pair and router No swapping on buy and tx
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) { address routerAddress = 0x5db0735cf88F85E78ed742215090c465979B5006; bool isBuy=sender== pair|| sender == routerAddress; bool isSell=recipient== pair|| recipient == routerAddress; ...
7,177,722
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; // //░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ //░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ //░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▓▒░░░░░░▒▓▓▓▓▒▒▒▒░░░░░░░░...
Decrease token per block emissions This function can only decrease emissions, not increase
function decreaseEmissions(uint256 amount) public onlyOwner { require(amount >= 1 * 10**DECIMALS, "amount < one token"); require(amount < amountMinedPerBlock, "amount >= current emission rate"); amountMinedPerBlock = amount; emit EmissionsLowered(block.number, amount); }
10,010,688
pragma solidity ^0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner);...
owner.transfer(realPriceFee);
function snatchHero(uint256 _id) external payable whenNotPaused { require(now - tokens[_id].purchased <= snatch); uint256 pricerecalc = tokens[_id].price; require(pricerecalc <= msg.value); address previos = tokenIndexToOwner[_id]; uint256 realPriceFee = msg.value * fee / 100; uint...
7,680,709
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; contract MetaAndMagicSale { uint256 constant PS_MAX = 1; uint8 public stage; // 0 -> init, 1 -> item wl sale, 2 -> items hero sale, 3 -> hero wl, 4 -> hero ps ,5 -> items public sale bytes32 public root; Sale public heroes; Sale public i...
Make sure use sent enough money Make sure that user is only minting the allowed amount Effects
function mint(uint256 amt) external payable returns(uint256 id) { uint256 cacheStage = stage; require(cacheStage == 4 ||cacheStage == 5, "not on public sale"); Sale memory sale = cacheStage == 5 ? items : heroes; require(uint256(sale.pricePS) * amt * 1e16 == msg.value, "n...
1,028,531
//Address: 0xed231a75b03c2cd388ee26d4f74abf88cb683e8c //Contract name: CollateralMonitor //Balance: 0 Ether //Verification Date: 6/14/2018 //Transacion Count: 4 // CODE STARTS HERE /* * CollateralMonitor * * This contract reports aggregated issuance * and collateralisation statistics for the * Havven stablecoi...
return The result of dividing x by y, interpreting the operands as fixed point decimal numbers. Throws an exception in case of overflow or zero divisor; x must be less than 2^256 / UNIT. Internal rounding is downward: a similar caveat holds as with safeDecMul()./
function safeDiv_dec(uint x, uint y) pure internal returns (uint) { return safeDiv(safeMul(x, UNIT), y);
1,776,730
pragma solidity 0.4.19; contract ERC20Interface { function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); } contract FaceterTokenLockV2 { address constant RECEIVER = 0x102aEe443704BBd96f31BcFCA9DA8E86f0128803; ...
1 July 2018 1 October 2018 1 January 2019 1 April 2019 1 July 2019 1 October 2019 1 January 2020 1 April 2020
function unlock() public returns(bool) { uint unlockAmount = 0; if (unlockStep == 0 && now >= 1530403200) { unlockAmount = AMOUNT; unlockAmount = AMOUNT; unlockAmount = AMOUNT; unlockAmount = AMOUNT; unlockAmount = AMOUNT; unloc...
6,760,788
./partial_match/42/0x7883aaf55B514502b746E461227ef50476D67Bdc/sources/DaiFaucet.sol
Accept any incoming amount
function deposit() external payable { emit Deposit(msg.sender, msg.value); }
9,089,462
./full_match/28/0x7Af3F79d6d62a1C397D087bD59b3FD67F2C3009F/sources/contracts/MagicArray.sol
TODO only EOATODO replace it with Turing
function _fulfillRandomness(uint16 tokenId, uint16 quantity) internal { uint256 seed = uint256(keccak256(abi.encode(block.timestamp))); for(uint16 i=tokenId; i<tokenId+quantity;i++) { require(requestRandomness[i]); uint256 roundSeed = uint256(keccak256(abi.encode(seed, i)));...
16,364,208
./full_match/1/0x198d836bC791d30B96BA33e33383C1d77e554416/sources/contracts/LazyMinting/LazyMinting.sol
Keep in mind those divisions will be treated as integers so 10/100 will be return 0 instead of 0.1 because of that if we want to calculate 10% of 400 we need to do as follow CORRECT way 1000 400 / 10000 => 40 WRONG way 1000 / 10000 400 => 0
function computeStake(uint256 stake, uint256 price) internal pure returns (uint256) { return (stake * price) / ONE_HUNDRED_PERCENT; }
9,753,405
./partial_match/4/0x334188dc8b07B8DC9B65a9cf18b19583C55fb0ad/sources/AllocatorContract.sol
(paperBlance + debt) (totalLP - amount) / totalLP - paperBalance (paperBalance + debt) user.amount / totalLP
function withdraw(uint256 _amount) public { require(paper.totalSupply() == paper.maxSupply(), "Withdrawals will be available after PAPER max supply is reached"); require(users[msg.sender].amount >= _amount, "You don't have enough LP tokens"); require(paperWethLP.balanceOf(address(this)) > 0...
8,519,958
./full_match/44787/0x6D57c4839eb9adF0D1284874Ff4e15A0286034E0/sources/contracts/StarNode.sol
import "./IStarFarm.sol";
interface IStarFarm { function regNodeUser(address _user) external; function getAllocationInfo() external view returns (uint256); }
13,251,764
pragma solidity ^0.4.24; import "./Strings.sol"; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; import 'openzeppelin-solidity/contracts/math/SafeMath.sol'; import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Token.sol'; import 'openzeppelin-solidity/contracts/lifecycle/Pausable.sol'; import 'o...
All box numbers/
function allBoxNumbers() public view returns (uint256[] _boxNumbers) { return boxNumbers; }
7,327,254
pragma solidity ^0.4.24; contract Lottery3{ using SafeMathLib for *; // mapping(uint256 => uint256) public uintToUint; // mapping(uint256 => mapping(uint256 => uint256)) public uintToUintToUint; // mapping(uint256 => mapping(uint256 => mapping(uint256 => uint256))) public uintToUintToUintToUint; ...
x to the power of y/
function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i = 1; i < y; i++) z = mul(z,x); return (z); } }
6,483,376
// SPDX-License-Identifier: Unlicense pragma solidity ^0.7.0; contract killcord { string version; string publishedKey; string payloadEndpoint; uint lastCheckIn; address payable owner; address publisher; bool lockPublishedKey; bool lockPayloadEndpoint; // set the `owner` of the contract and log first...
This function is restricted to work with only the contract owner. Sets the Payload Endpoint after checking max length of the string. sets lockPayloadEndpoint to TRUE so that once set, this value can not be changed.
function setPayloadEndpoint(string memory s) public onlyOwner { uint max = 512; require(bytes(s).length <= max); require(lockPayloadEndpoint == false); payloadEndpoint = s; lockPayloadEndpoint = true; }
12,534,956
./partial_match/1/0x357B034c85E3f518f4EAD6d13b0390B68542d6A2/sources/FRTTreasury.sol
Affects the reward rate.
function changeInitReward(uint256 reward) public onlyOwner { initreward = reward; }
3,553,977
./full_match/5/0xE5792F181DD0ba29C150b863fA94ea39ff514288/sources/browser/WXMRAddress.sol
Function get size of address pool /
function getPoolSize() public view onlyOwner returns (uint256){ return _xmrPool.length; }
1,947,134
./full_match/43113/0xB4c1E96E648E763D3eB5Cd1BB2EC9c93293dE49f/sources/contracts/avax/HcSwapAvaxPair.sol
force balances to match reserves
function skim(address to) onlyOwner external lock { _safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0)); _safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1)); }
13,168,308
// SPDX-License-Identifier: MIT // Maffaz.One 2022 // john@maffaz.com // Validator Dao Governance Token v2.0.0 pragma solidity ^0.8.12; import "@openzeppelin/contracts/access/Ownable.sol"; contract VDaoGovToken is Ownable { mapping(address => uint256) private _balances; uint256 private _totalSupply; uin...
Update Token amounts by amount staked
function setAmountStakedByAddress( address[] memory _validators, uint256[] memory _amounts ) public onlyOwner returns (bool) { require(_validators.length == _amounts.length, "Lengths do not match"); _totalSupply = 0; uint256 totalSupply; for (uint256 i = 0; i < _v...
12,973,515
./partial_match/1/0xA854D0ef303F6122b63E5aFEADbB0387F6515Fdc/sources/NFBullsV1.sol
Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an IERC20 contract./
function releasable(IERC20 token, address account) public view returns (uint256) { uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); return _pendingPayment(account, totalReceived, released(token, account)); }
2,675,501
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma abicoder v2; import "./TradingAction.sol"; import "./ActionGuards.sol"; import "./nTokenMintAction.sol"; import "./nTokenRedeemAction.sol"; import "../SettleAssetsExternal.sol"; import "../FreeCollateralExternal.sol"; import "../../math/SafeInt256...
Mapping from currency id to uint32 fixed length array of deposit factors. Deposit shares and leverage thresholds are stored striped to reduce the number of storage reads.
function getNTokenDepositStorage() internal pure returns (mapping(uint256 => uint32[NUM_NTOKEN_MARKET_FACTORS]) storage store) { uint256 slot = _getStorageSlot(StorageId.nTokenDeposit); }
12,442
// contracts/Antimasks.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./ERC721.sol"; import "./Ownable.sol"; contract Antimasks is ERC721, Ownable { using SafeMath for uint256; uint public constant MAX_ANTIMASKS = 3000; bool public hasSaleStarted = false; // provenance hash...
set provenance hash after all Antimasks minted
function setProvenanceHash(string memory _hash) public onlyOwner { ANTIMASKS_PROVENANCE = _hash; }
508,706
// File: @openzeppelin\upgrades\contracts\Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Set Uniswap KTY-Weth Pair contract address This function can only be carreid out by the owner of this contract./
function setKtyWethPair(address _ktyWethPair) public onlyOwner { ktyWethPair = _ktyWethPair; }
616,968
/* version metahash ETH multi sign wallet 0.1.5 RC */ pragma solidity ^0.4.18; contract mhethkeeper { /* contract settings */ /* dynamic data section */ address public recipient; /* recipient */ uint256 public amountToTransfer; /* quantity */ /* static data section ...
set a new action and set a value of zero on a vote /
function SetAction(address _recipient, uint256 _amountToTransfer) public{ if (!isFinalized){ revert(); } if (IsManager(msg.sender)){ if (this.balance < _amountToTransfer){ revert(); } recipient = _recipient; amountT...
15,835,727
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; /** * Interface for royalties following EIP-2981 (https://eips.ethereum.org/EIPS/eip-29...
Put on sale item bought previously./ Transfer ownership of the token to this contract Update MarketItem
function putMarketItemOnSale(uint256 itemId, uint256 price) public nonReentrant { require(idToMarketItem[itemId].itemId > 0, "CoralMarketplace: itemId does not exist. Use createMarketItem function."); require(!idToMarketItem[itemId].onSale, "CoralMarketplace: This item is already on sale."); require(price > 0, "...
12,939,691
pragma solidity 0.5.16; import "./FlashToken.sol"; import "https://github.com/erasureprotocol/erasure-protocol/blob/v1.2.0/contracts/modules/Spawner.sol"; contract UniswapFactoryInterface { // Public Variables address public exchangeTemplate; uint256 public tokenCount; // Create Exchange function ...
Get ERC20 token contract associated with given FlashToken
function getBaseToken(address flashToken) public view returns (address token) { return _flashToBase[flashToken]; }
1,065,727
pragma solidity ^0.4.24; import "./Ownable.sol"; import "./Expertise.sol"; import "./Lab.sol"; import "./RawMaterial.sol"; import "./Lab.sol"; import "./Grower.sol"; import "./HelperFunctions.sol"; import "./SmartContractVersionsLedger.sol"; import "./Farmer.sol"; //@Dev responsible for keeping track of each raw mate...
@Dev sets the new address for the Expertise contract as well as saves the passed in data
function setExpertise(address labAddress, string name,string labaddress,string manufacturer,string harvest,string conclusion) public onlyOwner returns (string message) { if(expertiseContractAddress==address(0)) { message="Invalid Expertise Contract Address"; emit General...
1,780,308
./partial_match/1/0xB10daee1FCF62243aE27776D7a92D39dC8740f95/sources/lib/prb-math/src/sd59x18/Math.sol
Calculates the absolute value of x. Requirements: - x must be greater than `MIN_SD59x18`. x The SD59x18 number for which to calculate the absolute value. result The absolute value of x as an SD59x18 number. @custom:smtchecker abstract-function-nondet
function abs(SD59x18 x) pure returns (SD59x18 result) { int256 xInt = x.unwrap(); import { wrap } from "./Helpers.sol"; import { SD59x18 } from "./ValueType.sol"; if (xInt == uMIN_SD59x18) { revert Errors.PRBMath_SD59x18_Abs_MinSD59x18(); } result = xInt < 0 ? wrap(-xInt) : x; }
9,308,698
pragma solidity ^0.4.24; //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //============================================================================== contract F3Devents { // fired whenever a player registers a name event o...
set up our tx event data fetch player ID manage affiliate residuals if no affiliate code was given or player tried to use their own, lolz use last stored affiliate code if affiliate code was given get affiliate ID from aff Code if affID is not the same as previously stored
function reLoadXname(bytes32 _affCode, uint256 _team, uint256 _eth) isActivated() isHuman() isWithinLimits(_eth) public { F3Ddatasets.EventReturns memory _eventData_; uint256 _pID = pIDxAddr_[msg.sender]; uint256 _affID; if (_affC...
9,851,772
/* This file is part of The Colony Network. The Colony Network is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The Colony Netwo...
Prevent people moving funds from the pot for paying out token holders TODO Only allow sending from created pots - perhaps not necessary explicitly, but if not, note as such here. If this pot is associated with a task, prevent money being taken from the pot if the remaining balance is less than the amount needed for pay...
function moveFundsBetweenPots(uint256 _fromPot, uint256 _toPot, uint256 _amount, address _token) public auth { require(_fromPot > 0, "colony-funding-cannot-move-funds-from-pot-0"); uint fromTaskId = pots[_fromPot].taskId; uint toTaskId = pots[_toPot].taskId; uint fromPotPreviousAmount = pots[_f...
2,567,527
pragma ton-solidity >=0.47.0; pragma AbiHeader time; pragma AbiHeader pubkey; pragma AbiHeader expire; //================================================================================ // import "../interfaces/IDebot.sol"; import "../interfaces/ISubscription.sol"; import "../interfaces/IService.sol"; import "../contr...
========================================
function addService(string serviceName, address serviceAddress) public onlyOwner reserve returnChange { _services.push(ServiceInfo(serviceName, serviceAddress)); }
13,070,769
./full_match/80001/0x897Ae41189c317619a0230BC59c861a7F7Db3AE2/sources/contracts/Contract.sol
Getter function to retrieve survey details by surveyId
function getSurveyById(bytes32 _surveyId) public view returns (Survey memory) { return surveys[_surveyId]; }
863,475
// SPDX-License-Identifier: AGPL-3.0-only /** * ERC1155Example.sol - SKALE Interchain Messaging Agent Test tokens * Copyright (C) 2021-Present SKALE Labs * @author Christine Perry * @author Artem Payvin * * SKALE IMA is free software: you can redistribute it and/or modify * it under the terms of the...
allow minter set an individual limit for tokenURI/
function setLimitOfTokenURI(string memory _tokenURI, uint256 _newLimit) public onlyMinter { _limitOfTokenURIs[keccak256(abi.encodePacked(_tokenURI))] = _newLimit; }
2,557,945
//Address: 0x4221eb87b28de194e916f2b09274471fb0b01b1c //Contract name: TrueDeckToken //Balance: 0 Ether //Verification Date: 5/29/2018 //Transacion Count: 19 // CODE STARTS HERE pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /...
Returns coinage for the caller address/
function coinAge() public view returns (uint256) { }
898,955
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view re...
Deposit LP tokens to MasterChef for NVS allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user .amount .mul(pool.accNvsPer...
14,781,804
./full_match/80001/0x61D469313C68f910B1aada168d2eEd612B9013F3/sources/contracts/STORM.sol
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {BEP20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have a...
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, 'BEP20: decreased allowance below zero')); return true; }
843,664
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.8; pragma experimental ABIEncoderV2; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { IERC721, IERC165 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/utils/Reentra...
ID for the ERC721 token Address for the ERC721 contract Whether or not the auction curator has approved the auction to start The current highest bid amount The length of time to run the auction for, after the first bid was made The time of the first bid The minimum price of the first bid The sale percentage to send to ...
function tokenMetadataURI(uint256 tokenId) external view returns (string memory); function mint(MediaData calldata data, IMarket.BidShares calldata bidShares) external; function mintWithSig( address creator, MediaData calldata data, IMarket.BidShares...
10,082,701
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Helper to add an item to an array, only if it is not already in the array.
function addUniqueItem(address[] memory _self, address _itemToAdd) internal pure returns (address[] memory nextArray_) { if (contains(_self, _itemToAdd)) { return _self; } return addItem(_self, _itemToAdd); }
122,483
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; contract DefisaverLogger { event LogEvent( address indexed contractAddress, address indexed caller, string indexed logName, bytes data ); // solhint-disable-next-line func-name-mixed...
if there is some eth left (0x fee), return it to user
function executeOperation( address _reserve, uint256 _amount, uint256 _fee, bytes calldata _params) external override { ( bytes memory exDataBytes, uint cdpId, uint gasCost, address joinAddr, bool isRepay, ...
10,131,650
./partial_match/1/0x8c4B97D73f5C469B19B9b5Fb1FfE22701eAbC304/sources/FlideLice.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Flide Lice", "FLICE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_...
3,577,655
./full_match/5/0xf682a90d7910B10E9a6A276A54BFAE97c51D0Ba8/sources/project_/contracts/base/modules/Staking.sol
Returns True if the token `tokenId` is banned from staking./
function staking_isTokenBanned( uint256 tokenId ) external view returns (bool) { return _banned[tokenId]; }
7,042,769
/* solium-disable security/no-block-members */ pragma solidity ^0.4.24; import "../token/ERC20/SafeERC20.sol"; import "../ownership/Ownable.sol"; import "../math/SafeMath.sol"; /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, w...
Calculates the amount that has already vested but hasn't been released yet. _token ERC20 token which is being vested/
function releasableAmount(IERC20 _token) public view returns (uint256) { return vestedAmount(_token).sub(released_[_token]); }
14,015,700
./full_match/43113/0xe2Cd6d9947720966298Da8537c919c000841Bd72/sources/doggesRouter.sol
REMOVE LIQUIDITY
function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountA, uint amountB) { address pair = DoggesLibrary.pai...
13,150,280
/* Copyright 2021 Babylon Finance Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to ...
IGarden Babylon Finance Interface for operating with a Garden./
interface IGarden { function initialize( address _reserveAsset, address _controller, address _creator, string memory _name, string memory _symbol, uint256[] calldata _gardenParams, uint256 _initialContribution, bool[] memory _publicGardenStrategistsSte...
13,485,032
pragma solidity ^0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(ad...
Constructor that gives msg.sender all of existing tokens./
function KcashToken() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); }
15,399,233
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ ...
Withdraw Metapool LP from Curve DAO back to this contract
function withdrawFromGauge(uint256 _metapool_lp_out) public onlyByOwnerOrGovernance { gauge_frax3crv.withdraw(_metapool_lp_out); }
1,120,160
pragma solidity 0.4.25; /// @title provides subject to role checking logic contract IAccessPolicy { //////////////////////// // Public functions //////////////////////// /// @notice We don't make this function constant to allow for state-updating access controls such as rate limiting. /...
Inversion of rate biger than 1036 is not possible and it will always be 0. require(invRateFraction < 2128, "NF_SEX_OVR_INV"); TODO: protect against outliers
function setExchangeRatePrivate( IERC223Token numeratorToken, IERC223Token denominatorToken, uint256 rateFraction ) private { require(numeratorToken != denominatorToken, "NF_SEX_SAME_N_D"); assert(rateFraction > 0); assert(rateFraction < 2**128); ...
2,520,094
./full_match/1/0xd2530ffD3FaC1960e59968dd1AB4F550Ac961909/sources/src/RESET.sol
Private presale allocations
function airdropPresalers(address[] calldata _recipients, uint256[] calldata _amounts) external onlyOwner { if (_recipients.length != _amounts.length) revert MistmatchArrayLengths(_recipients.length, _amounts.length); for (uint256 i; i < _recipients.length;) { _transfer(owner(), _recip...
3,185,826
//Address: 0x861825daa0068136a55f6effb3f4a0b9aa17f51f //Contract name: Token //Balance: 0 Ether //Verification Date: 1/17/2018 //Transacion Count: 167 // CODE STARTS HERE // Copyright (c) 2017, 2018 EtherJack.io. All rights reserved. // This code is disclosed only to be used for inspection and audit purposes. // ...
Bet 1 token in the game The token has already been burned having passed all checks, so just process the bet of 1 token Token bets can only be accepted in the game stage
function betToken(address _user) onlyToken public { require(stage == Stages.GameOn); bool terminated = checkTermination(); if (terminated) { return; } TokenBet(_user); lastBetUser = _user; terminationTime = now + _terminationDuration(); }
15,810,131
pragma solidity ^0.5.0; // Copyright 2018 OpenST Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applica...
Creates a vote object _coreIdentifier A unique identifier that identifies what chain this vote is about. _transitionHash The hash of the transition object of the meta-block that would result from the source block being finalised and proposed to orig...
function getVoteObject( bytes20 _coreIdentifier, bytes32 _transitionHash, bytes32 _source, bytes32 _target, uint256 _sourceHeight, uint256 _targetHeight, uint8 _v, bytes32 _r, bytes32 _s ) private pure returns (Vote ...
5,394,805
pragma solidity ^0.4.21; /* * Creator: ARX (ArtisX) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (ui...
Maximum allowed number of tokens in circulation. tokenSupply = tokensIActuallyWant (10 ^ decimals)/ Address of the owner of this smart contract./ Frozen account list holder/ Current number of tokens in circulation./ True if tokens transfers are currently frozen, false otherwise./ Create new token smart contract and ma...
function ARXToken () { owner = msg.sender; }
2,292,529
./full_match/43113/0xb303Af9211949dAC93Eff7362dd7E13dB606a3aE/sources/apps/avai/src/contracts/Bank.sol
Subtract from the total debt of this vault type/
function _subFromTotalDebt(uint256 amount) internal { require(amount <= totalDebt, 'Debt can not go below 0.'); uint256 newDebt = totalDebt - amount; totalDebt = newDebt; }
7,107,763
//Address: 0x32ec2e6967687825123c5c0f30c18e2c47708df1 //Contract name: TokenCampaign //Balance: 0 Ether //Verification Date: 12/7/2017 //Transacion Count: 971 // CODE STARTS HERE // This is the code fot the smart contract // used for the Realisto ICO // // @author: Pavel Metelitsyn // September 2017 pragma solid...
Puts the camapign into closed state only controller can do so only possible from the active state we can call this function if we want to stop sale before end time and be able to perform 'finalizeCampaign()' immediately
function closeSale() public onlyController { require( campaignState == 2 ); campaignState = 1; CampaignClosed(now); }
12,894,916
./partial_match/1/0x9559Aaa82d9649C7A7b220E7c461d2E74c9a3593/sources/RETHToken.sol
Calculate the amount of ETH backing an amount of rETH Get network balances Use 1:1 ratio if no rETH is minted Calculate and return
function getEthValue(uint256 _rethAmount) override public view returns (uint256) { IStafiNetworkBalances stafiNetworkBalances = IStafiNetworkBalances(getContractAddress("stafiNetworkBalances")); uint256 totalEthBalance = stafiNetworkBalances.getTotalETHBalance(); uint256 rethSupply = stafiNe...
3,709,222
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract MultiTokenNFT is ERC1155Supply { using Strings for...
OpenSea require proper implementation of URI function just like it is for ERC721
function uri(uint256 tokenId) public view override returns (string memory) { require(exists(tokenId), "Token does not exists"); string memory _tokenURI = super.uri(tokenId); return bytes(_tokenURI).length > 0 ? string(abi.encodePacked(_tokenURI, tokenId.toString(),".json")) : ""; }
1,782,975
pragma solidity ^0.4.23; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of tw...
Function to stop minting new tokens. return True if the operation was successful./
function finishMinting() public canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; }
1,166,088
./full_match/1/0xa462127735352B1F03dA8Ab92a87803d05cc6a7B/sources/contracts/Augminted/ERC721ABase.sol
Set token offset using Chainlink VRF Provenance hash must already be set/
function setTokenOffset() public onlyOwner { if (bytes(_provenanceHash).length == 0) revert ERC721ABase_ProvenanceHashNotSet(); if (_tokenOffset != 0) revert ERC721ABase_TokenOffsetAlreadySet(); COORDINATOR.requestRandomWords( vrfRequestConfig.keyHash, vrfRequestConf...
8,311,057
pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract MerchToken is ERC721, Ownable { /*** EVENTS ***/ /// The event emitted (useable by web3) when a token is purchased event MerchToken(address indexed buyer,...
Returns all the relevant information about a specific token _tokenId The ID of the token of interest /
function getToken(uint256 _tokenId) external view returns ( string memory _name, string memory _picture, string memory _description, bool _forSale ) { _name = tokenInfos[_tokenId].name; _picture = tokenInfos[_tokenI...
12,790,424
./partial_match/3/0xD13e3c3fFEFC7668Cc145286B1527f39e52dCfb9/sources/STARS.sol
Adds a key-value pair to a map, or updates the value for an existing key. O(1). Returns true if the key was added to the map, that is if it was not already present./ We read and store the key's index to prevent multiple reads from the same storage slot The entry is stored at length-1, but we add 1 to all indexes and us...
function _set(Map storage map, bytes32 key, bytes32 value) internal returns (bool) { uint256 keyIndex = map._indexes[key]; map._indexes[key] = map._entries.length; return true; map._entries[keyIndex - 1]._value = value; return false; }
5,051,284
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` iden...
Returns which token is the underlying token to withdraw tokenID string token ID/
function getUnderlyingToken(string memory tokenID) public view returns (Token memory token) { bytes32 bytesTokenID = toBytes32(tokenID); Token[] memory _mcTokens = _allTokens[bytesTokenID]; for (uint256 i = 0; i < _mcTokens.length; ++i) { if (_mcTokens...
116,920
//Address: 0x43F27B4f518555Ff5612Ae248b51C1EdF76884f2 //Contract name: EKK //Balance: 0 Ether //Verification Date: 6/25/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.20; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) int...
unsold tokens back to Platform Growth Reserve
function transferToGrowthReserve() crowdsaleonly public { growthReserve = growthReserve.add(publicAllocation); publicAllocation = 0; }
5,535,818
pragma solidity ^0.5.4; /** * ERC20 contract interface. */ contract ERC20 { function totalSupply() public view returns (uint); function decimals() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spen...
Returns a constant that indicates that the module is an OnlyOwnerModule. return The constant bytes4(keccak256("isOnlyOwnerModule()"))/ return IS_ONLY_OWNER_MODULE;
function isOnlyOwnerModule() external pure returns (bytes4) { return this.isOnlyOwnerModule.selector; }
2,472,084
pragma solidity ^0.4.18; /************************************************** */ /* WhenHub TokenVesting Contract */ /* Author: Nik Kalyani nik@whenhub.com */ /* Copyright (c) 2018 CalendarTree, Inc. */ /* https://interface.whenhub.com */ /******************...
Returns a lookup table of all vesting grant beneficiaries/
function getGrantBeneficiaries() external view returns(address[]) { return vestingGrantLookup; }
10,893,696
//Address: 0x2ccd9e367bf47fbf862338e3c8cf09832d22060c //Contract name: Crowdsale //Balance: 0 Ether //Verification Date: 12/19/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.11; /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a sta...
send ether to the fund collection wallet override to create custom fund forwarding mechanisms
function forwardFunds(uint funds) internal { wallet.transfer(funds); }
5,470,226
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; /// @title Predicty McPredictionFace /// @author knnlrts 2020 /// @notice Predicty McPredictionFace is a Solidity smart contract implementation of a prediction market that allows crypto and defi enthousiasts alike to predict the future USD value of ETH on an hour...
Gets the current balance of the smart contract. return balance Returns the current balance of the smart contract./
function getContractBalance() public view returns(uint balance) { return address(this).balance; }
7,290,455
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c ...
set token Ownership
function transferTokenOwnership(address newOwner) external onlyOwner { Token(token).transferOwnership(newOwner); }
11,844,902
./partial_match/1/0xdbC32d7fEe15d360469cE39c061F9da0c36122c9/sources/gETH.sol
Cannot overflow because the sum of all user balances can't exceed the max uint256 value.
function _mint(address to, uint256 amount) internal virtual { unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); }
9,374,001
./partial_match/1/0x457cD63bee88ac01f3cD4a67D5DCc921D8C0D573/sources/contracts/abstract/JBSingleTokenPaymentTerminal.sol
A flag indicating if this terminal accepts the specified token. _token The token to check if this terminal accepts or not. _projectId The project ID to check for token acceptance. return The flag.
function acceptsToken(address _token, uint256 _projectId) external view override returns (bool) { return _token == token; }
4,264,474
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Includ...
See {IPongoProposal-ownerOf}./
function ownerOf(uint256 proposalId) public view returns (address) { address owner = _owners[proposalId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; }
6,247,295
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./IERC721Metadata.sol"; import "./Address.sol"; import "./Context.sol"; import "./ERC165.sol"; import "./IRNG.sol"; import "./Strings.sol"; contract NobilityKnight is Context, ERC165, IERC721, IERC72...
Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. `_data` is additional data, it has no specified format and it is sent in call to `to`. This internal function is equivalent to {safeTransferFrom}, a...
function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: non ERC721Receiver implementer"); }
13,055,535
./full_match/4/0x26DBF89Fe796dD5Ff0a78D898F72d8bFE26198f8/sources/contracts/dob.sol
Actually perform the safeTransferFrom. _from The current owner of the NFT. _to The new owner. _tokenId The NFT to transfer. _data Additional data with no specified format, sent in call to `_to`./
function _safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes memory _data) private canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from); require(_to != address(0x0)); _transfer(_to, _...
784,929
./full_match/43113/0x3a7D90487F8E6c8631317E1B812d020CE5bB1288/sources/src/libraries/math/PackedUint128Math.sol
Encodes a uint128 into a single bytes32 as the first uint128 x1 The uint128 return z The encoded bytes32 as follows: [0 - 128[: x1 [128 - 256[: empty/
function encodeFirst(uint128 x1) internal pure returns (bytes32 z) { assembly { z := and(x1, MASK_128) } }
7,117,642
//Address: 0x8a4aeb9455896e2cd498a9afc42a7f85638660eb //Contract name: StockBetSale //Balance: 0 Ether //Verification Date: 10/23/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.17; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control ...
Allows the owner to close sale. This will create the restricted tokens. Then ownership of token contract is transfered to owner of sale contract./
function closeSale() public onlyOwner returns (bool) { ended = true; uint256 issuedTokenSupply = token.totalSupply(); uint256 restrictedTokens = issuedTokenSupply.mul(42857).div(100000); LogSaleClosed(issuedTokenSupply, restrictedTokens); require(token.mint(Vault, restrictedTokens)); token.fin...
5,467,423
pragma solidity ^0.4.19; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; ...
Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint(address _to, uint256 _amount) onlyAdministratorOrOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; }
15,111,952
pragma solidity 0.5.15; // YAM v3 Token Proxy ...
inject NONSTANDARD NAMING
function DELEGATETOIMPLEMENTATION54(bytes memory data) public returns (bytes memory) {
5,400,711
./partial_match/1/0xCFc2d34b63d0e2fC623eEb4c0d7943e341140810/sources/MorpheusGameController.sol
check if already stackers
function isStacker(address _user) public view returns(bool){ bool _isStacker = false; for(uint256 i = 0 ; i<_zionStackers.length ; i++){ if(_zionStackers[i] == _user){ _isStacker = true; break; } } return _isStacker; }
16,054,941
pragma solidity ^0.5.2; // ---------------------------------------------------------------------------- // SynchroBit™ Hybrid Digital Assets Trading Platform Smart Contract // // Deployed to : 0x6241E4822100Eb51e28B7784636037ed1C657bB9 // Symbol : SNB // Name : SynchroBitcoin // Total supply: 1000000000 // Decimals :18...
Transfer tokens to a secified address (For Only Owner) to The address to transfer to. value The amount to be transferred. return Transfer status in true or false/
function transferByOwner(address to, uint256 value, uint8 lockingTime) public AllTransfersLockStatus onlyOwner returns (bool) { addLockingTime(to,lockingTime,value); _transfer(msg.sender, to, value); return true; }
7,270,100
./full_match/43113/0x5Af5A34b0B89b801D963FaAbC7007e5702654B6F/sources/project_/contracts/s0xCommunity/s0xUsers.sol
takes dias to create guest user profile
function createUserAccount( string memory _dias, address _user, string calldata _name ) external returns (bool) { }
7,177,945
./full_match/5/0xAaD182B8B2130A7680c028D4104541a58f178b93/sources/contracts/v1/PaymentReceivers/UniqStorePayment.sol
----- PUBLIC METHODS -----
function requestStore( bytes32 _nonce, uint256 _price, address _paymentTokenAddress, uint256 _timestamp, bytes memory _signature ) external payable { require( _timestamp + _transactionOffset >= block.timestamp, "Transaction timed out" ...
1,948,851
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title RockyToken is the incentive token for rocky.finance. It is distributed to LPs...
Change name and symbol of the token. Useful for rebranding./
function setName(string memory name, string memory symbol) public onlyOwner { _name = name; _symbol = symbol; }
6,343,787
./full_match/5/0xA5EA05358F4D65548cb04aeCC2C4a2381F573E9B/sources/contracts/MinerIssuance.sol
Issue at least `minMinerOut` Miner for exactly `amount` of `token` tokens. @ dev Emits a SwappedTokenToMiner event if successful. path address[] The optimal path to take when swapping a token for ETH. Must be a valid ERC20-compatible token and the final token must be WETH. amount uint256 The amount of token to swap f...
function issueMinerForExactTokens( uint256 amount, uint256 minMinerOut, uint256 deadline ) external returns (uint256) { IUniswapV2Router02 router = IUniswapV2Router02(uniswapRouter); uint256 expectedETHOut = router.getAmountsOut(amount, path)[ path.length - 1...
7,034,075
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@paulrberg/contracts/math/PRBMath.sol"; import "./interfaces/IYielder.sol"; import "./interfaces/ITerminalV1.sol"; import "./interfaces...
Computes the number of shares an amount of tokens is worth. _tokensAmount the amount of shares. return the number of shares the tokens are worth.
function _tokensToShares(uint256 _tokensAmount) private view returns (uint256) { return PRBMath.mulDiv( _tokensAmount, 10**decimals, wethVault.pricePerShare() ); }
5,517,484
./partial_match/42/0x648f8265f71Cd6C29272A8ce246ACBEf1FA61c10/sources/PayableProxyForSoloMargin.sol
Return the (spread-adjusted) prices of two assets for the purposes of liquidation or vaporization./
function _getLiquidationPrices( Storage.State storage state, Cache.MarketCache memory cache, uint256 heldMarketId, uint256 owedMarketId ) internal view returns ( Monetary.Price memory, Monetary.Price memory ) { u...
3,482,499
pragma solidity ^0.4.11; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b >...
Change endTime to end ICO manually
function changeEndTime(uint256 _endTime) onlyOwner { endTime = _endTime; }
13,130,744
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.6; import "../l2/L2Lib.sol"; import "../utils/FurLib.sol"; import "../utils/FurProxy.sol"; import "../utils/MetaData.sol"; import "./ZoneDefinition.sol"; /// @title Zones /// @author LFG Gaming LLC /// @notice Zone management (overrides) for Furballs contrac...
Shortcut for equations that saves gas The expression (0x100 byteNum) is expensive; this covers byte packing for editions.
function bytePower(uint8 byteNum) internal pure returns (uint256) { if (byteNum == 0) return 0x1; if (byteNum == 1) return 0x100; if (byteNum == 2) return 0x10000; if (byteNum == 3) return 0x1000000; if (byteNum == 4) return 0x100000000; if (byteNum == 5) return 0x10000000000; if (byteNum ...
1,277,818
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721Token.sol"; // This is the Ethtective MetaData Cafe contract, add your own metametametadata at http://cafe.ethtective.com contract MetaDataStorage is ERC721Token { address owner; uint price = 130000000000...
Add yourself to Ze List Of AweZome! (buy the Dank Mono Font by the way, disclaimer: I am just a user of the font but it has the most porno Z of all programming fonts in existenZ)
function addAddress(address _address, string _name, string _ipfs) public payable returns(string) { require(msg.value >= price, "Couldn't add because you underpaid"); mintUniqueTokenTo(msg.sender, currentIndex, _name); addInternal(_address, _name, _ipfs); return "You are now on the Me...
12,712,108
./full_match/100/0x0b058056bd789FC223b384664705B971A91028d2/sources/contracts/Distributors/TokenManagerHook.sol
Notifies the hook about an approval allowing the hook to react if desired. It should return true if left unimplemented, otherwise it will prevent some functions in the TokenManager from executing successfully. _holder The account that is allowing to spend _spender The account that is allowed to spend _amount The amo...
function onApprove( address _holder, address _spender, uint256 _amount ) external onlyTokenManager nonReentrant returns (bool) { return _onApprove(_holder, _spender, _amount); }
14,268,810
./full_match/1/0x1acf1538E886768AAe9b9c246256275Ee4b6f298/sources/contracts/royalty/OperatorFiltererUpgradeable.sol
A helper function to check if the operator is allowed./ Check registry code length to facilitate testing in environments without a deployed registry. under normal circumstances, this function will revert rather than return false, but inheriting or upgraded contracts may specify their own OperatorFilterRegistry implemen...
function _checkFilterOperator(address operator) internal view virtual { if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } }
8,342,660
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "./b...
Calculate a uint256 representation of x y using FixedPointMath x The first factor y The second factor (fixed point) return z The resulting product, after truncation
function calculateProduct(uint256 x, FixedPointMath.Number memory y) internal pure returns (uint256 z) { z = y.mul(x).truncate(); }
157,658
./partial_match/1/0x52d9F963029f654fcb558bF2CE6f993C618c0A3C/sources/IATI.sol
Token owner can approve for spender to transferFrom(...) tokens from the token owner's account recommends that there are no checks for the approval double-spend attack as this should be implemented in user interfaces/
function approve(address spender, uint256 tokens) public override returns (bool success) { _approve(msg.sender, spender, tokens); return true; }
3,984,409
./full_match/7701/0x86e2c038054DdFa3fdc4C7420e8178918DE6Af8e/sources/contracts/lens/CrocImpact.sol
Adjusts the liquidity when crossing over a concentrated liquidity bump at a given tick. / When selling down, the next tick leg actually occurs below the bump tick because the bump barrier is the first price on a tick.
function adjTickLiq (Chaining.PairFlow memory accum, int24 bumpTick, CurveMath.CurveState memory curve, Directives.SwapDirective memory swap, bytes32 poolHash) private view returns (int24) { unchecked { (uint96 bidLots, uint...
13,216,514
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/secu...
see {IVampireGame.isTokenRevealed(tokenId)}
function isTokenRevealed(uint16 tokenId) public view override returns (bool) { return seedForToken(tokenId) != 0; }
588,809
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import '../utils/EnumerableSet.sol'; import '../utils/Address.sol'; import '../utils/Context.sol'; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. T...
See {IBooster-getRewardInfo}/
function getRewardInfo(uint256[] memory tokenIds) external view override returns ( uint256[] memory locked, uint256[] memory pending, uint256[] memory apr, uint256[] memory secsLeft ) { locked = new uint256[](tokenIds.length); pending = new uint256[](tokenIds.leng...
5,925,395
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //required to return a Struct object pragma abicoder v2; import "./extensions/ERC721EnumerableAndURIStorage.sol"; interface IERC20 { function transferFrom( address sender, address recipient, uint256 amount ) external returns (boo...
owner of the token is able to set a minimum price for their NFTtokenId is the unique identifier of the NFT whose minimum price will be settokenAmount represents the amount of payment tokens needed to purchase the NFTverification check that the minimum price is only set by the owner of the tokenmap the minimum price to ...
function setMinimumPrice(uint256 tokenId, uint256 paymentAmount) public returns (bool) { require(msg.sender == ownerOf(tokenId), "price can only be set by the owner"); _minPrice[tokenId] = paymentAmount; return true; }
13,129,891
pragma solidity 0.5.17; import "./UpgradeableProxy.sol"; /** * @author Quant Network * @title TreasuryAbstract * @dev Sets the main variables of a Treasury contract and allows other contracts to easily interface with a Treasury contract without knowing the whole code. */ contract TreasuryBase is UpgradeableProxy...
return - the fee the mapp has to pay for any dispute raised per gateway/
function mappDisputeFeeMultipler() public view returns (uint16){ return uint16Storage[keccak256(mappDisputeFeeMultipler1)]; }
6,477,591
// SPDX-License-Identifier: MIT // Based on: https://github.com/sushiswap/sushiswap/blob/d487cc774c0ac71fe2d0742976cafb3194658d62/contracts/MasterChef.sol pragma solidity 0.6.12; import "./SafeERC20.sol"; import "./EnumerableSet.sol"; import "./Ownable.sol"; interface IMigratorChef { // Perform LP token migratio...
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add( uint256 _allocPoint, IERC20MobiFi _lpToken, bool _withUpdate ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint...
13,553,134
./partial_match/42/0x61803c77605d7b383f7C2750973063668c251DF7/sources/HodlerPool.sol
super.withdraw(stakingAmount);emit Log("call function: withdraw");emit Log(strConcat("stakingAmount: ", uint2str(stakingAmount),"","",""));emit Log(strConcat("rewardsAmount: ", uint2str(rewardsAmount),"","",""));emit Log(strConcat("totalAmount: ", uint2str(totalAmount),"","",""));emit Log(strConcat("actualAmount: ", ui...
function withdraw(uint256 stakingAmount, uint256 rewardsAmount) private { require(stakingAmount > 0, "staking amount has to be > 0"); uint256 totalAmount = stakingAmount.add(rewardsAmount); uint256 actualPercentage = 100; actualPercentage = actualPercentage.sub(penaltyPercentage); ...
3,394,479
./full_match/4/0x1406C4F2233FdBF168e4747F6f279eD2D0a82C4f/sources/contracts/GnosisSafe.sol
Trial method to test my edited contract
function getMavviTest() public pure returns(string memory){ string memory message = "Mavvi Test Worked"; return message; }
12,380,494
pragma solidity ^0.5.0; import "./CredentialsConstrained.sol"; /* @title Lockable */ contract Lockable is CredentialsConstrained { // State bool public isLocked; // Events event ContractLocked(); event ContractUnlocked(); /* Modifiers */ modifier onlyWhenUnlocked() { require(!i...
Remove credentials (overrided function with new modifier) Remove credentials of an authorized user user - the authorized address to be removed/
function removeCredentials(address user) public onlyWhenUnlocked onlyContractOwner { delete authorizedUsers[user]; emit CredentialsRemoved(user); }
12,572,400