file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: AGPL-3.0-only
/*
Bounty.sol - SKALE Manager
Copyright (C) 2020-Present SKALE Labs
@author Dmytro Stebaiev
SKALE Manager is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Softw... | Allows Admin to add schain type/ | function addSchainType(uint8 partOfNode, uint numberOfNodes) external onlyAdmin {
schainTypes[numberOfSchainTypes + 1].partOfNode = partOfNode;
schainTypes[numberOfSchainTypes + 1].numberOfNodes = numberOfNodes;
numberOfSchainTypes++;
}
| 401,233 |
./full_match/1/0xB09923cd48714286500300815F692052F8C5e293/sources/contracts/vaults/BaseVault.sol | @inheritdoc IERC4626/ | function maxRedeem(address owner) public view override(ERC4626, IERC4626) returns (uint256) {
if (vaultState.isProcessingDeposits) {
return 0;
return balanceOf(owner);
}
}
| 4,995,783 |
// to test issue with nodes breaking with large clients over WS
// fixed in web3 with fragmentationThreshold: 8192
pragma solidity ^0.4.17;
contract BigFreakingContract {
event Transfer(address indexed from, address indexed to, uint value);
event Approval( address indexed owner, address indexed spender, uint valu... | TODO: should increase instead | function approve_556(address spender, uint value) public returns (bool ok) {
_approvals[msg.sender][spender] = value;
emit Approval( msg.sender, spender, value );
return true;
}
| 6,454,269 |
./full_match/7700/0x9B2a63F27661A468E2da22226b64A4914144f195/sources/contracts/mixins/TradeMatcher.sol | Dispatches the call to the ICrocLpConduit with the concentrated liquidity LP position that was minted. / | function depositConduit (bytes32 poolHash, int24 lowTick, int24 highTick,
uint128 liq, uint72 mileage, address lpConduit) private {
if (lpConduit != lockHolder_) {
bool doesAccept = ICrocLpConduit(lpConduit).
depositCrocLiq(lockHolder_, poolHash, lowT... | 4,651,273 |
pragma solidity ^0.4.24;
import "oraclize-api/usingOraclize.sol";
/**
*The Oracle contract provides the reference prices for the contracts. Currently the Oracle is
*updated by an off chain calculation by DDA. Methodology can be found at
*www.github.com/DecentralizedDerivatives/Oracles
*/
contract Oracle is usin... | RetrieveData - Returns stored value by given key _date Daily unix timestamp of key storing value (GMT 00:00:00)/ | function retrieveData(uint _date) public view returns (uint) {
QueryInfo storage currentQuery = info[queryIds[_date]];
return currentQuery.value;
}
| 12,719,281 |
/**
*Submitted for verification at Etherscan.io on 2020-07-01
*/
pragma solidity ^0.5.0;
/**
* @title Tellor Transfer
* @dev Contais the methods related to transfers and ERC20. Tellor.sol and TellorGetters.sol
* reference this library for function's logic.
* Many of the functions have been commented out for simplici... | Anyone can use this function to liquidate a vault's debt, the bank admins gets the collateral liquidated vaultOwner is the user the bank admins wants to liquidate/ Require undercollateralization | function liquidate(address vaultOwner) external {
require(getVaultCollateralizationRatio(vaultOwner) < reserve.collateralizationRatio * 100, "VAULT NOT UNDERCOLLATERALIZED");
uint256 debtOwned = vaults[vaultOwner].debtAmount + (vaults[vaultOwner].debtAmount * 100 * reserve.liquidationPenalty / 100 / 100);
... | 12,897,445 |
./full_match/1/0x6b0853dd5B804fA7B320D7528EFB5f22F51e19c9/sources/contracts/ssp/sale/SaleContract.sol | Public Sale minting/ | function mint(uint256 _numberOfCards) external payable {
_internalMint(_numberOfCards, msg.sender, msg.value, TRANSFER_TYPE_ETH);
}
| 4,889,714 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
import "./interfaces/IOwnership.sol";
import "./interfaces/IRegistry.sol";
contract Registry is IRegistry {
event ExistenceSet(address indexed template, address indexed target);
event NewMarketRegistered(address market);
event FactorySet(address ... | Register the cds address for a particular address _address address to set CDS _cds CDS contract address/ | function setCDS(address _address, address _cds)
external
override
onlyOwner
{
require(_cds != address(0), "ERROR: ZERO_ADDRESS");
cds[_address] = _cds;
emit CDSSet(_address, _cds);
}
| 11,944,923 |
pragma solidity ^0.6.0;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner)... | Get option ranges for a given market/ | function getOptionInfo(uint256 _marketId, uint256 _optionNo)
public
view
returns (int256, int256)
{
OptionRange memory _optionRange
= optionInfoForMarket[_marketId][_optionNo];
return (_optionRange.startPrice, _optionRange.endPrice);
}
| 6,441,660 |
/**
*Submitted for verification at Etherscan.io on 2021-12-26
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(msg.sender);
}
function _msgData() internal view vir... | this method is responsible for taking all fee, if takeFee is true | function _tokenTransfer(address sender, address recipient, uint256 amount) private
{
if (enableAntiwhale && maxTransferAmount() > 0) {
if (
_isExcludedFromAntiWhale[sender] == false
&& _isExcludedFromAntiWhale[recipient] == false
) {
... | 7,734,723 |
./full_match/137/0xcE0BF87b5D1F2CbFf468353DC21C250A7f65250c/sources/project_/contracts/Dependencies/SafeMath.sol | the pow == 0 of zero is 1 the pow > 0 of zero is 0 | function pow(uint256 _base, uint256 _pow) internal pure returns (uint256) {
uint256 max = 2**256 - 1;
uint256 x = _base;
uint256 y = 1;
if (_pow == 0) {
return 1;
}
if (_base == 0) {
return 0;
}
while (_pow > 1) {
... | 4,675,141 |
// File: @onchain-id/solidity/contracts/IERC734.sol
pragma solidity ^0.6.2;
interface IERC734 {
... | inject NONSTANDARD NAMING | function ADDCOUNTRYRESTRICTION776(uint16 _country) external ONLYOWNER188 { | 5,524,179 |
pragma solidity ^0.4.25;
contract ERC721 {
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) external view returns (address owner);
// ownerof
// deploy: public ->externa... | 소유하고 있는 암놈과 숫놈을 이용하여 교배를 시키는 method _matronId 암놈의 아이디 _sireId 숫놈의 아이디 _matronDerbyAttendCount 모의 경마 참여 횟수 _matronRanking 모의 랭킹 점수 _sireDerbyAttendCount 부의 경마 참여 횟수 _sireRanking 부의 랭킹 점수 childGenes 부모유전자로 생성된 자식유전자return maxAbility[0]: 최대 속도, maxAbility[1]: 최대 스태미나, maxAbility[2]: 최대 폭발력, -> maxAbility[3]: 최대 start, m... | function _getMaxAbility(uint _matronId, uint _sireId, uint _matronDerbyAttendCount, uint _matronRanking, uint _sireDerbyAttendCount, uint _sireRanking, bytes22 _childGenes)
internal
view
returns (uint[5] )
{
uint[5] memory maxAbility;
DerbyPersonalResult memory matronGrandPrix = gr... | 6,425,217 |
//Address: 0x3e516824a408c7029c3f870510d59442143c2db9
//Contract name: Version
//Balance: 0 Ether
//Verification Date: 2/23/2018
//Transacion Count: 2
// CODE STARTS HERE
pragma solidity ^0.4.13;
interface FundInterface {
// EVENTS
event PortfolioContent(uint holdings, uint price, uint decimals);
even... | Should only be called via Version.setupFund(..) withName human-readable descriptive name (not necessarily unique) ofQuoteAsset Asset against which mgmt and performance fee is measured against and which can be used to invest/redeem using this single asset ofManagementFee A time based fee expressed, given in a number ... | {
isInvestAllowed = true;
isRedeemAllowed = true;
owner = ofManager;
VERSION = msg.sender;
module.compliance = ComplianceInterface(ofCompliance);
module.riskmgmt = RiskMgmtInterface(ofRiskMgmt);
module.pricefeed = PriceFeedInterface(ofPriceFeed);
funct... | 12,885,079 |
./full_match/44787/0x2F095B6F43259c8017794C9f25B2eF774b54B6ce/sources/contracts/token/DonationMinerImplementationV2.sol | Adds a new donation in donations list _donorAddress address of the donner _amount amount of the donation _target address of the receiver (community or treasury)/ | function addDonation(
address _donorAddress,
uint256 _amount,
address _target
) internal {
initializeRewardPeriods();
donationCount++;
Donation storage _donation = donations[donationCount];
_donation.donor = _donorAddress;
_donation.target = _targ... | 13,255,740 |
pragma solidity ^0.4.25;
contract IStdToken {
function balanceOf(address _owner) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public returns(bool);
}
contract EtheramaCommon {
... | user's total reward from all the tokens on the table. includes share reward + referal bonus + promo bonus | function getUserTotalReward(address userAddress, bool incShareBonus, bool incRefBonus, bool incPromoBonus) public view returns(uint256 res) {
for (uint256 i = 0; i < _controllerContractCount; i++) {
address dataContractAddress = Etherama(_controllerIndexer[i]).getDataContractAddress();
... | 1,321,814 |
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimizatio... | if the allowance isn't 0, it can only be updated to 0 to prevent an allowance change immediately after withdrawal | function approve(address _spender, uint256 _id, uint256 _currentValue, uint256 _value) external {
require(_value == 0 || allowances[_id][msg.sender][_spender] == _currentValue);
allowances[_id][msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _id, _currentValue, _value);
... | 952,611 |
./full_match/80001/0xB4cb47bc9C7c7E49d742EB032D8BafD377Be1f31/sources/contracts/Vault.sol | Withdraw amount from underlying protocol shares = amount / PricePerShare _protocolNum Protocol number linked to an underlying protocol e.g compound_usdc_01 _amount in VaultCurrency to withdraw | function withdrawFromProtocol(uint256 _protocolNum, uint256 _amount) internal {
if (_amount <= 0) return;
IController.ProtocolInfoS memory protocol = controller.getProtocolInfo(
vaultNumber,
_protocolNum
);
_amount = (_amount * protocol.uScale) / uScale;
uint256 shares = IProvider(pro... | 5,563,966 |
./full_match/5/0xc891E7f01Eadf9d65E8962260F024b240D03A050/sources/src/IHoprNetworkRegistryRequirement.sol | Interface for HoprNetworkRegistryProxy Network Registry contract (NR) delegates its eligibility check to Network Registry Proxy (NR Proxy) contract. This interface must be implemented by the NR Proxy contract./ | interface IHoprNetworkRegistryRequirement {
function maxAllowedRegistrations(address account) external view returns (uint256);
pragma solidity ^0.8.0;
}
| 1,861,131 |
./partial_match/1/0xC5B0B727B5447442ffafeB6c254F745691a5eEfD/sources/Platform.sol | Return the current period based on Gauge Controller rounding. | function getCurrentPeriod() public view returns (uint256) {
return (block.timestamp / _WEEK) * _WEEK;
}
| 2,664,390 |
pragma solidity >=0.4.22 <0.6.0;
contract Ownable {
address payable public owner;
address payable public developer;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/... | cancel sell order/ normalizeFishAmount(msg.sender); | function cancelSellOrder(uint _orderId) public payable isHuman() PlayerIsAlive() {
transactionSystem.cancelSellOrder(msg.sender, _orderId);
}
| 2,577,600 |
pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;
import "../solidity-rlp/RLPReader.sol";
contract MetaProxy {
using RLPReader for RLPReader.RLPItem;
using RLPReader for bytes;
address public currentSigner;
mapping (address => uint256) public nonces;
struct MetaTransaction {
uin... | parse meta txverify signature | function proxy(bytes memory rawMetaTx) public {
MetaTransaction memory t = rawToMetaTx(rawMetaTx);
require(t.expires > block.timestamp, "metatx expired");
address signer = verifySigner(t);
require(t.nonce == nonces[signer]++, "invalid nonce");
currentSigner = signer;
... | 12,648,251 |
./partial_match/1/0x4eA5424C393869505CBD7F8d802595328aAB89Fe/sources/Incentives.sol | A simple interface used by exchange to track rewards Tracks the rewards for traders / referrals based of the amount Tracks liquidity being removed | interface IIncentives {
function rewardTrader(address traderAddress, address referalAddress, uint256 amount) external;
function trackLiquidityRemoved(address liquidityProvider, uint256 amount) external;
}
| 2,610,715 |
/*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██... | General payment function for manager of LXL contract. details Describes context for ETH transfer./ | function tributeToManager(string calldata details) external nonReentrant payable {
require(success, "!ethCall");
emit TributeToManager(details);
(bool success, ) = manager.call{value: msg.value}("");
}
| 1,200,482 |
pragma solidity ^0.5.8;
/**
*
* Manages data storage for a single CypherPoker hand (round), and provides some publicly-available utility functions.
*
* (C)opyright 2016
*
* This source code is protected by copyright and distributed under license.
* Please see the root LICENSE file for terms and conditions.
*
... | Deletes / clears the 'playerKeys' array for an agreed player address. fromAddr The agreed player address for which to clear entries (encryption and decryption keys), from the 'playerKeys' array./ | function remove_playerKeys(address fromAddr) public onlyAuthorized {
delete playerKeys[fromAddr];
}
| 15,866,931 |
./full_match/1/0x25A103A1D6AeC5967c1A4fe2039cdc514886b97e/sources/contracts/RWAHub.sol | Admin function to overwrite entries in the depoitIdToDepositor mapping depositIdToOverwrite The depositId of the entry we wish to overwrite user The user for the new entry depositAmountAfterFee The deposit value for the new entry priceId The price... | function overwriteDepositor(
bytes32 depositIdToOverwrite,
address user,
uint256 depositAmountAfterFee,
uint256 priceId
) external onlyRole(MANAGER_ADMIN) checkRestrictions(user) {
Depositor memory oldDepositor = depositIdToDepositor[depositIdToOverwrite];
depositIdToDepositor[depositIdToOv... | 3,021,972 |
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be... | Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner | function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
_approve(address(0), tokenId);
_holde... | 1,139,855 |
// File: @openzeppelin/contracts/math/SafeMath.sol
// 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... | error message binary size optimization | function _inactive() internal view {
require(!isActive(), "ERR_ACTIVE");
}
| 1,735,970 |
./full_match/5/0xB46fC42D8Ac3aF75de51696eC0B2c28684E3BD43/sources/contracts/CrowdFunding.sol | Once create a campaign, return ID of campaign Test to see if everything is okay Index of newest created campaign | function createCampaign(
address _owner,
string memory _title,
string memory _description,
uint256 _target,
uint256 _deadline,
string memory _image
)
public
returns (
uint256
)
{
Campaign storage campaign = campaigns... | 1,899,663 |
/**
*Submitted for verification at Etherscan.io on 2020-09-18
*/
/**
*Submitted for verification at Etherscan.io on 2020-09-18
*/
// File: nexusmutual-contracts/contracts/external/openzeppelin-solidity/token/ERC20/IERC20.sol
pragma solidity 0.5.7;
/**
* @title ERC20 interface
* @dev see https://github.com/ethe... | updates daiFeedAddress address. _add address of DAI feed. | function changeDAIfeedAddress(address _add) external onlyInternal {
daiFeedAddress = _add;
}
| 7,286,822 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title WrappedBustOfRomeOneYear
/// @author jpegmint.xyz
import "./INiftyBuilder.sol";
import "./@jpegmint/contracts/ERC721Wrapper.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openze... | NiftyBuilder interface stub for IPFS hash method./ | interface INiftyBuilder is IERC721 {
function tokenIPFSHash(uint256 tokenId) external view returns (string memory);
}
| 14,789,115 |
./full_match/1/0xAa40C7b65333D5fE66b718Bb0617f0a6662CDc9D/sources/contracts/ICO.sol | Sets phase info according to the tokens bought / when phase has more tokens than reuired / when tokens required are more than left tokens in phase / if tokens left in phase afterb completion of expiration time / | function setPhaseInfo(
uint256 _tokensUserWillGet,
uint256 _referralReward,
uint8 _phaseNo
) internal {
require(_phaseNo <= totalPhases, "All tokens have been exhausted.");
Phases storage pInfo = phaseInfo[_phaseNo];
if (block.timestamp < pInfo.expirationTimesta... | 16,507,748 |
// SPDX-License-Identifier: MIT
pragma solidity >0.6.0 <0.8.0;
import "openzeppelin-solidity/contracts/token/ERC1155/ERC1155.sol";
import "openzeppelin-solidity/contracts/token/ERC1155/ERC1155Holder.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "hardhat/console.sol";
contract Gradient... | if (msg.sender) RoundSize[msg.sender] = KarmaPower(); | function SeekFundingRound(uint256 funding) public {
_mint(address(this), YouOweMe_TOKEN, funding, "");
}
| 7,243,895 |
// SPDX-License-Identifier: MIT
// ██╗ ██╗ █████╗ ██╗ ██╗ ██╗ █████╗ ██╗ ██╗ █████╗
// ╚██╗ ██╔╝ ██╔══██╗ ██║ ██║ ██║ ██╔══██╗ ██║ ██║ ██╔══██╗
// ╚██╗ ██╔╝ ███████║ ██║ ███████║ ███████║ ██║ ██║ ███████║
// ╚████╔╝ ██╔══██║ ██║ ██╔══██║ ██╔══██║ ██... | Start farming Only dev can call this function | function start() public {
require(msg.sender == treasury, 'Only dev can start farming');
require(farmingStartTimestamp == 0, 'Farming has already started');
farmingStartTimestamp = block.timestamp;
}
| 1,199,728 |
./partial_match/1/0x11Fc7df1fb0E51f9c9AB8f575d9bbaDC92FA425B/sources/TWAMM_AMO.sol | Burn unneeded or excess FRAX. Goes through the minter | function burnFRAX(uint256 frax_amount) public onlyByOwnGov {
FRAX.approve(address(amo_minter), frax_amount);
amo_minter.burnFraxFromAMO(frax_amount);
emit FRAXBurned(frax_amount);
}
| 15,932,938 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "openzeppelin-solidity/contracts/GSN/Context.sol";
import "../COMMITTEDAO.sol";
import "./IRandom.sol";
/**
* @dev Contract module which calculates a random number via DAO.
*
* TODO:
*
* - adding VDF (verifiable delay functions) or VRF (ver... | Reveals vote./ TODO: Implement 'depositOf'. address msgSender = _msgSender(); int256 weights_ = int256(depositOf(msgSender)); if (!agree_) { weights_ = (-1); } | function revealVoteAt(
uint256 campaignNum,
bool agree_,
uint256 seed_
) public returns (bool) {
return _revealVoteAt(campaignNum, weights, seed_);
}
| 12,794,777 |
pragma solidity >=0.4.25 <0.6.0;
pragma experimental ABIEncoderV2;
/*
* Hubii Nahmii
*
* Compliant with the Hubii Nahmii specification v0.12.
*
* Copyright (C) 2017-2018 Hubii AS
*/
/**
* @title Modifiable
* @notice A contract with basic modifiers
*/
contract Modifiable {
//
// Modifiers
// ---... | Transfer funds to the beneficiary Get transfer controller Approve of beneficiary Transfer funds to the beneficiary | function _transferToBeneficiary(address destWallet, Beneficiary beneficiary,
int256 value, address currencyCt, uint256 currencyId, string memory standard)
private
{
require(value.isNonZeroPositiveInt256());
require(isRegisteredBeneficiary(beneficiary));
if (address(0) == cur... | 14,081,018 |
./partial_match/8453/0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45/sources/lib/governance-crosschain-bridges/contracts/bridges/BridgeExecutorBase.sol | @inheritdoc IExecutorBase | function updateDelay(uint256 delay) external override onlyThis {
_validateDelay(delay);
_updateDelay(delay);
}
| 16,694,605 |
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be... | Configure how to distribute the fees for user's withdraws./ | function setFeesDestinatorsWithPercentages(
address[] memory _destinators,
uint256[] memory _percentages
)
public
onlyOwner()
{
require(_destinators.length <= 3, "AlohaStaking: Destinators lenght more then 3");
require(_percentages.length <= 3, "AlohaStaking: ... | 147,477 |
//Address: 0x00416B9d728069eDB0cEb04bC2b203fA7336d1F1
//Contract name: AversafeSeedCrowdsale
//Balance: 0 Ether
//Verification Date: 11/29/2017
//Transacion Count: 36
// CODE STARTS HERE
/*
Copyright 2017 Cofound.it.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file ex... | withdrawEth when minimum cap is reached @owner sets contributions to withdraw | function withdrawEth() onlyOwner public {
require(this.balance != 0);
require(ethRaised >= minCap);
pendingEthWithdrawal = this.balance;
}
| 1,003,040 |
./full_match/1/0xbf71d25d74A1428aaa4FA84AAE595D8a26b960db/sources/contracts/TokenLock/TokenLock.sol | Gets surplus amount in the contract based on outstanding amount to release All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary return Amount of tokens considered as surplus/ | function surplusAmount() public view override returns (uint256) {
uint256 balance = currentBalance();
uint256 outstandingAmount = totalOutstandingAmount();
if (balance > outstandingAmount) {
return balance.sub(outstandingAmount);
}
return 0;
}
| 2,977,493 |
pragma solidity ^0.4.24;
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
... | Divides two numbers and returns the remainder (unsigned integer modulo), reverts when dividing by zero./ | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "Math failed");
return a % b;
}
| 12,873,861 |
./full_match/100/0x0995e02276c2c5D1712a891731998Dbb43a590fC/sources/contracts/Math.sol | Get commission adjusted betting odds. odds betting odds marginality bookmaker commission multiplier decimal unit representation return newOdds commission adjusted betting odds/ | function marginAdjustedOdds(
uint256 odds,
uint256 marginality,
uint256 multiplier
) public pure returns (uint256 newOdds) {
uint256 revertOdds = multiplier**2 /
(multiplier - multiplier**2 / odds);
uint256 a = ((multiplier + marginality) * (revertOdds - multi... | 14,288,052 |
pragma solidity ^0.4.24;
//@Author Kirin
contract Infinitestars {
using Player for Player.Map;
using CommUtils for string;
using InfinitestarsData for InfinitestarsData.Data;
using Ball for Ball.Data[];
uint256 public constant WITHDRAWAL_AUTO_BUY_COUNT = 1;
uint256 public const... | filters name strings -converts uppercase to lower case. -makes sure it does not start/end with a space -makes sure it does not contain multiple spaces in a row -cannot be only numbers -cannot start with 0x -restricts characters to A-Z, a-z, 0-9, and space. return reprocessed string in bytes32 format/sorry limited to 32... | function nameFilter(string _input)
internal
pure
returns(bytes32)
{
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
require(_temp[0] != 0x20 ... | 7,300,029 |
/**
*Submitted for verification at Etherscan.io on 2020-05-06
*/
pragma solidity ^0.4.24;
// File: /Users/matthewmcclure/repos/Token-Audit/node_modules/openzeppelin-zos/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EI... | Add RNDR tokens to a job This can only be called by a function on the RNDR token contract _jobId the ID of the job used in the jobBalances mapping _tokens the number of tokens sent by the artist to fund the job/ Jobs can only be created by the address stored in the renderTokenAddress variable | function fundJob(string _jobId, uint256 _tokens) external {
require(msg.sender == renderTokenAddress, "message sender not authorized");
jobBalances[_jobId] = jobBalances[_jobId].add(_tokens);
emit JobBalanceUpdate(_jobId, jobBalances[_jobId]);
}
| 14,998,956 |
/**
*Submitted for verification at Etherscan.io on 2021-11-14
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply()... | NOTE may be needed depending on price of GDAO. As ETH may pile up in the contract when adding liquidity | function emergencyWithdrawalETH(address _receiver) external onlyOwner{
payable(_receiver).transfer(address(this).balance);
}
| 6,800,864 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;
pragma abicoder v2;
import './SafeMath.sol';
import './AggregatorV3Interface.sol';
import './Wallet.sol';
// Crowdsale contract for ZAPP. Functionalities:
// - Timed: opens Jan 14, 2021, 6:00:00PM UTC (1610647200) and closes Feb 14, 2021, 6:00:00PM UTC (1... | addr address to get bonus of return The amount of ZAPP bits this address will get as referrer bonus (18 decimals)/ | function getReferrerBonus(address addr) public view returns (uint256) {
if (hasWalletClaimed(addr)) return 0;
return _wallets[addr].getReferrerBonus(_referralBonus, _referrerMin, isClaimable());
}
| 12,585,370 |
./partial_match/1/0x5330Abcd778D5AE2e242dFD088682640Bac03506/sources/PFPPointer.sol | Changes provider in the event of an exploit or bug provider The new provider address needs to be owner and will not work once ownership is burnt | function changeProvider(address provider) _isOwner() public {
emit ProviderChanged(_nftQuerierProvider, address(provider));
_nftQuerierProvider = provider;
}
| 16,021,838 |
./full_match/80001/0xFe244Bbd340cbA81F4106F2B0B936453D1B1E2B6/sources/project_/contracts/superfluid/SuperfluidPool.sol | @inheritdoc ISuperfluidPool | function getMemberFlowRate(address memberAddr) external view override returns (int96) {
uint128 units = _membersData[memberAddr].ownedUnits;
if (units == 0) return 0;
else return (_index.wrappedFlowRate * uint256(units).toInt256()).toInt96();
}
| 841,423 |
pragma solidity ^0.4.0;
import {ScryptFramework} from "./scryptFramework.sol";
//import {Verifier} from "./verify.sol";
contract ScryptVerifier is ScryptFramework /*, Verifier*/ {
// function unpackState(bytes value) pure internal returns (State memory s, bool err) {
// if (value.length != 32 * 5)
// ... | This is the root hash of empty memory. | function initMemory(State memory state) pure internal {
state.memoryHash = bytes32(0x93b69c64407d65fb222caeb0b7c23ca69fc00f3edb84381093ccb4fe21beab9d);
}
| 13,137,484 |
./full_match/97/0xFbb952EF8435CA572306d3613d81B27E074F3a17/sources/contracts/core/interfaces/IDrawBuffer.sol | IDrawBuffer TricleStaking Inc Team The DrawBuffer interface./ | interface IDrawBuffer {
event DrawSet(uint32 indexed drawId, IDrawBeacon.Draw draw);
function getBufferCardinality() external view returns (uint32);
function getDraw(uint32 drawId) external view returns (IDrawBeacon.Draw memory);
function getDraws(uint32[] calldata drawIds) external view returns (IDr... | 3,273,537 |
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.1;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./interfaces/... | start at end of array for efficient popping of elementsamount of input of user bakedamount of output the user is entitled to handle rounding issues due to integer division inaccuracies handle rounding issues due to integer division inaccuracies | function withdrawTo(address _to, uint256 _roundsLimit) public {
uint256 inputAmount;
uint256 outputAmount;
uint256 userRoundsLength = userRounds[_msgSender()].length;
uint256 numRounds = userRoundsLength.min(_roundsLimit);
for(uint256 i = 0; i < numRounds; i ++) {
uint256 roundIndex = ... | 988,168 |
./full_match/43114/0x21499643B1Dd73168807eb1eDfa0b43b50b8F30F/sources/cache/solpp-generated-contracts/StakingV1.sol | @inheritdoc IStakingV1 | function claimRewards(bool _claimBro, bool _claimBBro)
external
whenNotPaused
returns (uint256, uint256)
{
require(
_claimBro || _claimBBro,
"Must claim at least one token reward"
);
Staker storage staker = _updateStaker(
_msgS... | 4,624,972 |
./full_match/84531/0xF1a0E4ffd3C7470bA66A4c4Afd6C9e716Fb70E3d/sources/contracts/TipJar.sol | funtion to send tips to this contract | function sendTip()
public
payable
checkTipAmount(msg.value) {
require(success == true, "TipJar: Transfer Failed");
}
| 11,512,499 |
pragma solidity ^0.5.17;
interface IERC20 {
function TOTALSUPPLY313() external view returns (uint); //inject NONSTANDARD NAMING
function BALANCEOF488(address account) external v... | inject NONSTANDARD NAMING | function _MINT358(address account, uint amount) internal { | 13,006,507 |
./partial_match/1/0x15b5E4d4330cea114141f3089F13FF8130369E64/sources/contracts/protocol/tokenization/RebasingPToken.sol | Returns the scaled balance of the user and the scaled total supply. user The address of the user return The scaled balance of the user return The scaled balance and the scaled total supply/ | function getScaledUserBalanceAndSupply(address user)
external
view
override(IScaledBalanceToken, ScaledBalanceTokenBaseERC20)
returns (uint256, uint256)
{
uint256 rebasingIndex = lastRebasingIndex();
return (
_scaledBalanceOf(user, rebasingIndex),
... | 2,890,517 |
./partial_match/97/0x406b97165b45963F396389Fc8d403683b88CFC52/sources/BUB.sol | PUBLIC FACING: Unlocks a completed stake, distributing the proceeds of any penalty immediately. The staker must still call stakeEnd() to retrieve their stake return (if any). stakerAddr Address of staker stakeIndex Index of stake within stake list stakeIdParam The stake's id/ require() is more informative than the d... | function stakeGoodAccounting(address stakerAddr, uint256 stakeIndex, uint40 stakeIdParam)
external
{
GlobalsCache memory g;
GlobalsCache memory gSnapshot;
_globalsLoad(g, gSnapshot);
require(stakeLists[stakerAddr].length != 0, "BUB: Empty stake list");
require(st... | 11,372,868 |
/**
*Submitted for verification at Etherscan.io on 2021-04-26
*/
// Sources flattened with hardhat v2.1.2 https://hardhat.org
// File contracts/interfaces/IERC20.sol
// SPDX-License-Identifier: MIT;
pragma solidity ^0.7.6;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
... | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint256 blockNumber) external view returns (uint256) {
require(blockNumber < block.number, "UFARM::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
if (checkpoints[account][nChec... | 10,680,950 |
pragma solidity ^0.4.11;
import "./DINRegistry.sol";
import "./KioskMarketToken.sol";
import "./OrderUtils.sol";
contract OrderTracker {
// The address of the DIN Registry contract.
DINRegistry public dinRegistry;
// The address of the Kiosk Market Token contract.
KioskMarketToken public KMT;
// The current or... | Let the market add data to the order to later verify that a seller fulfilled the order. | function setData(uint256 orderID, bytes32 data) only_market(orders[orderID].DIN) {
orders[orderID].data = data;
}
| 2,537,945 |
pragma solidity ^0.4.20;
/**
* Authored by https://www.coinfabrik.com/
*/
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public ow... | Implements the criterion of the funding state | function isCrowdsaleFull() internal view returns (bool) {
return tokensSold >= sellable_tokens;
}
| 12,579,272 |
pragma solidity ^0.5.0;
import '../../token/ERC721/ERC721Full.sol';
import '../../ownership/Ownable.sol';
/// @title Generative Structures
/// @author https://github.com/RaymondDashWu
/// @notice This contract is for generating structures based on OpenJSCAD. Contract will return minified jscad code that has been com... | Read-only function that returns the current generative code | function getGenerativeCode() public view returns(string memory) {
return code;
}
| 13,100,393 |
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract CafeBar is ERC20("CafeBar", "xCAFE"){
using SafeMath for uint256;
IERC20 public cafe;
constructor(IERC20 _... | Leave the bar. Claim back your CAFEs. | function leave(uint256 _share) public {
uint256 totalShares = totalSupply();
uint256 what = _share.mul(cafe.balanceOf(address(this))).div(totalShares);
_burn(msg.sender, _share);
cafe.transfer(msg.sender, what);
}
| 2,515,853 |
./full_match/5/0xb93278af83Ab7FC2A9d08EF096f49EE8616C95A2/sources/contracts/Miratashi.sol | Allows the owner to set a new registrant contract./ | function setOperatorFilterRegistryAddress(
address _registryAddress
) external onlyOwner {
operatorFilterRegistryAddress = _registryAddress;
}
| 11,588,429 |
./partial_match/97/0x60c452CCc66Ee20f19c64f308F842205F8b7e869/sources/BSAFE.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "BSAFE::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return... | 11,421,047 |
./full_match/97/0x9136385F9C2D2cDB3CfE120B8169e1b3c836Ca03/sources/project_/contracts/BuySell.sol | emit Withdrawn(userAddress, amt); | function withdraw(BEP20 BUSD, address userAddress, uint256 amt) external onlyOwner() returns(bool){
require(BUSD.balanceOf(address(this)) >= amt,"ErrAmt");
BUSD.transfer(userAddress, amt);
return true;
}
| 3,292,342 |
./full_match/80001/0xa114Ef31a6A1F66b3129A175980aCD697D3257aa/sources/@chainlink/contracts/src/v0.8/functions/dev/v1_0_0/libraries/FunctionsRequest.sol | Sets bytes args for the user run function self The initialized request args The array of bytes args (must not be empty) | function setBytesArgs(Request memory self, bytes[] memory args) internal pure {
if (args.length == 0) revert EmptyArgs();
self.bytesArgs = args;
}
| 5,585,515 |
./full_match/80001/0x990D76F1190D5098928cd2cAcCe0a2C9293EfBa8/sources/contracts/v1/SynsMarketplace.sol | Returns an array of `listingIds` that are owned by a specific listing's creator | function getListingById(uint256 _listingId) external view returns (Listing memory) {
return totalListingItems[_listingId];
}
| 845,934 |
./full_match/1/0xB7F6014941460fF1f5Ed3B5b2DD59f339d39DBaB/sources/contracts/RubyCoin.sol | --- section 2 --- : Token specific logics | function getMaxTxnAmount() public view returns (uint256) {
return _maxTxAmount;
}
| 3,002,317 |
./full_match/5/0xa7dB5EaB2b70BDA78697Cb1a8e8004B29e58983e/sources/contracts/NewContracts/721AV2(R,PS).sol | Sets the base URI for the token metadata. Only the contract owner can call this function. | function setBaseURI(string memory newBaseURI) public onlyOwner {
baseURI = newBaseURI;
}
| 1,852,639 |
pragma solidity ^0.5.2;
contract ModExp {
// address constant MODEXP_BUILTIN = 0x0000000000000000000000000000000000000005;
function modexp(uint256 b, uint256 e, uint256 m) internal returns(uint256 result) {
assembly {
let freemem := mload(0x40)
mstore(freemem, 0x20)
... | computing inverse by using fermat's theorem | function invmod(uint256 _a, uint _p) internal returns(uint256 invA) {
invA = modexp(_a, _p - 2, _p);
}
| 13,113,481 |
./full_match/1/0x00000000005AFfE6623a1753f7C055a28bC6628C/sources/src/Fundrop/FunMint.sol | slightly modified from https:github.com/nounsDAO/nouns-monorepo/blob/10bb478328bdb5f4c5efffed9a8c5186f9fe974a/packages/nouns-contracts/contracts/governance/NounsDAOLogicV2.solLL1033C2-L1048C21 | function _refundGas(uint256 startGas) internal {
unchecked {
uint256 balance = address(this).balance;
if (balance == 0) {
return;
}
uint256 basefee = _min(block.basefee, MAX_REFUND_BASE_FEE);
uint256 gasPrice = _min(tx.gasprice, bas... | 8,354,786 |
./full_match/4/0x71aDb425cC2aC83319FFBE30664916Fddc106588/sources/kali.sol | this is reasonably safe from overflow because incrementing `i` loop beyond 'type(uint256).max' is exceedingly unlikely compared to optimization benefits | function multicall(bytes[] calldata data) public virtual returns (bytes[] memory results) {
results = new bytes[](data.length);
unchecked {
for (uint256 i = 0; i < data.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(data[i]);
... | 693,360 |
./partial_match/56/0xa25FC408EF05321103243557C851101f9AceE608/sources/CHIP.sol | Transfers ownership of the contract to a new account (`newOwner`)./ | function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
} ... | 11,206,448 |
// 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 retu... | Change the zs token -------------------- | function startChangeZSToken(address _address) external onlyGovernance {
_timelockStart = now;
_timelockType = 4;
_timelock_address = _address;
if(zsTokenAddress == address(0)){
_timelockType = 0;
internalChangeZSToken(_timelock_address);
}
}
| 14,367,349 |
./full_match/80001/0xCBE0213b3a4B041437EC44781357a03845821451/sources/contracts/PrmntArt.sol | string memory output = string.concat('data:application/json;base64,', Base64.encode( abi.encodePacked( '", "creator": "', tokenArtworks[tokenId].creator, '", "extended": "', extendedBase, tokenArtworks[tokenId].extended, | function getURI(
uint256 tokenId
) internal view returns (string memory) {
return string.concat('data:application/json;base64,',
Base64.encode(
abi.encodePacked(
'{"name": "',
tokenArtworks[tok... | 9,447,516 |
/**
*Submitted for verification at Etherscan.io on 2022-04-30
*/
// File: default_workspace/contracts/Ownable.sol
pragma solidity ^0.8.10;
error NotOwner();
// https://github.com/m1guelpf/erc721-drop/blob/main/src/LilOwnable.sol
abstract contract Ownable {
address internal _owner;
event OwnershipTransfer... | Set the contract addresses for all future instances. | function setContractAddresses(
address _avatarContract,
address _questContract
) public onlyOwner {
avatarContract = ERC721(_avatarContract);
questContract = ERC721(_questContract);
}
| 15,218,674 |
pragma solidity 0.5.15;
contract IAugur {
function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING
function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA... | inject NONSTANDARD NAMING | function LOGTRADINGPROCEEDSCLAIMED757(IUniverse _universe, address _sender, address _market, uint256 _outcome, uint256 _numShares, uint256 _numPayoutTokens, uint256 _fees) public returns (bool); | 2,553,795 |
./partial_match/1/0x8281f2bECfF37326Eb6cBE33527434611558B031/sources/DepegProduct.sol | product not depegged grace period is over policy alread has claim | function policyIsAllowedToClaim(bytes32 processId)
external
view
onlyMatchingPolicy(processId)
returns(bool mayClaim)
{
if(_state != DepegState.Depegged) {
return false;
}
(, uint256 expiredAt) = getPolicyExpirationData(processId);
i... | 4,153,897 |
pragma solidity ^0.7.1;
/**
* @title A simple venue implementation that has it's own token and can accept deposits of tokens.
*/
// Open Zeppelin
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
// Primitive
import {... | A basic function to deposit an option into this contract's internal balance./ Receivers are this address Call the _house to mint options Get option addresses Update long balance Update short balance | function deposit(
bytes32 oid,
uint256 amount,
address receiver
) public returns (bool) {
address[] memory receivers = new address[](2);
receivers[0] = address(this);
receivers[1] = address(this);
console.log("minting options");
_mintOptions(oid, ... | 12,825,511 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ ... | Combined into one function due to 24KiB contract memory limit | function setPoolParameters(uint256 new_ceiling, uint256 new_bonus_rate, uint256 new_redemption_delay, uint256 new_mint_fee, uint256 new_redeem_fee, uint256 new_buyback_fee, uint256 new_recollat_fee, uint256 _reserve_refresh_cooldown, uint256 _max_drift_band) external onlyByOwnerOrGovernance {
pool_ceiling =... | 13,039,260 |
./full_match/7701/0x4d1f03cBC1bEdAf1bE684Fd2c50FD1eD2C307db4/sources/src/CIPTestNFT.sol | Get the token URI for the specified _id _id ID to query for | function tokenURI(uint256 _id) public view override returns (string memory) {
if (!_exists(_id)) revert TokenNotMinted(_id);
string memory json = Base64.encode(
bytes(
string(
abi.encodePacked(
)
)
)
... | 13,214,695 |
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "../library/LibSafeMath.sol";
import "../ERC1155Mintable.sol";
import "../mixin/MixinOwnable.sol";
import "../mixin/MixinPausable.sol";
import "../HashRegistry.sol";
contract SagaHistoricMinter is Ownable, MixinPausable {
using LibSafeMath for uint256... | Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. MUST emit the ApprovalForAll event on success. operator Address to add to the set of authorized operators approved True if the operator is approved, false to revoke approval | function setApprovalForAll(address operator, bool approved) external override {
operatorApproval[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
| 63,644 |
pragma solidity >=0.5.3 < 0.6.0;
import { BaseTokenManager } from "../BaseTokenManagerV1.sol";
import { IERC20 } from "../../../_resources/openzeppelin-solidity/token/ERC20/IERC20.sol";
/// @author Ben, Veronica & Ryan of Linum Labs
/// @author Ryan N. RyRy79261
/// @title Basic Linear Token Manager
c... | Transfer ownership token from msg.sender to a specified address _to : address The address to transfer to. _value : uint256 The amount to be transferred. | function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender], "Insufficient funds");
require(_to != address(0), "Target account invalid");
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_val... | 12,954,589 |
./full_match/1/0xE56a239BcF946700C6063FDb8afa015C89e30266/sources/contracts/hoxacoin.sol | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "Token: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "Token: burn amount exceeds balance");
_balances[account] = account... | 3,165,529 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
... | inject NONSTANDARD NAMING | function ISCONTRACT963(address account) internal view returns (bool) { | 5,357,235 |
./partial_match/1/0xdF3FEEc1e48Ddb8553557623aCA6ea6c87A30576/sources/contracts/StringBuffer.sol | Copies 32 bytes of `src` starting at `srcIndex` into `dst` starting at `dstIndex`./ | function memcpy32(string memory src, uint srcIndex, bytes memory dst, uint dstIndex) internal pure {
assembly {
mstore(add(add(dst, 32), dstIndex), mload(add(add(src, 32), srcIndex)))
}
}
| 4,025,911 |
pragma solidity ^0.4.25;
/*
* Creator: CCVT (CrytoCoinVillage)
*/
/*
* 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 ... | Create _value new tokens and give new created tokens to msg.sender. May only be called by smart contract owner. _value number of tokens to create return true if tokens were created successfully, false otherwise/ adding transfer event and _from address as null address | function createTokens(uint256 _value) public
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount,... | 520,180 |
/**
*Submitted for verification at Etherscan.io on 2020-10-05
*/
// File: solidity/contracts/token/interfaces/IERC20Token.sol
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
/*
ERC20 Standard Token interface
*/
interface IERC20Token {
function name() external view returns (string... | send coins throws on any error rather then return a false flag to minimize user errors in addition to the standard checks, the function throws if transfers are disabled _to target address _value transfer amount return true if the transfer was successful, false if it wasn't/ | function transfer(address _to, uint256 _value) public override(IERC20Token, ERC20Token) returns (bool) {
return super.transfer(_to, _value);
}
| 2,521,849 |
/**
*Submitted for verification at Etherscan.io on 2020-09-10
*/
/**
*Submitted for verification at Ether5.net on 2020-09-07
*/
/**
*
* Designed by Team Brave
* Developed by Advanced Smart Contract Concepts ... | method to settle and withdraw the daily ROI | private {
uint256 remainingTimeForPayout;
uint256 currInvestedAmount;
function settleIncome(address _playerAddress)
if(now > player[_playerAddress].lastSettledTime + payoutPeriod) {
uint256 extraTime = now.sub(player[_playerAddr... | 2,231,384 |
./partial_match/1/0x232F030747008D3bA5d51526f5966d8985218Ff0/sources/WoolReward.sol | ========== OWNER ONLY ========== / Allow owner to change woolPerAlpaPerBlockInverse/ | function setWoolPerAlpaPerBlockInverse(uint256 _value) public onlyOwner {
woolPerAlpaPerBlockInverse = _value;
}
| 2,871,666 |
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: Issuer.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/Iss... | Remove its contribution from the debt pool snapshot, and invalidate the cache to force a new snapshot. | function removeSynth(bytes32 currencyKey) external onlyOwner {
IIssuerInternalDebtCache cache = debtCache();
cache.updateCachedSynthDebtWithRate(currencyKey, 0);
cache.updateDebtCacheValidity(true);
_removeSynth(currencyKey);
}
| 540,887 |
./full_match/1/0x329F5a8d24503fC00B31b229835b6452A6723ae4/sources/home/arman/dev/dvf-contracts/amm-core/contracts/PairWithL2Overlay.sol | All amounts are quantized In case of mint only (no swap) we don't require mint to be optimal in order to allow donations to the amm. So we skip validation here and rely solely on validateStateTransition executed at the end of syncStarkware. However in mint + swap case, we enforce an optimal mint here, so that the contr... | function _mintStarkware(
uint256 lpAmount,
uint256 balance0,
uint256 balance1,
uint256 token0Amount,
uint256 token1Amount,
address exchangeAddress,
bool validateAmounts
) internal returns (uint256 finalBalance0, uint256 finalBalance1) {
{
uint baseLpAmount = lpQuantum.fromQuantiz... | 9,718,003 |
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface InvestingAPI is IERC20 {
// Deposit to a pool, returns amount deposited
function deposit_eth(uint256 _amount) external returns (uint256);
function deposit_stn(uint256 _amount) external returns (uint256);
... | Sells Asset to DAI | function sellAsset() external; | 6,410,270 |
./partial_match/97/0xA5E69b50d26fFFCbED9788ca1e93A14755bc84d2/sources/project_/contracts/KunciNFT.sol | sets our URI and makes the ERC1155 OpenSea compatible/ | function uri(uint256 _tokenid) override public view returns (string memory) {
return string(
abi.encodePacked(
baseMetadataURI,
Strings.toString(_tokenid),".json"
)
);
}
| 11,350,578 |
./full_match/421613/0x3203cdc7B96998C47c4a805Ca0F09e297a0158A7/sources/eggcess.sol | Function for users to send a bid to another user based on their social media handle. receiverAddress The address of the receiver or owner's address if the receiver's Eggcess profile is not created. socialMediaHandle The social media handle (e.g., Twitter handle) of the receiver./ | function sendBid(address receiverAddress, string memory socialMediaHandle) external payable {
require(msg.value > 0, "Invalid bid amount");
require(bytes(socialMediaHandle).length > 0, "Social media handle cannot be empty");
string memory key = string(abi.encodePacked(msg.sender, receiverAd... | 11,584,146 |
./partial_match/1/0x80497049b005Fd236591c3CD431DBD6E06eB1A31/sources/contracts/rewards/Staking.sol | @inheritdoc IStaking | function initializeFarming() external {
require(farmingInitialized == false, "Staking::initializeFarming::Farming campaign already initialized");
_approve(address(this), address(farming), 1 wei);
_mint(address(this), 1 wei);
farming.deposit(CAMPAIGN_ID, 1 wei);
farmingInitia... | 2,865,086 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Buy flight ticket/ | function getFlightTicket
(
bytes32 flightKey,
address customerAddress
)
external
requireIsOperational
... | 12,729,744 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./interfaces/IComptroller.sol";
import "./interfaces/ICToken.sol";
impor... | Execute reduce reserve for cToken cToken The cToken to dispatch reduce reserve operation batchJob indicate whether this function call is within a multiple cToken batch job/ Extract reserves through cTokenAdmin. After the extraction, the reserves in cToken should decrease. Instead of getting reserves from cToken again... | function dispatch(address cToken, bool batchJob) internal {
require(!isBlocked[cToken], "market is blocked from reserves sharing");
require(comptroller.isMarketListed(cToken), "market not listed");
uint totalReserves = ICToken(cToken).totalReserves();
ReservesSnapshot memory snapsho... | 1,183,346 |
./partial_match/1/0xAB52F8B1f1003F5Cd4465DE6eC32498F56120dB5/sources/contracts/Votium.sol | function for depositor to withdraw unprocessed incentives this should only happen if a gauge does not exist or is killed before the round ends fees are not returned | function withdrawUnprocessed(
uint256 _round,
address _gauge,
uint256 _incentive
) public nonReentrant {
require(
_round <= lastRoundProcessed || _round + 3 < activeRound(),
"!roundNotProcessed"
require(
incentives[_round][_gauge][_ince... | 9,192,331 |
./full_match/11155111/0x7C2A9525818B0c1589885de370323B1B385224D1/sources/SmokleySLounge.sol | set the user and expires of an NFT The zero address indicates there is no user Throws if `tokenId` is not valid NFT user The new user of the NFT expires UNIX timestamp, The new user could use the NFT before expires | function setUser(uint256 tokenId, address user, uint64 expires)
public
payable
virtual
nonReentrant
{
require(_isApprovedOrOwner(msg.sender, tokenId), "yo! Cant do that shit lol");
require(ownerOf(tokenId) == user, "owner must be user");
require(subscri... | 3,825,500 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.