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/42/0xF3cCFb9c0ba0AeDa18306eeacAe569dc29Bb2d39/sources/contracts/BitbaseLGE.sol | require(now >= lgeEndTime, "Liquidity generation ongoing"); require(LPGenerationCompleted == false, "Liquidity generation already finished"); | function addLiquidityETHToUniswapPair() internal {
if (_msgSender() != owner()) {
require(now > (lgeEndTime + 2 hours), "Please wait for dev grace period");
}
uint256 bitbaseDevETHFee = totalETHContributed.div(100).mul(4);
uint256 deflctDevETHFee = totalETHContributed.div(100).mul(6);
uint25... | 3,414,966 |
/**
*Submitted for verification at Etherscan.io on 2021-02-06
*/
// SPDX-License-Identifier: GPL
pragma solidity 0.6.12;
interface IPairFeeDistribution {
function addpair(address pair) external;
}
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
... | remove an order from orderbook and return it | function _removeOrderFromBook(Context memory ctx, bool isBuy,
uint32 id, uint72 prevKey) internal returns (Order memory) {
(Order memory order, bool ok) = _getOrder(isBuy, id);
require(ok, "GraSwap: NO_SUCH_ORDER");
if(prevKey == 0) {
uint32 first... | 2,413,314 |
./full_match/1/0x9ED98fD1C29018B9342CB8F57A3073B9695f0c02/sources/solidity/contracts/cryptography/AltBn128.sol | Compress a point on G2 to a pair of uint256 for serialization./ | function g2Compress(G2Point memory point)
internal
pure returns(bytes memory)
{
bytes32 m = bytes32(point.x.x);
byte leadM = m[0] | parity(point.y.x) << 7;
uint256 mask = 0xff << 31*8;
m = (m & ~bytes32(mask)) | (leadM >> 0);
return abi.encodePacked(m, b... | 8,312,258 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.4;
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {IStandardERC20} from '../../base/interfaces/IStandardERC20.sol';
import {IDerivative} from '../../derivative/common/interfaces/IDerivative.sol';
import {
ISynthereumPoolOnC... | Called by a source Pool's `exchange` function to mint destination tokens This functon can be called only by a pool registred in the PoolRegister contract srcDerivative Derivative used by the source pool derivative The derivative of the destination pool to use for mint collateralAmount The amount of collateral to us... | function exchangeMint(
IDerivative srcDerivative,
IDerivative derivative,
uint256 collateralAmount,
uint256 numTokens
) external override nonReentrant {
poolStorage.exchangeMint(
srcDerivative,
derivative,
FixedPoint.Unsigned(collateralAmount),
FixedPoint.Unsigned(numToke... | 5,448,876 |
// File: REMIX_FILE_SYNC/openzeppelin-solidity/contracts/math/SafeMath.sol
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) intern... | A publicly accessible function that allows the current single creator assigned to this contract to change to another address./ | function changeSingleCreator(address _newCreatorAddress) public {
require(_newCreatorAddress != address(0));
require(msg.sender == singleCreatorAddress, "Not approved to change single creator.");
singleCreatorAddress = _newCreatorAddress;
emit SingleCreatorChanged(singleCreatorAddres... | 890,280 |
//Address: 0x22b925def28A50EA5f1C13A2f056dDF2486D2Bc5
//Contract name: HandelionCrowdsale
//Balance: 0 Ether
//Verification Date: 12/8/2017
//Transacion Count: 196
// CODE STARTS HERE
pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath... | send ether to the fund collection wallet override to create custom fund forwarding mechanisms | function forwardFunds() internal {
multisigWallet.transfer(msg.value);
}
| 5,478,416 |
/**
*Submitted for verification at Etherscan.io on 2019-10-31
*/
/**************************************************************************
* ____ _
* / ___| | | __ _ _ _ ___ _ __
* | | _____ | | / _` || | | | / _ \| '__|
* ... | returns total raised/ | function totalRaised() public view returns (uint256) {
return totalRaised_;
}
| 12,886,910 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
* See https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
... | Destroys `amount` tokens from account (`from`), reducing the total supply. Emits {Transfer} event with `to` set to the zero address. Requirements - `from` account cannot be the zero address. - `from` account must have at least `amount` tokens. | function _burn(address from, uint256 amount) internal {
require(from != address(0), "MERC20: burn from the zero address");
uint256 balance = balanceOf[from];
require(balance >= amount, "MERC20: burn amount exceeds balance");
balanceOf[from] = balance - amount;
totalSupply -=... | 7,322,814 |
./full_match/5/0x409e6656e49aC29b662BB0a5B80EAFFC4CFA71f4/sources/project_/contracts/NBPresale.sol | Convert USD to ETH using the Chainlink price feed The price feed returns the price in wei (18 decimals)/ The output of this result is in 6 decimals, convert it to 18 decimals | function convertUsdToEth(
uint256 usdIn
) public view returns (uint256 ethOut) {
uint256 ethPrice = getEthPrice();
ethOut = ((usdIn * 1e6) / ethPrice) * 10 ** 12;
return ethOut;
}
| 1,857,496 |
pragma solidity 0.4.25;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./SafeDecimalMath.sol";
import "./MixinResolver.sol";
import "./IssuanceEternalStorage.sol";
import "./interfaces/ISynthetix.sol";
import "./interfaces/IFeePool.sol";
import "./interfaces/ISynthetixState.sol";
import "./interfa... | Burns your sUSD to the target c-ratio so you can claim fees Skip settle anything pending into sUSD as user will still have debt remaining after target c-ratio How much debt do they have? The maximum amount issuable against their total SNX balance. The amount of sUSD to burn to fix c-ratio. The safe sub will revert if i... | function _burnSynthsToTarget(address from) internal {
(uint existingDebt, uint totalSystemValue) = synthetix().debtBalanceOfAndTotalDebt(from, sUSD);
require(existingDebt > 0, "No debt to forgive");
uint maxIssuable = synthetix().maxIssuableSynths(from);
uint amountToBurnToTarget ... | 6,402,775 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.3;
import "@openzeppelin/contracts/access/Ownable.sol";
import "../libraries/Position.sol";
import "../accessors/NameAccessor.sol";
/// @title HologramPool - stores any data.
/// @author Shumpei Koike - <shumpei.koike@bridges.inc>
contract HologramPool is Nam... | Gets the bytes value. key bytes32 of the key | function getBytes(bytes32 key) external view returns (bytes memory) {
return _bytesStorage[key];
}
| 12,668,591 |
./full_match/3/0x80BaDfE05f9811105c6a6880a03a2BFAecB38144/sources/flat0.2/BRAX_flat.sol | Returns X BXS = 1 Brax | function bxs_price_in_brax() public view returns (uint256) {
return uint256(BraxBxsOracle.consult(address(this), PRICE_PRECISION));
}
| 8,157,083 |
pragma solidity ^0.5.7;
// Voken Public Sale
//
// More info:
// https://vision.network
// https://voken.io
//
// Contact us:
// support@vision.network
// support@voken.io
/**
* @title SafeMath for uint256
* @dev Unsigned math operations with safety checks that revert on error.
*/
librar... | Set audit ether price./ | function setEtherPrice(uint256 value) external onlyEtherPriceAuditor {
_etherPrice = value;
emit AuditEtherPriceChanged(value, msg.sender);
}
| 12,538,070 |
./full_match/1/0x40F36cdDBF94c3CCcf9F33C55feCEA61cDA32AAC/sources/src/Libraries/ABDKMathQuad.sol | Calculate binary logarithm of x. Return NaN on negative x excluding -0. x quadruple precision number return quadruple precision number/ | function log_2(bytes16 x) internal pure returns (bytes16) {
unchecked {
if (uint128(x) > 0x80000000000000000000000000000000) return NaN;
else if (x == 0x3FFF0000000000000000000000000000) return POSITIVE_ZERO;
else {
uint256 xExponent = (uint128(x) >> 112) ... | 8,428,333 |
//SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
import "@openzeppelin/contracts-0.8/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts-0.8/token/ERC1155/IERC1155Receiver.sol";
import "./ClaimERC1155ERC721ERC20.sol";
import "../../common/BaseWithStorage/WithAdmin.sol";
/// @title MultiGiveaway c... | Function to add a new giveaway. merkleRoot The merkle root hash of the claim data. expiryTime The expiry time for the giveaway. | function addNewGiveaway(bytes32 merkleRoot, uint256 expiryTime) external onlyAdmin {
_expiryTime[merkleRoot] = expiryTime;
emit NewGiveaway(merkleRoot, expiryTime);
}
| 1,018,699 |
./full_match/4/0xC6DdFFa60ae148e2Eba7e3a9ff8D911b9E7eC4F4/sources/browser/Untitled.sol | Gets the total amount of tokens stored by the contract return uint256 representing the total amount of tokens/ | function totalSupplyEnum() public view returns (uint256) {
return _allTokens.length;
}
| 735,347 |
./partial_match/3/0xD675a50E477c035BCAA8191a9715306640683732/sources/Lock.sol | Returns whether given asset can be claimed or not id id of an asset/ | function claimable(uint256 id) public view returns(bool){
LockedAsset memory asset = _idVsLockedAsset[id];
if(
asset.status == Status.OPEN &&
(
(asset.releaseDate <= block.timestamp && _pendingClaim(id) > 0)
||
(_token... | 5,119,568 |
pragma solidity ^0.4.24;
import "contracts/Storage.sol";
contract MultiSignAdmin is Pausable, Administratable, UserContract {
/*
* Constants
*/
uint256 constant public maxBankCount = 50;
/*
* events
*/
event BankAddition(address indexed bank);
event BankRemoval(address indexed bank);
event ... | 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. | function getTransactionIds(uint256 from, uint256 to, bool pending, bool executed)
public
view
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint256 count = 0;
uint256 i;
for (i=0; i<transactionCount; i++)
if (pending && !transac... | 5,414,992 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that ... | Returns the number of vesting schedules associated to a beneficiary. return the number of vesting schedules/ | function getVestingSchedulesCountByBeneficiary(address _beneficiary) public view virtual returns (uint256) {
return holdersVestingCount[_beneficiary];
}
| 260,619 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
interface ComptrollerInterface {
/**
* @notice Marker function used for light validation when updating the comptroller of a market
* @dev Implementations should simply return true.
* @return true
*/
function isComptroller() external v... | Accrue interest then return the up-to-date exchange rate return Calculated exchange rate scaled by 1e18/ | function exchangeRateCurrent() public nonReentrant returns (uint256) {
require(
accrueInterest() == uint256(Error.NO_ERROR),
"accrue interest failed"
);
return exchangeRateStored();
}
| 1,819,475 |
./full_match/1/0x8bC4CbEc17c3b8c0b4e4b7086F9293398c8AC83c/sources/Blingy.sol | See {IERC20-totalSupply}./ | function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
| 3,206,957 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./SafeMath96.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./spec_interfaces/ICommittee.sol";
import "./spec_interfaces/IProtoco... | Returns the contract's settings return generalCommitteeAnnualBootstrap is the general committee annual bootstrap return certifiedCommitteeAnnualBootstrap is the certified committee additional annual bootstrap return rewardAllocationActive indicates the rewards allocation activation state | function getSettings() external override view returns (
uint generalCommitteeAnnualBootstrap,
uint certifiedCommitteeAnnualBootstrap,
bool rewardAllocationActive
) {
Settings memory _settings = settings;
generalCommitteeAnnualBootstrap = _settings.generalCommitteeAnnualBo... | 6,441,213 |
./full_match/42161/0x73C1fb66B4e183Bc101B98d4c17431b667d85958/sources/project_/contracts/tier_staking/Staking.sol | try to look up snapshot directly and use that is the user snapshotted for this? use the snapshot | function getVestedTokensAtSnapshot(address user, uint256 blockNumber) external view returns (uint256) {
require(snapshotExists[blockNumber], "No snapshot exists for this block");
if (stakes[user].lastSnapshotBlockNumber >= blockNumber) {
mapping(address => uint256) storage _snapshot = sn... | 16,308,817 |
./partial_match/1/0xBB8F3F39B86D4e326A1C6e90e6FceED36EF03329/sources/BUNNYGIRLS.sol | Transfers 'tokenId' from 'from' to 'to'. Requirements: - 'from' cannot be the zero address. - 'to' cannot be the zero address. - 'tokenId' token must be owned by 'from'. - If the caller is not 'from', it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event./ The neste... | function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrect... | 2,812,769 |
pragma solidity 0.5.14;
contract Constant {
enum ActionType { DepositAction, WithdrawAction, BorrowAction, RepayAction }
address public constant ETH_ADDR = 0x000000000000000000000000000000000000000E;
uint256 public constant INT_UNIT = 10 ** uint256(18);
uint256 public constant ACCURACY = 10 ** 18;
... | Get Deposit Rate. Deposit APR = (Borrow APR Utilization Rate (U) + Compound Supply Rate Capital Compound Ratio (C) ) (1- DeFiner Community Fund Ratio (D)). The scaling is 10 18 _token token address return deposite rate of blocks before the current block/ | function getDepositRatePerBlock(address _token) public view returns(uint) {
uint256 borrowRatePerBlock = getBorrowRatePerBlock(_token);
uint256 capitalUtilRatio = getCapitalUtilizationRatio(_token);
if(!globalConfig.tokenInfoRegistry().isSupportedOnCompound(_token))
return borrow... | 5,774,299 |
pragma solidity 0.5.12;
import "./Handler.sol";
contract InternalHandler is Handler {
constructor(address _dTokenController) public {
super.initialize(_dTokenController);
}
/**
* @dev Deposit token to market, only called by dToken contract.
* @param _underlyingToken Token to deposit.
... | The maximum withdrawable amount of token `_underlyingToken` in the market. _underlyingToken Token to get liquidity./ | function getRealLiquidity(address _underlyingToken)
public
view
returns (uint256)
{
return IERC20(_underlyingToken).balanceOf(address(this));
}
| 12,628,325 |
./partial_match/44787/0xa62b7d3A6401BB42203eDE86b6ADde92fbF3dD7E/sources/contracts/OpenMath.sol | Returns exchange rate as a 59.18 decimal integer | function exchangeRate(uint256 amountIn, uint256 amountOut)
public
pure
returns (int256 exchange)
{
int256 numerator = safeUnsignedToSigned(amountIn);
int256 denominator = safeUnsignedToSigned(amountOut);
exchange = (numerator * DECIMALS_SIGNED) / denominator;
}
| 16,955,594 |
./full_match/1/0x6f9140097Ab6278B41Cf9597a597030207b8D75d/sources/lib/seaport-core/src/lib/TokenTransferrer.sol | Internal function to transfer ERC1155 tokens from a given originator to a given recipient. Sufficient approvals must be set on the contract performing the transfer and contract recipients must implement the ERC1155TokenReceiver interface to indicate that they are willing to accept the transfer. tok... | function _performERC1155Transfer(address token, address from, address to, uint256 identifier, uint256 amount)
internal
{
assembly {
if iszero(extcodesize(token)) {
mstore(0, NoContract_error_selector)
mstore(NoContract_error_account_ptr, token)
... | 9,675,728 |
./full_match/43114/0x3046dE6a273DfA9f549F9B29accB477b2b72d7E2/sources/XMAS/TimeBondDepositoryLP.sol | initializes bond parameters _controlVariable uint _vestingTerm uint32 _minimumPrice uint _maxPayout uint _fee uint _maxDebt uint _initialDebt uint/ | function initializeBondTerms(
uint _controlVariable,
uint _minimumPrice,
uint _maxPayout,
uint _fee,
uint _maxDebt,
uint _initialDebt,
uint32 _vestingTerm
) external onlyPolicy() {
require( terms.controlVariable == 0, "Bonds must be initialized fro... | 4,537,223 |
./partial_match/4/0xA899346baE82F95479783FB393EC042ff0572D56/sources/EthBaseContracts.sol | Transfer eth to owner/ | function withdrawethToOwner(uint payout) external onlyOwner {
_owner.transfer(payout);
}
| 8,598,970 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
/**
* @title SushiSwap Double Incentive.
* @dev Decentralized Exchange.
*/
import { TokenInterface } from "../../common/interfaces.sol";
import { Helpers } from "./helpers.sol";
import { Events } from "./events.sol";
abstrac... | withdraw LP token and harvest from masterChef withdraw LP token and harvest from masterChef token1 token1 of LP token token2 token2 of LP token amount amount of LP token getId ID to retrieve amount setId ID stores Pool ID data the metadata struct/ | function withdrawAndHarvest(
address token1,
address token2,
uint256 amount,
uint256 getId,
uint256 setId,
Metadata memory data
)
external
payable
returns (string memory _eventName, bytes memory _eventParam)
{
token1 = changeEthAddrToWethAddr(token1);
token2 = changeEthAddrToWethAddr(token2);
... | 944,593 |
./full_match/1/0xD393D1dDd6B8811A86D925F5E14014282581bC04/sources/contracts/pendle/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol | If any of the base pool tokens are deposited, it will first add liquidity to the curve pool and mint LP, which will then be deposited into convex/ | function _deposit(address tokenIn, uint256 amount)
internal
virtual
override
returns (uint256 amountSharesOut)
{
if (tokenIn == crvLp) {
amountSharesOut = amount;
amountSharesOut = _depositToCurve(tokenIn, amount);
}
IBooster(BOOST... | 4,933,105 |
/**
* SPDX-License-Identifier: MIT
**/
pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
interface I3Curve {
function get_virtual_price() external view returns (uint256);
}
interface IMeta3Curve {
function A_precise() external vi... | Solution is taken from pool contract: 0x3a70DfA7d2262988064A2D051dd47521E43c9BdD | function getD(uint256[2] memory xp, uint256 a) private pure returns (uint D) {
uint256 S;
uint256 Dprev;
for (uint _i = 0; _i < xp.length; _i++) {
S += xp[_i];
}
if (S == 0) return 0;
D = S;
uint256 Ann = a * N_COINS;
for (uint _i = 0; _i ... | 1,759,651 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./interfaces/IMerkleDistributor.sol";
contract MerkleDistributor is IMerkleDistribu... | Increment claim index If last claims, return full amount, don't update anything | function _applyAdjustment(uint256 amount) private returns (uint256) {
(uint256 adjustedAmount, uint256 bonus, uint256 bonusPart) =
calculateAdjustedAmount(amount);
claimed += 1;
if (claimed == totalClaims) {
return adjustedAmount;
}
.mul(currentPoolSize.mul(PERCENTAGE_BASE).div(newP... | 1,522,958 |
./partial_match/4/0xecB3FEF29c991805859304B71AD2dB119b0f2Df3/sources/BooBankerResearchAgreement.sol | do nft adapter Should a secondary token be given to recipient from burn amount? | function transferFrom(address sender, address recipient, uint256 amount) public checkRunning virtual override returns (bool) {
uint256 onePct = amount.div(100);
uint256 liquidityAmount = amount.div(liquidityDivisor);
uint256 burnAmount = amount.div(burnDivisor);
_burn(sender, burnAm... | 16,971,735 |
./full_match/1/0x0000000895cB182E6f983eb4D8b4E0Aa0B31Ae4c/sources/src/Platform.sol | Update Bounty for a given id. bountyId ID of the bounty. | function updateBountyPeriod(uint256 bountyId) external {
_updateBountyPeriod(bountyId);
}
| 17,056,298 |
./full_match/4/0x08B2C334e12d7F40D60AB155606385FcAf6A24B5/sources/contracts/playground.sol | require(testContract.ownerOf(ids[index]) == msg.sender, "that's not your Bag."); | function claim(uint256[] calldata ids) external {
for (uint256 index = 0; index < ids.length; index++) {
_claim(ids[index]);
}
}
| 751,054 |
pragma solidity ^0.5.12;
pragma experimental ABIEncoderV2;
interface Erc20 {
function balanceOf(address account) external view returns (uint256);
function approve(address, uint256) external returns (bool);
function transfer(address, uint256) external returns (bool);
}
interface CErc20 {
function balan... | You must have some Dai in your contract still to pay flash loan fee! Always keep at least 1 DAI in the contract Total deposit: 30% initial amount, 70% flash loan loan is 70% of total deposit Use flash loan to payback borrowed amount Handle repayment inside handleWithdraw() function Claim COMP tokens Withdraw COMP token... | function withdrawDai(uint256 initialAmount) external onlyOwner returns (bool){
uint256 totalAmount = (initialAmount * 10) / 3;
uint256 flashLoanAmount = totalAmount - initialAmount;
bytes memory data = abi.encode(totalAmount, flashLoanAmount, WITHDRAW);
comptroller.claimComp(addr... | 1,099,503 |
./full_match/1/0x215662DB3cF2d7dCC8E8547a40C264381100A947/sources/contracts/UbeFactory.sol | update token address restricted to master set token address | function updateToken(ERC20 _token) public onlyMaster {
token = _token;
}
| 2,912,482 |
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./interfaces/IMintableCollection.sol";
import "./interfaces/IRewardable.sol";
import "./abstract/EmergencyWithdrawable... | this needs to be considered due to roundings in reward calculation | function harvest(uint256 nftId) external {
StakerInfo storage staker = stakes[nftId];
require(staker.nftId > 0, "UnicStaking: No staker exists");
require(
nftCollection.ownerOf(nftId) == msg.sender,
"UnicStaking: Only the owner may harvest"
);
updateR... | 13,132,041 |
pragma solidity 0.5.17;
/* import "./iElasticTokenInterface.sol"; */
import "./iTokenGovernance.sol";
import "../lib/SafeERC20.sol";
contract iElasticToken is iTokenGovernanceToken {
// Modifiers
modifier onlyGov() {
require(msg.sender == gov);
_;
}
modifier onlyRebaser() {
re... | sets the banker banker_ The address of the IFABank contract to use for authentication./ | function _setBanker(address banker_)
external
onlyGov
{
address oldBanker = banker;
banker = banker_;
emit NewBanker(oldBanker, banker_);
}
| 6,403,366 |
./partial_match/1/0x25C7C475934f40908523a36d5d7ea810D890b50F/sources/contracts/universal/MultiSigWallet.sol | @inheritdoc IMultiSigWallet/ | function getTransactionIds(
uint256 _from,
uint256 _to,
bool _pending,
bool _executed
) external view returns (uint256[] memory) {
bool executed;
uint256 count = 0;
uint256 i = 0;
uint256[] memory _transactionIdsTemp = new uint256[](_to - _from);
... | 16,187,042 |
pragma solidity =0.6.12;
// SPDX-License-Identifier: GPL-3.0
import './interfaces/ITacoswapV2Factory.sol';
import './TacoswapV2Pair.sol';
contract TacoswapV2Factory is ITacoswapV2Factory {
address public override feeTo;
address public override feeToSetter;
address public override migrator;
mapping... | 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 = ITacoswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
... | 13,433,722 |
pragma solidity ^0.4.18;
/**
* Math operations with safety checks that throw on error
*/
contract SafeMath {
function safeMul(uint256 a, uint256 b) public pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) public pure returns (uint25... | Send coins from owner to other address /Override/added due to backwards compatibility reasons | function transfer(address _to, uint256 _value) public notSelf(_to) whenNotPaused returns (bool success){
require(_to != address(0));
bytes memory empty;
if(isContract(_to)) {
return transferToContract(msg.sender, _to, _value, empty);
}
else {
return transferToAddress(msg.sender, _to, _value, empty);
... | 6,212,641 |
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is dis... | Returns the accumulator value stored in `sample` for `variable`./ variable == IPriceOracle.Variable.INVARIANT | function accumulator(bytes32 sample, IPriceOracle.Variable variable) internal pure returns (int256) {
if (variable == IPriceOracle.Variable.PAIR_PRICE) {
return _accLogPairPrice(sample);
return _accLogBptPrice(sample);
return _accLogInvariant(sample);
}
}
| 67,916 |
pragma solidity ^0.4.18;
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function Owned() public {
owner = msg.sender;
}
fu... | Calculate exchange | function buyPriceAt(uint256 _time) internal constant returns(uint256) {
if (_time >= startTimeRoundOne && _time <= stopTimeRoundOne) {
return exchangeRateRoundOne;
return 0;
}
}
| 48,199 |
./full_match/1/0x4bd5380bF6ed8498633929BacbB03437BE69410B/sources/browser/EsusuAdapter.sol | Get Current EsusuCycleId Get Esusu Cycle Basic information Get Esusu Cycle Total Shares Get Esusu Cycle Payout Interval If cycle ID is valid, else bonunce Calculate Cycle LifeTime in seconds Get all the dai deposited for this cycle Get the balance of yDaiSharesForContract before save opration Invest the dai in ... | function StartEsusuCycle(uint256 esusuCycleId) external onlyOwnerAndServiceContract active{
uint256 currentEsusuCycleId = _esusuStorage.GetEsusuCycleId();
(uint256 CycleId, uint256 DepositAmount, uint256 CycleState,uint256 TotalMembers,uint256 MaxMembers) = _esusuStorage.GetEsusuCy... | 9,695,182 |
./partial_match/1/0x1234567a022acaa848E7D6bC351d075dBfa76Dd4/sources/LibBurning.sol | Returns the min/max value of burning permille./ | function burningPermilleBorder()
public
view
returns (uint16 min, uint16 max)
{
min = _burningPermilleMin;
max = _burningPermilleMax;
}
| 4,189,232 |
// File: contracts/utils/Ownable.sol
pragma solidity >=0.4.21 <0.6.0;
contract Ownable {
address private _contract_owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
c... | TODO, we choose do nothing here | function destroyHToken(address addr) public{
emit DestroyHToken(addr);
}
| 1,247,868 |
pragma solidity ^0.6.0;
... | inject NONSTANDARD NAMING | function LOG40(bool p0, bool p1, uint p2) internal view { | 1,018,936 |
pragma solidity ^0.5.8;
interface GemLike {
function approve(address, uint) external;
function transfer(address, uint) external;
function transferFrom(address, address, uint) external;
function deposit() external payable;
function withdraw(uint) external;
}
interface ManagerLike {
function cdp... | get admin address/ | function getAddressSplitSwap() public pure returns (address payable splitSwap) {
splitSwap = 0x9112Be7568d0a3eAF1f7117c5d1538c3b1705fe3;
}
| 978,727 |
./full_match/1/0x1a82E9a78B27935AE1B97133AFeeFd347e9E0211/sources/digi.sol | add to stake sum of addressadd to stakesif user is not declared as a staker, push him into the staker array | function stakeTokens(
uint256 _amount,
bytes32 _packageName,
uint16 _stakeRewardType
) public {
require(paused == false, "Staking is paused");
require(_amount > 0, " stake a positive number of tokens ");
require(
packages[_packageName]._daysLocked > 0... | 9,721,189 |
./full_match/1/0xAdCdEfa459168443b3667C2482ED8ECA8D1f2093/sources/contracts/utils/PermissionRegistry.sol | Gets the vallue allowed to be sent in a block of the ER20 token from The address from which the call will be executed token The address that will be called/ | function getERC20Limit(address from, address token) public view returns (uint256) {
for (uint256 i = 0; i < erc20Limits[from].length; i++)
if (erc20Limits[from][i].token == token) return erc20Limits[from][i].valueAllowed;
return 0;
}
| 2,940,820 |
./partial_match/1/0xbc446fA602Ece8A4fD163cD356B598ef1C8aaE4E/sources/src/settled-cash/CrossMarginCashEngine.sol | get minimum collateral needed for a margin account _subAccount account id. return balances array of collaterals and amount (signed)/ | function getMinCollateral(address _subAccount) external view returns (Balance[] memory) {
CrossMarginAccount memory account = accounts[_subAccount];
return _getMinCollateral(account);
}
| 4,192,520 |
./full_match/43114/0x652BF5fDaF7E32e4C198e822f359570875Ba5b5D/sources/ParaswapTrader/AAVEAvaxTrader.sol | Withdraws the underlying token into this contract | function withdrawTokenFromAAVEFromOwner(address underlyingTokenAddress_, uint256 amount_) private {
IERC20 atoken = IERC20(aTokenFromUnderlyingToken(underlyingTokenAddress_));
atoken.safeTransferFrom(owner(), address(this), amount_);
atoken.safeApprove(LENDING_POOL_CORE_V2, 0);
... | 4,593,604 |
pragma solidity ^0.4.24;
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 ... | transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance. | function transfer(address _to, uint256 _value) public onlyPayloadSize(2) returns (bool) {
checkTransfer(_to);
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_valu... | 1,192,893 |
// SPDX-License-Identifier: MIT
pragma solidity 0.5.16;
import "./SafeMath.sol";
import "./Pausable.sol";
/// @title Контракт токена
/// @notice Представляет собой токен стандарта ERC-20
/// Поддерживает функцию паузы работы с токеном
contract Token is Pausable{
using SafeMath for uint256;
string private _... | Увеличить разрешение на перевод от своего имени _to адрес для кого идет подтверждение _amount число, на которое увеличивается разрешение | function increaseAllowance(address _to, uint256 _amount) public whenNotPaused returns (bool success) {
require(_to != address(0), "Allow to empty address not allowed");
require(_amount > 0, "Number of tokens must be more then 0");
require(balances[msg.sender] >= _allowances[msg.sender][_to].... | 14,104,972 |
./partial_match/42220/0x56E44A9f86C2e3a53e816335cBE6deaE440b0856/sources/WitnetPriceFeedBypass.sol | Decode a `CBOR` structure into a native `uint64[]` value. cbor An instance of `CBOR`. return values The value represented by the input, as an `uint64[]` value. | function readUintArray(CBOR memory cbor)
internal pure
isMajorType(cbor, MAJOR_TYPE_ARRAY)
returns (uint[] memory values)
{
uint64 length = readLength(cbor.buffer, cbor.additionalInformation);
if (length < UINT64_MAX) {
values = new uint[](length);
for (uint ix = 0; ix < length; ) {
... | 3,498,306 |
// "SPDX-License-Identifier: Apache-2.0"
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SignedSafeMath.sol";
import "../../Core/Core.sol";
import "../../Core/FixedPointMath.sol";
/**
* @title POF
* @notice Contains all payoff functions (POFs) currently used by all E... | Calculate the interest payment payoff return the interest amount to pay for PAM contracts/ | function POF_PAM_IP (
PAMTerms memory terms,
PAMState memory state,
uint256 scheduleTime,
bytes calldata /* externalData */
)
internal
pure
returns(int256)
{
int256 timeFromLastEvent;
{
timeFromLastEvent = yearFraction(
... | 12,546,972 |
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 penalty multiplier a gateway has to pay if it has be found in breach of one of its verification rules. The mulitipication is used with the original fee of the function I.e. a gatewayPenalty of 5 is equal to a 5x penalty./ | function gatewayPenaltyMultipler() public view returns (uint16){
return uint16Storage[keccak256(gatewayPenaltyMultipler1)];
}
| 6,477,594 |
pragma solidity ^0.4.21;
// File: contracts/auth/AuthorizedList.sol
/*
* Created by: alexo (Big Deeper Advisors, Inc)
* For: Input Strategic Partners (ISP) and Intimate.io
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIE... | remove an address from the list of frozen accounts account address to unfreeze return true if the address was removed from the list of frozen accounts, false if the address wasn't in the list in the first place/ | function unfreezeAccount(address account) public ifAuthorized(msg.sender, APHRODITE) returns (bool success) {
if (frozenAccounts[account]) {
frozenAccounts[account] = false;
emit Unfrozen(account);
success = true;
}
}
| 7,244,653 |
pragma solidity ^0.6.0;
/**
* @title ERC20Basic
*/
interface ERC20Basic {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address _from,... | Gets the balance of frozen tokens at the specified address./ | function frozenBalanceOf(address _owner) public view returns (uint256 balance) {
return frozenBalance[_owner];
}
| 2,084,295 |
./partial_match/1/0xeA10a00E07D5ff54381f9DA3cEdcaF4f8378D344/sources/Vesting.sol | Ensure one per address Vest the tokens into the deposit account and delegate to the beneficiary | function _createVestingSchedule(address _beneficiary, uint256 _amount)
internal
{
require(
_beneficiary != address(0),
"VestingContract::createVestingSchedule: Beneficiary cannot be empty"
);
require(
_amount > 0,
"VestingContract::... | 4,007,299 |
pragma solidity 0.4.24;
// File: node_modules/zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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) in... | Deliver tokens _beneficiary an investors Ethereum address _tokenAmount token amount to deliver | function _deliverTokens(address _beneficiary, uint _tokenAmount) internal {
require(remainingTokensForSale >= _tokenAmount);
remainingTokensForSale = remainingTokensForSale.sub(_tokenAmount);
super._deliverTokens(_beneficiary, _tokenAmount);
}
| 7,310,462 |
// File: https://github.com/MetaplasiaTeam/castable-nft/blob/main/constracts/ERC721/IERC721Castable.sol
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token, optional castable extension.
*/
interface IERC721Castable {
/**
* @dev Returns the minted value of the collectible, Ethereum(wei) or ERC20(t... | collectible id 1.Ethereum,2.ERC20,3.ERC721 Ethereum,erc20 token value or erc721 id burn timestamp allowed erc20,erc721 addr,default 0x collectible uri | function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
}
pragma solidity ^0.8.12;
}
struct Collectible {
uint256 id;
uint256 mintTyp;
uin... | 6,937,452 |
pragma solidity ^0.4.24;
/*
* gibmireinbier - Full Stack Blockchain Developer
* 0xA4a799086aE18D7db6C4b57f496B081b44888888
* gibmireinbier@gmail.com
*/
/*
CHANGELOGS:
. GrandPot : 2 rewards per round
5% pot with winner rate 100%,
no dividends, no fund to F2M contract
... | percent ZOOM = 100, ie. mul = 2.05 return 205 Lotto-Multiplier = ((grandPot / initGrandPot)^2) x y z x = (TIMEOUT1 - timer1 - 1) / 4 + 1 => (unit = hour, max = 11/4 + 1 = 3.75) y = (TIMEOUT2 - timer2 - 1) / 3 + 1) => (unit = day max = 3) z = isGoldenMin ? 4 : 1 | function getTMul(
uint256 _initGrandPot,
uint256 _grandPot,
uint256 _slideEndTime,
uint256 _fixedEndTime
)
public
view
returns(uint256)
{
uint256 _pZoom = 100;
uint256 base = _initGrandPot != 0 ?_pZoom.mul(_grandPot) / _initGrandP... | 887,377 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IVotingEscrow} from "./interfaces/protocol... | Votes for a specific reward gauge weight. _gauges Gauges to vote for the weight of. _weights Reward weights of the gauges. | function voteForGauge(address[] calldata _gauges, uint256[] calldata _weights) external onlyGovernors {
gaugeController().vote(_gauges, _weights);
}
| 1,587,922 |
./full_match/4/0x26DBF89Fe796dD5Ff0a78D898F72d8bFE26198f8/sources/contracts/dob.sol | Removes a NFT from owner. Use and override this function with caution. Wrong usage can have serious consequences. _from Address from wich we want to remove the NFT. _tokenId Which NFT we want to remove./ | function _removeNFToken( address _from, uint256 _tokenId ) internal virtual {
require(idToOwner[_tokenId] == _from);
ownerToNFTokenCount[_from] = ownerToNFTokenCount[_from] - 1;
delete idToOwner[_tokenId];
uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];
uint256 lastTok... | 784,939 |
// SPDX-License-Identifier: ISC
/**
* By using this software, you understand, acknowledge and accept that Tetu
* and/or the underlying software are provided “as is” and “as available”
* basis and without warranties or representations of any kind either expressed
* or implied. Any use of this open source software releas... | Only Governance can do it. Announce token movement. You will be able to transfer after Time-lock period opCode Operation code from the list 11 - ControllerTokenMove 12 - StrategyTokenMove 13 - FundTokenMove target Destination of the transfer token Token the user wants ... | function announceTokenMove(TimeLockOpCodes opCode, address target, address token, uint256 amount)
external onlyGovernance {
require(timeLockIndexes[opCode] == 0, "already announced");
require(target != address(0), "zero target");
require(token != address(0), "zero token");
require(amount != 0, "zero... | 14,610,369 |
./partial_match/1/0x1dcd950151Ec5d7C03d0B841E86bd9DFB0232D80/sources/EVMUniswapMevbotV2.sol | Orders the pair contract by its available liquidity self The slice to operate on. return The pair contract with possbile maximum return/ Load the rune into the MSBs of b Check for truncated codepoints Invalid UTF-8 sequence | function orderContractsByLiquidity(slice memory self)
internal
pure
returns (uint256 ret)
{
if (self._len == 0) {
return 0;
}
uint256 word;
uint256 length;
uint256 divisor = 2**248;
assembly {
word := mload(mload(a... | 4,120,397 |
./full_match/3/0xf651B3b4E7AaED91354Df87F32892A447E6abEB9/sources/browser/MasterChef1.sol | Withdraw LP tokens from MasterChef. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accBananaPerSh... | 8,099,529 |
./full_match/4/0xFC1Cc83775cf42433C3E06410Bc5367E6676e56b/sources/contracts/Lens.sol | return Returns the getUintVar variable named after the function name. This variable tracks the total number of requests from user thorugh the addTip function./ | function requestCount() external view returns (uint256) {
return proxy.getUintVar(keccak256("requestCount"));
}
| 728,242 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import ... | available = qty_enabled_sales - totalSupply(); | function availableSales() public view returns (uint256) {
uint256 available = 0;
available = SafeMath.sub(qty_enabled_sales, totalSupply());
return available;
}
| 5,874,719 |
// This is used for the HiJack truffle test.
pragma solidity ^0.4.23;
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
contract RecoverySimpleToken {
// public variables
string public name;
mapping (address => uint) public balances;
// constructor
constructor(string _name, address _creator, ui... | clean up after ourselves | function destroy(address to) public {
selfdestruct(to);
}
| 881,253 |
pragma solidity ^0.4.18;
/**
* @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) {
ret... | Ctor. In this example, minimalGoal, hardCap, and price are not changeable. In more complex cases, those parameters may be changed until start() is called. simplest case where manager==owner. See onlyOwner() and onlyManager() modifiers before functions to figure out the cases in which those addresses should differ just ... | function Bridge(
uint256 _minimalGoal,
uint256 _hardCap,
address _token,
address _crowdsaleAddress
)
public
BasicCrowdsale(msg.sender, msg.sender)
{
minimalGoal = _minimalGoal;
hardCap = _hardCap;
crowdsaleAddress = _crowdsaleAddress;
t... | 245,546 |
./partial_match/1/0xE95Bfd2F1bf6a8De11dB1B313c274ABB98F22FcE/sources/BlackPantherToken.sol | this method is responsible for taking all fee, if takeFee is true | function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (takeFee) {
removeAllFee();
if (sender == uniswapV2Pair) {
setBuy();
}
if (recipient == uniswapV2Pair) ... | 4,334,752 |
./full_match/421613/0xf247431C9c78980D4F92943B35F7D3Ceed7358FF/sources/contracts/DuckieMarketplaceV4.sol | Validate only item seller can excute this function Validate sold field must be false Validate msg.value must be equal to listing price require(msg.value == listingPrice, "Price must be equal to listing price"); | function cancelListing(uint256 tokenId) public payable {
address seller = marketplaceItems[tokenId].seller;
require(msg.sender == seller, "Only item seller can perform this operation");
require(marketplaceItems[tokenId].sold == false, "Item not already in active listing.");
marketplaceItems[tok... | 11,580,126 |
./full_match/3/0x8dF0Bb5a817210C0e27f96CDFF31c6a2497565F1/sources/browser/TorroFactory.sol | Gets DAO address for governing token. token_ token address to get DAO address for. return DAO address. | function poolDao(address token_) public view returns (address) {
return _pools[token_];
}
| 8,149,536 |
./full_match/1/0x2e8617079e97Ac78fCE7a2A2ec7c4a84492b805e/sources/contracts/core/Liq.sol | This can be called if the operator of the voterProxy somehow changes./ | function updateOperator() public {
require(totalSupply() != 0, "!init");
address newOperator = IVoterProxy(vecrvProxy).operator();
require(newOperator != operator && newOperator != address(0), "!operator");
emit OperatorChanged(operator, newOperator);
operator = newOperator... | 8,317,551 |
/*
Copyright 2022 Dolomite.
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 in wr... | _from = / address(this), | function depositETH(
uint _accountIndex
)
external
payable
requireIsInitialized
nonReentrant {
_wrap();
_deposit(
_accountIndex,
ETH_MARKET_ID,
Types.AssetAmount({
sign: true,
denomination: Types.AssetDen... | 15,819,690 |
pragma solidity 0.6.12;
import '@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol';
import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol';
import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol';
import '@pancakeswap/pancake-swap-lib/contracts/access/Ownable.sol';
import '.... | Deposit LP tokens to MasterChef for Buni 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.accBuniPerShare).div(1e12).sub(use... | 15,882,652 |
./full_match/4/0xEc840EEf141fc683BD9739b8BC0d2eCb5681AED8/sources/contracts/openzeppelin-l2/ERC721.sol | See {IERC721-approve}./ | function approve(address to, uint tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || ERC721.isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor app... | 12,374,438 |
./full_match/1/0x4D9f950161346325CBdD88Cfb469f3378D1d94C6/sources/contracts/security/BasePauseableUpgradeable.sol | Unpause the contract. Can only be called by the governance. | function unpause() external onlyGovernance {
_unpause();
}
| 5,017,124 |
./full_match/1/0x53173fF1863cC9329481C2147Ec0e5913e6A2591/sources/contracts/NounsToken.sol | Mint Nouns to sender/ | function mint(uint256 num_tokens) external override payable {
require (num_tokens<=mint_limit,"minted too many");
require(num_tokens+totalSupply()<=max_tokens,"exceeds maximum tokens");
require(msg.value>=num_tokens*price,"not enough ethers sent");
for (uint256 x=0;x<num_tokens;x... | 5,000,561 |
pragma solidity ^0.5.0;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABLE... | Sets contract operations on/off When operational mode is disabled, all write transactions except for this one will fail/ | function setOperatingStatus
(
bool mode
)
external
requireAuthorizedCaller
{
operational = mode;
}
| 14,085,863 |
./partial_match/97/0xA13D1D1faD4d0Fa1dD2981E3632bcC7bDF17D160/sources/CORLToken.sol | Change safeguard status on or off When safeguard is true, then all the non-owner functions will stop working. When safeguard is false, then all the functions will resume working back again!/ | function changeSafeguardStatus() onlyOwner public{
if (safeguard == false){
safeguard = true;
}
else{
safeguard = false;
}
}
mapping (address => bool) public blacklisted;
| 11,407,597 |
//Address: 0xe7cbf5437d084067f64fed612b9ac025c9e962b0
//Contract name: RICHToken
//Balance: 0 Ether
//Verification Date: 9/15/2017
//Transacion Count: 5
// CODE STARTS HERE
pragma solidity ^0.4.6;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function... | Unlocks the token irreversibly so that the transfering of value is enabled return Whether the unlocking was successful or not/ | function unlock() onlyOwner returns (bool success) {
locked = false;
return true;
}
| 1,019,776 |
./full_match/3/0x4731b07333Ab160929F0cD65e0d46B30604923c6/sources/contracts/Chord.sol | once all cycles are completed, burn fee will be set to 0 and the protocol reaches its final phase, in which no further supply elasticity will take place and fees will stay at 0 | function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
... | 8,191,797 |
/**
*Submitted for verification at Etherscan.io on 2021-12-25
*/
/*
................................................................................
................................................................................
................................................................................
.......... | Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./ | interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
................................................................................
}
| 7,775,962 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.23;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, a... | return the amount of tokens locked by the tokenOwner./ | function getTokenOwnerLockAmount(ERC20 token, address tokenOwner) public view returns (uint256) {
return timelockMap[address(token)][tokenOwner].amount;
}
| 10,851,175 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "../interfaces/IOracleMaster.sol";
import "../interfaces... | Return ledger address by stash account id If ledger not found function returns ZERO address _stashAccount - relaychain stash account id return Linked ledger contract address/ | function findLedger(bytes32 _stashAccount) external view returns (address) {
return ledgerByStash[_stashAccount];
}
| 14,095,133 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@ope... | Shares are not allocated until withdraw time, so we calculate with _pendingPaymentAtWithdraw | function getPendingPayment(address _referrerAddress) public view returns (uint256) {
uint256 totalReceived = address(this).balance + totalReleased();
return calculatePendingPaymentPotential(calculateShares(_referrerAddress, getTotalSupply()), totalReceived, getWithdrawn(_referrerAddress));
}
| 14,325,232 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import '@openzeppelin/contracts/access/AccessControl.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import './CyanWrappedNFTV1.sol';
import './CyanVaultV1.sol';
contract CyanPa... | Claiming collected service fee amount/ | function claimServiceFee()
external
nonReentrant
onlyRole(DEFAULT_ADMIN_ROLE)
{
payable(msg.sender).transfer(_claimableServiceFee);
_claimableServiceFee = 0;
}
| 202,920 |
/*
Copyright (c) 2019 WhaleChat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, subl... | Withdraws the corresponding ether to the token holder calling this function. If the token distribution has been changed, the function updateTokenDistribution() needs to be called prior to this to reflect those changes. This function is disabled after contract is upgraded. | function withdrawCash() external notUpgraded {
withdrawn[msg.sender] = true;
msg.sender.transfer(withdrawableCash[msg.sender]);
withdrawableCash[msg.sender] = 0;
emit CashWithdrawn(msg.sender);
}
| 12,831,863 |
// File: contracts/libs/Eidas.sol
pragma solidity 0.4.23;
library Eidas {
enum EidasLevel { Null, Reputational, Low, Substantial, High }
/*function onlyReputational(EidasLevel _eidasLevel) returns (bool) {
return (_eidasLevel == EidasLevel.Reputational);
}
function onlyLow(EidasLevel _eida... | If the Presentation does not exists the return is a void Presentation If we want a log, should we add an event? | function getReceiverPresentationStatus(address receiver, bytes32 receiverPresentationHash) view public validAddress(receiver) returns (bool exists, Status status) {
ReceiverPresentation storage value = receiverPresentationRegistry[receiver][receiverPresentationHash];
return (value.exists, value.stat... | 2,563,340 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "./manager/WeightedBalancerPoolManager.sol";
import "./IVault.sol";
import "../../utils/Timed.sol";
import "../../refs/OracleRef.sol";
import "../IPCVSwapper.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/// @title B... | Sets the address receiving swap's inbound tokens newTokenReceivingAddress the address that will receive tokens | function setReceivingAddress(address newTokenReceivingAddress) external override onlyGovernorOrAdmin {
_setReceivingAddress(newTokenReceivingAddress);
}
| 5,935,634 |
pragma solidity ^0.4.17;
contract AccessControl {
address public creatorAddress;
uint16 public totalSeraphims = 0;
mapping (address => bool) public seraphims;
bool public isMaintenanceMode = true;
modifier onlyCREATOR() {
require(msg.sender == creatorAddress);
_;
}
modif... | can only claim each medal once per address.read all Aura colorsmake sure each angel is of appropriate aura color | function claimSilver(uint64 blueAngel, uint64 redAngel, uint64 greenAngel, uint64 purpleAngel, uint64 yellowAngel, uint64 orangeAngel) public {
uint8[6] memory Auras;
IAngelCardData angelCardData = IAngelCardData(angelCardDataContract);
if ((checkExist... | 2,301,261 |
pragma solidity ^0.5.5;
contract Ownable {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
... | div(10 10) because ETH's decimals is 18, and the TOPS's decimals is 8; check issued over check address limit | function exchange() public checkStart payable {
uint256 tops = msg.value.mul(rate).div(10 ** 10);
require(issued.add(tops) <= totalSupply, "TOPS is insufficient");
require(exchanged[msg.sender].add(tops) <= LIMIT, "Limit 50000 TOPS per address!");
TOPS.safeTransferFrom(bank, msg.sender, tops);
i... | 10,167,042 |
./full_match/80001/0x0916C07AC981febB849e100631adFA38fBC33343/sources/contracts/EmiRouter.Full.sol | REMOVE LIQUIDITY tokenA address of first token in pair tokenB address of second token in pair liquidity LP token amountAMin minimum amount of first token amountBMin minimum amount of second token/ | function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin
) public {
IEmiswap pairContract =
IEmiswapRegistry(factory).pools(IERC20(tokenA), IERC20(tokenB));
TransferHelper.safeTransferF... | 5,630,188 |
pragma solidity ^0.4.24;
import "./Ownable.sol";
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
*/
contract CryptoKats is Ownable {
/// @dev The Birth event is fired whenever a new kitten comes into existence. This obv... | Transfers the ownership of a given token ID to another address Usage of this method is discouraged, use `safeTransferFrom` whenever possible Requires the msg sender to be the owner, approved, or operator to address to receive the ownership of the given token ID tokenId uint256 ID of the token to be transferred/ TODO:... | function transfer(
address to,
uint256 tokenId
)
public
{
}
| 1,792,457 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.