file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
pragma solidity >=0.4.22 <0.7.0;
import "./ITimeMachineChat.sol";
contract Group is IGroup{
//Since indexed params cost more then normal one, only groupName has been indexed
//In this case, make sense to index also the "from" but just to show an alternative filtering mechanism:
//Example: If you want to filter... | Only the TimeMachineChat contract can call this function | function updatePosition(uint _pos) external override isTMC{
pos = _pos;
}
| 12,788,768 |
/**
*Submitted for verification at Etherscan.io on 2022-04-29
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply(... | multiplies two float values, required since solidity does not handle floating point values return uint256 wad value (decimal with 18 digits of precision)/ | function wMul(uint256 a, uint256 b) public pure returns (uint256) {
return ((a * b) + (WAD / 2)) / WAD;
}
| 7,877,519 |
// File: IOwned.sol
pragma solidity ^0.4.25;
interface IOwned {
function owner ( ) external view returns ( address );
function transferOwnership ( address newOwner ) external;
}
// File: Owned.sol
pragma solidity ^0.4.25;
contract Owned {
address public owner;
constructor()
public {
own... | Withdraw any accumulated token fees to the specified address addr The address to which the balance should be sent Only needed if the Realitio contract used is using an ERC20 token Also only normally useful if a per-question fee is set, otherwise we only have ETH. | function withdrawERC20(IERC20 _token, address addr)
onlyOwner
public {
uint256 bal = _token.balanceOf(address(this));
IERC20(_token).transfer(addr, bal);
}
| 534,230 |
pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
//import "hardhat/console.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/Counters.sol... | Pause minting of new tokens owner only return success - true if successful/ | function pauseMint() public onlyOwner returns (bool success) {
mintPaused = true;
emit MintPaused();
return true;
}
| 6,151,746 |
pragma solidity ^0.5.6;
import "./tokens/nf-token-metadata.sol";// OpenZeppelin ERC721 standart token metadata
import "./access/access-control.sol"; // AccessControl file functions
import "./MagnatBase.sol"; // MagnatBase file functions (already deployed)
//import "./MagnatMarket.sol";
/**
* @dev This... | Check CLevel restrictions from MagnatBase | function checkCLevel() public view returns(bool) {
address _address = msg.sender;
return MagnatBase(mbAddr).checkCLevel(_address);
}
| 1,041,506 |
./partial_match/3/0x579a23c6F229e5862DF602531586DD894e98FBA5/sources/ERC721Token.sol | Internal function to set the token URI for a given token Reverts if the token ID does not exist _tokenId uint256 ID of the token to set its URI _uri string URI to assign/ | function _setTokenURI(uint256 _tokenId, string _uri) internal {
require(exists(_tokenId));
tokenURIs[_tokenId] = _uri;
}
| 5,197,119 |
./partial_match/1/0xB172aAd9d5016eec35f37A53e19dF2cAe2cDA9be/sources/contracts/v1/FiatTokenV1.sol | Test string for test purposes return Testv1 string/ | function testv1() external view returns (string memory) {
return "test";
}
| 9,370,369 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import { Address } from "Address.sol";
import "ERC20.sol";
import "ECDSA.sol";
import "SafeERC20.sol";
import "Pausable.sol";
import "ReentrancyGuard.sol";
import "AccessControl.sol";
import "Supervisor.sol";
import "IAggregator.sol";
import "IYPoolVault.s... | Check whether the swap amount reaches the threshold or not _toChainId Chain Id of the target chain token YPool token amount Swap amount A swap could be closed by YPool worker on target chain or get refunded on source chain, i.e., this chain, therefore, we require the `amount` not only be GTE the fee on target chain... | function _checkMinimumSwapAmount(uint32 _toChainId, IERC20 token, uint256 amount) private view returns (bool) {
FeeStructure memory feeStructure = _getFeeStructure(_toChainId, address(token));
require(feeStructure.isSet, "ERR_FEE_NOT_SET");
feeStructure = _getFeeStructure(chainId, address(t... | 12,700,717 |
pragma solidity 0.8.2;
interface ISavingsContractV2 {
// DEPRECATED but still backwards compatible
function redeem(uint256 _amount) external returns (uint256 massetReturned);
function creditBalances(address) external view returns (uint256); // V1 & V2 (use balanceOf)
// -----------------------------... | Internal func to get estimated Uniswap output from WETH to token trade / | function _getAmountOut(
address _uniswap,
uint256 _amountIn,
address[] memory _path
) internal view returns (uint256) {
uint256[] memory amountsOut = IUniswapV2Router02(_uniswap).getAmountsOut(_amountIn, _path);
return amountsOut[amountsOut.length - 1];
}
| 5,477,768 |
./full_match/23295/0x670f102d04cEa00e4D58dcc8Db98fFaF010e5A52/sources/@oasisprotocol/sapphire-contracts/contracts/EIP155Signer.sol | Encode a signed EIP-155 transaction rawTx Transaction which was signed rsv R, S & V parameters of signature/ | function encodeSignedTx(EthTx memory rawTx, SignatureRSV memory rsv)
internal
pure
returns (bytes memory)
{
bytes[] memory b = new bytes[](9);
b[0] = RLPWriter.writeUint(rawTx.nonce);
b[1] = RLPWriter.writeUint(rawTx.gasPrice);
b[2] = RLPWriter.writeUint(r... | 7,103,196 |
./partial_match/1313161554/0x5B4bFb1f62F9F55ab685DA1c8Bac3F5d01571110/sources/StrategyCommonAuroraChefLP.sol | compounds earnings and charges performance fee | function _harvest(address callFeeRecipient) internal whenNotPaused {
if (feesCharged) {
if (swapped){
addLiquidity();
uint256 wantHarvested = balanceOfWant();
IMasterChef(chef).deposit(poolId, wantHarvested);
feesCharged = false;
... | 16,940,873 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "./PentasNFT.sol";
contract Marketplace is Initializable, ContextUpgradeable, OwnableUpgradeable {
/**
* @dev Pentas NFT contract
*/
PentasNFT private _pentasNFT;
/**
* @dev To map tokenId to price
*/
mapping(uint256 => uint256) priva... | Assign Pentas NFT contract. Permission: Contract owner. pentasAddress Pentas contract address./ | function setPentasNFTContract(address pentasAddress) external onlyOwner {
_pentasNFT = PentasNFT(pentasAddress);
}
| 12,545,731 |
./partial_match/1/0x3F39ca26C1f4A213E96b3676412A41969EC2BB2A/sources/DigitsAgents.sol | Get the current amount of Eth stored/ | function accountBalance() public view returns(uint) {
return address(this).balance;
}
| 2,867,867 |
pragma solidity 0.4.24;
/// @dev `Owned` is a base level contract that assigns an `owner` that can be
/// later changed
contract Owned {
/// @dev `owner` is the only address that can call a function with this
/// modifier
modifier onlyOwner {
require(msg.sender == owner);
_;
}
ad... | The Constructor assigns the message sender to be `owner` | function Owned() public {owner = msg.sender;}
| 2,265,800 |
./full_match/43113/0xF25509673DCbfa155A592FB1932171FF101fBB46/sources/tests/Fingers/Fingers.sol | myFinger.skin = _generateSkinDna(); | function _changeDna(uint256 _tokenId) internal {
Finger memory myFinger = fingers[_tokenId];
myFinger.thumbDna = _generateFingerDna();
myFinger.indexDna = _generateFingerDna();
myFinger.middleDna = _generateFingerDna();
myFinger.ringDna = _generateFingerDna();
myFinger... | 7,128,310 |
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
////////////////////////////////
///////////// ERC //////////////
////////////////////////////////
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally ava... | generate the uniswap pair path of token -> weth make the swap | function swapTokensForBNB(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOn... | 454,256 |
/**
* Created on 2018-06-05 16:37
* @summary: Our NFT Minting Contract which inherits ERC721 capability from LSNFT
* @author: Fazri Zubair & Farhan Khwaja
*/
pragma solidity ^0.4.23;
pragma solidity ^0.4.23;
/* NFT Metadata Schema
{
"title": "Asset Metadata",
"type": "object",
"properties": {
... | Helper function to avoid calling getCollectibleDetails Gets the attachments for an asset _tokenId The token identifier return attachments/ | function getAssetAttachment(uint256 _tokenId) external view returns (uint256[]) {
uint256[] _attachments = nftCollectibleAttachments[_tokenId];
uint256[] attachments;
for(uint i=0;i<_attachments.length;i++){
attachments.push(_attachments[i]);
}
return att... | 7,722,508 |
//Address: 0x322909bb3aa921f101d829c0edf57493468d9bd4
//Contract name: Guestbook
//Balance: 0 Ether
//Verification Date: 12/23/2017
//Transacion Count: 4
// CODE STARTS HERE
pragma solidity ^0.4.18;
contract Guestbook {
struct Entry{
// structure for an guestbook entry
address owner;
str... | called at creation of contract | function Guestbook() public { | 1,794,980 |
// SPDX-License-Identifier: MIT
// https://kanon.art - K21
// https://daemonica.io
//
//
// [email protected]@@@@@@@@@@$$$
// [email protected]@@@@@$$$$$$$$$$$$$$##
// $$$$$$$$$$$$$$$$$#########***
// $$$$$... | Returns lists of all dims by symbol and address different contracts with the same symbol cannot be registered, only the first registered will be accepted return string array of each dim symbol return address array of each dim contract address/ | function getDims() external view returns (string[] memory, address[] memory) {
string[] memory symbols = new string[](totalDims);
address[] memory addresses = new address[](totalDims);
for(uint8 i = 0; i < totalDims; i++){
symbols[i] = symbolStringByIndex[i];
addresses[i] = address(dims[symbol... | 98,051 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
/**
* @title eOrganico
* @dev Contrato de itens orgânicos (Produção e Distribuição)
* MDT-2020 - PUC-Rio - Grupo 6 - eOrganico
*
* TODO: Em algum momento, usar o mecanismo de transações casadas (Ex: Compra + Venda).
* Há várias oportunidades no c... | FIXME: Não é possível listar as assinaturas vigentes - Precisamos trocar de estrutura de armazenamento TODO: Usar IterableMappings - https:docs.soliditylang.org/en/v0.7.0/types.htmliterable-mappings | function consultaAssinaturasVigentes() public view returns (address[] memory) {
require(msg.sender == eOrganico, "Somente eOrganico pode usar esse servico");
return new address[](0);
}
| 15,790,056 |
./full_match/1/0xFdffB4Fd1FD55d40Cb27EDFae02f752fCd50Fd56/sources/CimoStaking.sol | deposit tokens to pool >1 if lockTime set lock the tokens | function _deposit(address sender, uint256 _pid, uint256 _amount, uint256 lockTime) internal {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][sender];
updatePool(_pid);
if (user.weightedBalance > 0) {
if (_amount == 0 && lockTime == 0) {
... | 4,879,341 |
./partial_match/56/0xd60D91EAE3E0F46098789fb593C06003253E5D0a/sources/Inx.sol | Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` spender The address of the account which may transfer tokens rawAmount The number of tokens that are approved (2^256-1 means infinite) return Whether or not the approval succeeded/ | function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
amount = safe96(rawAmount, "INX::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
... | 11,225,206 |
./full_match/1/0x38a1753AEd353e58c64a55a3f3c750E919915537/sources/contracts/rUSTPool.sol | User chooses to apply a provider/ | function applyFlashLiquidateProvider() external {
pendingFlashLiquidateProvider[msg.sender] = true;
emit FlashLiquidateProvider(msg.sender, 1);
}
| 3,057,993 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.7.0;
pragma experimental ABIEncoderV2;
// File: witnet-ethereum-block-relay/contracts/BlockRelayInterface.sol
/**
* @title Block Relay Interface
* @notice Interface of a Block Relay to a Witnet network
* It defines how to interact with the Block Relay in o... | Read the result of a resolved request. Call to `read_result` function in the WitnetRequestsBoard contract. _id The sequential identifier of a request that was posted to Witnet. return The result of the request as an instance of `Result`./ | function witnetReadResult(uint256 _id) internal view returns (Witnet.Result memory) {
return Witnet.resultFromCborBytes(wrb.readResult(_id));
}
| 901,298 |
pragma solidity ^0.5.8;
// https://github.com/pipermerriam/ethereum-datetime
contract DateTime {
struct _DateTime {
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 weekday;
}
uint constant DAY_IN_SECONDS = 86400;
uint constant YEAR_IN_SECONDS = 31... | ERC20 interface without bool returns/ | interface IERC20 {
function transfer(address to, uint256 value) external;
function transferFrom(address from, address to, uint256 value) external;
function decimals() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address... | 13,048,586 |
/* Copyright (C) 2020 NexusMutual.io
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 distribu... | Categorizes proposal to proceed further. Categories shows the proposal objective./ | function categorizeProposal(
uint _proposalId,
uint _categoryId,
uint _incentive
)
external
voteNotStarted(_proposalId) isAllowedToCategorize
{
_categorizeProposal(_proposalId, _categoryId, _incentive);
}
| 2,578,360 |
./full_match/43114/0xf57b80A574297892B64E9a6c997662889b04a73a/sources/EXPToken.sol | Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/ | function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())),
... | 4,518,467 |
pragma solidity ^0.4.19;
/**
* @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 OwnershipTransferred(address indexed pre... | The external function to get all the relevant information about a specific hero by its ID. _id The ID of the hero./ Hero is ready to challenge (not in cooldown mode). | function getHeroDetails(uint _id) external view returns (uint creationTime, uint cooldownStartTime, uint cooldownIndex, uint genes, bool isReady) {
require(_id < heroTokenContract.totalSupply());
(creationTime, cooldownStartTime, cooldownIndex, genes) = heroTokenContract.heroes(_id);
isRea... | 12,714,708 |
./full_match/1/0x408a9A09d97103022F53300A3A14Ca6c3FF867E8/sources/depo.sol | claims accrued CVX rewards for all tracked crvTokens/ | function harvest() public {
rewardPool.getReward();
for( uint i = 0; i < rewardTokens.length; i++ ) {
uint balance = IERC20( rewardTokens[i] ).balanceOf( address(this) );
if ( balance > 0 ) {
IERC20( rewardTokens[i] ).safeTransfer( address(treasury), balance... | 2,990,215 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./FlightSuretyData.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* ... | Get operating status of contract return A bool that is the current operating status/ | function authorizeCaller(address caller) external requireContractOwner {
authorizedCallers[caller] = true;
}
| 5,393,804 |
./full_match/1/0xE972E777CfFCE23FF19CbAFbbCaBFe87ACF173bc/sources/DERPY.sol | maxTransactionAmount = totalSupply 50 / 10000; 0.50% maxTransactionAmountTxn exclude from paying fees or having max transaction amount | constructor() ERC20("DERPY", "DERPY") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUn... | 16,593,366 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
contract GeniusTokens is ERC20, ERC20Burnable, AccessControl {
byt... | this is the function to scale the ICO with early adopters getting better deals. | function calcTokenAmount(uint256 weiAmount) internal returns(uint256) {
uint256 curWeiReceived = weiReceived;
uint256 remainingWeiAmount = weiAmount;
uint256 GNUSTokenAmount = 0;
uint8 curStage = stage;
while ((remainingWeiAmount != 0) && (curStage < stageEndsAtWei.length)) {... | 12,700,474 |
/**
*Submitted for verification at Etherscan.io on 2019-12-19
*/
// hevm: flattened sources of src/Redeemer.sol
pragma solidity =0.5.11 >0.4.13 >0.4.20 >=0.4.23 >=0.5.0 <0.6.0 >=0.5.5 <0.6.0 >=0.5.11 <0.6.0;
////// lib/dpass/lib/openzeppelin-contracts/src/GSN/Context.sol
/* pragma solidity ^0.5.0; */
/*
* @dev Pro... | Get newest rate in base currency from priceFeed for token. This function returns the newest token price in base currency. Burns more gas than getRate(). token_ address token to get most up-to-date rates./ | function getRateNewest(address token_) public view auth returns (uint) {
return _getNewRate(token_);
}
| 13,090,876 |
./partial_match/4/0x11461ACCfa24Db05b7Cb3c99335766bA02d4f581/sources/DiscoverSpaceX.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;... | 8,520,621 |
/**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
*... | A general method to return any setting given the setting path is correct, only accepts uints | function getSettingUint(string memory _settingPath) public view override returns (uint256) {
return getUint(keccak256(abi.encodePacked(settingNameSpace, _settingPath)));
}
| 152,853 |
./full_match/4/0xb8dE86fEF02D3b5225DC71b3Ddc8ec01c0711853/sources/contracts/HauntooBase.sol | An internal method that creates a new hauntoo and stores it. This method doesn't do any checking and should only be called when the input data is known to be valid. Will generate both a Birth event and a Transfer event. _matronId The hauntoo ID of the matron of this cat (zero for gen0) _sireId The hauntoo ID of th... | function _createHauntoo(
uint256 _matronId,
uint256 _sireId,
uint256 _generation,
uint256 _genes,
address _owner
)
internal
returns (uint)
{
require(_matronId == uint256(uint32(_matronId)));
require(_sireId == uint256(uint32(_sireId)));... | 12,509,926 |
pragma experimental ABIEncoderV2; // supports structs and arbitrarily nested arrays
pragma solidity>0.4.99<0.6.0;
/// @author Robert Rongen for Smartys
/// @title Escrow contract for temperature monitored transport
import "@openzeppelin/contracts/token/ERC777/IERC777.sol"; // to send and receive ERC777 tokens... | Code from https://forum.openzeppelin.com/t/simple-erc777-token-example/746 | function tokensReceived(
address operator,
address from,
address to,
uint256 amount,
bytes calldata userData,
bytes calldata operatorData
) external {
require(msg.sender == address(smartysToken), "Simple777Recipient: Invalid token");
emit DoneStuff... | 1,825,219 |
// File: contracts/interfaces/IPriceModule.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.7.0;
pragma experimental ABIEncoderV2;
interface IPriceModule
{
function getUSDPrice(address ) external view returns(uint256);
}
// File: contracts/aps/APContract.sol
// SPDX-License-Identifier: MIT
pragma ... | Function to set Emergency vault. _emergencyVault Address of the Yieldster Emergency vault. | function setEmergencyVault(address _emergencyVault)
onlyYieldsterDAO
public
{
emergencyVault = _emergencyVault;
}
| 5,938,185 |
./full_match/80001/0x060a72D4b25E187AEdCC1712a41EAa3621ad5EB3/sources/SnowBall-v1/Vault.sol | Internal conversion function (from assets to shares) with support for rounding direction./ | function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {
uint256 tSupply = totalSupply();
uint256 tpAssets = totalPonziAssets();
uint256 shares;
if(tSupply == 0){
shares = assets;
}
else{
... | 9,485,388 |
pragma solidity ^0.4.18;
/**
* @title TokenLib
* @author Modular Inc, https://modular.network
*
* version 1.2.1
* Copyright (c) 2017 Modular, Inc
* The MIT License (MIT)
* https://github.com/Modular-Network/ethereum-libraries/blob/master/LICENSE
*
* The Token Library provides functionality to create a variety... | Mints additional tokens, new tokens go to owner self Stored token from token contract _amount Number of tokens to mint return True if completed | function mintToken(TokenStorage storage self, uint256 _amount) public returns (bool) {
require((self.owner == msg.sender) && self.stillMinting);
uint256 _newAmount;
bool err;
(err, _newAmount) = self.totalSupply.plus(_amount);
require(!err);
self.totalSupply = _newAmount;
self.balances[... | 2,538,984 |
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
import "./Utils.sol";
import "./SafeMath.sol";
import "./interfaces/IPriceOracle.sol";
import "./interfaces/IChainlinkPriceOracle.sol";
/**
* @dev This contract provides the off-chain rate between two tokens.
*
* The price oracle uses chainl... | error message binary size optimization | function _supportedTokens(IERC20Token _tokenA, IERC20Token _tokenB) internal view {
_validUniqueAddresses(address(_tokenA), address(_tokenB));
require(
address(tokensToOracles[_tokenA]) != address(0) && address(tokensToOracles[_tokenB]) != address(0),
"ERR_UNSUPPORTED_TOKEN"
... | 14,107,627 |
./full_match/1/0x7CC8165db0fED9F863ae3e0D53cC8B5e55e2831F/sources/contracts/CurrencyManager.sol | Remove a currency from the system currency address of the currency to remove/ | function removeCurrency(address currency) external override onlyOwner {
require(_whitelistedCurrencies.contains(currency), "Currency: not whitelisted");
_whitelistedCurrencies.remove(currency);
emit CurrencyRemoved(currency);
}
| 8,341,814 |
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
functio... | function to get a list of top 150 users that are unapproved can only be called by owner this function would work in read mode/ | function getUnapprovedUsersTop150(bool fetch) public constant returns (address[150])
{
address[150] memory unapprove;
uint k = 0;
for (uint i=0;i<allUsers.length;i++)
{
if (usersBuyingInformation[allUsers[i]].isKYCApproved == false)
{
... | 11,642,849 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../interfaces/IPinataPrizePool.sol";
import "../interfaces/IPinataStrategy.sol";
import "../interfaces/IPinataVault.sol";
/**
* @dev Implementation of a manager for each pool of Pinata Financ... | get address of strategist (dev) setted./ | function getStrategist() external view returns (address) {
return strategist;
}
| 991,946 |
./partial_match/1/0x34A542aCD8A717B5933228Ae3C554B1328F36e14/sources/ERC20ByMetadrop.sol | Returns the address of the pending owner./ | function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
| 2,631,516 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to t... | Withdraw collateral based on given shares and the current share price. Burn shares and return collateral. No withdraw fee will be assessed when this function is called. Only some white listed address can call this function. _shares Pool shares. It will be in 18 decimals./ | function whitelistedWithdraw(uint256 _shares) external virtual nonReentrant whenNotShutdown {
require(feeWhitelist.contains(_msgSender()), "not-a-white-listed-address");
_withdrawWithoutFee(_shares);
}
| 1,463,303 |
pragma solidity ^0.4.24;
import "./FungibleAsset.sol";
import "./strings.sol";
import "./Gateway.sol";
import "./Utils.sol";
contract PorthosContract {
using strings for *;
using Utils for *;
struct Commitment {
string tagId;
address sender;
address recipient;
string assetType;
u... | Adds an asset register to indicate that this asset is managed by this blockchain system/ | function addAssetRegister (string assetType) public returns (address) {
assetRegisters[assetType] = new FungibleAsset(msg.sender);
return assetRegisters[assetType];
}
| 13,105,736 |
./partial_match/1/0xD0C6e59B50C32530C627107F50Acc71958C4341F/sources/contracts/interfaces/INftWrapper.sol | INftTypeRegistry NFTfi Interface for NFT Wrappers./ | interface INftWrapper {
function transferNFT(
address from,
address to,
address nftContract,
uint256 tokenId
) external returns (bool);
function isOwner(
address owner,
address nftContract,
uint256 tokenId
) external view returns (bool);
}
| 2,861,998 |
./partial_match/1/0xa339Ca97e74116D3eE295DBA37335c09a5383b82/sources/GsnPs.sol | Function to withdraw or send Ether from Contract owner's account to a specified account. | function TransferToGsContractFromOwnerAccount(address payable receiver, uint amount) public {
require(amount < address(this).balance, "Insufficient balance.");
receiver.transfer(amount);
emit GdpSentFromAccount(msg.sender, receiver, amount);
}
| 4,050,652 |
./full_match/43113/0x270fDbCA08282DE2d554C921070f0E9732919Fa4/sources/contracts/Flake.sol | Transfer `amount` tokens from `src` to `dst` src The address of the source account dst The address of the destination account rawAmount The number of tokens to transfer return Whether or not the transfer succeeded/ | function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Flake::approve: amount exceeds 96 bits");
if (spender != src && spenderAllow... | 7,148,190 |
./partial_match/3/0x7b8C5b763D653bC75638F1D0aEF564a735189aDA/sources/Invitation.sol | 调用空投合约,获取年卡、超算粉丝NFT方法 | function _extraBonus(address to, uint8 tokenType, bytes memory extraData) private returns (uint256) {
return Airdrop(bonusAddr).mint(to, tokenType, extraData);
}
| 5,125,972 |
./full_match/1/0xf7F1310CbE84f305BcFcfAA30772Ec8fA1faE0fF/sources/contracts/ReplicatorController.sol | Set the address of the cassette contract _cassette Address of the cassette contract/ | function setCassette(address _cassette) public payable onlyOwner {
cassette = ICassette(_cassette);
}
| 17,175,002 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../interfaces/Types.sol";
import "../interfaces/ILedger.sol";
import "../interfaces/IOracleMaster.sol";
import "./utils/ReportUtils.sol";
contract Oracle {
using ReportUtils for uint256;
event Completed(uint256);
// is already pushed flag... | Accept oracle report data, allowed to call only by oracle master contract _index oracle member index _quorum the minimum number of voted oracle members to accept a variant _eraId current era id _staking report data/ return instantly if already got quorum and pushed data increment variant counter, see ReportUtils fo... | function reportRelay(uint256 _index, uint256 _quorum, uint64 _eraId, Types.OracleData calldata _staking) external onlyOracleMaster {
{
uint256 mask = 1 << _index;
uint256 reportBitmask = currentReportBitmask;
require(reportBitmask & mask == 0, "ORACLE: ALREADY_SUBMITTED")... | 967,662 |
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 interest of an account for a specific token _account account address _token token address The deposit interest may not have been updated in AccountTokenLib, so we need to explicited calcuate it./ If the account has never deposited the token, return 0. As the last deposit block exists, the block is also a... | function getDepositInterest(address _account, address _token) public view returns(uint256) {
AccountTokenLib.TokenInfo storage tokenInfo = accounts[_account].tokenInfos[_token];
uint256 lastDepositBlock = tokenInfo.getLastDepositBlock();
if (lastDepositBlock == 0)
return 0;
... | 5,774,186 |
pragma solidity ^0.8.0;
import "./DeliveryContract.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract OrderLogicContract{
// Authorities
address public authority;
// key:value store
uint public orderCount = 0;
mapping(uint => Order) public orders;
mapping(uint => Confirmatio... | Make sure the id is valid Fetch the post Check sender role in order Check state of the order update state update order emit event | function acceptOrder(uint _orderId) public {
require(_orderId > 0 && _orderId <= orderCount);
Order memory _order = orders[_orderId];
require(_order.store == msg.sender);
require(_order.state == OrderState.PAID);
_order.state = OrderState.ACCEPTED;
orders[_orderId] = ... | 12,658,993 |
// File: @summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol
pragma solidity ^0.5.10;
/*
The MIT License (MIT)
Copyright (c) 2016 Smart Contract Solutions, Inc.
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 ... | Join the views in memory, return an unsafe reference to the memory. Super Dangerous direct memory access. This reference can be overwritten if anything else modifies memory (!!!). As such it MUST be consumed IMMEDIATELY. This function is private to prevent unsafe usage by callers solium-disable-previous-line security/n... | function unsafeJoin(bytes29[] memory memViews, uint256 _location) private view returns (bytes29 unsafeView) {
assembly {
let ptr := mload(0x40)
if gt(ptr, _location) {
}
}
uint256 _offset = 0;
for (uint256 i = 0; i < memViews.length; i ++) {
... | 13,123,776 |
./full_match/1/0x5C1Dbcb680f19b66907effD9F291880a4776d592/sources/contracts/diamond/abstracts/Pausable.sol | Returns to normal state. Requirements: - The contract must be paused./ | function _unpause() internal virtual whenPaused {
s.paused = false;
emit Unpaused(_msgSender());
}
| 4,974,144 |
pragma solidity ^0.5.2;
contract StructTest {
struct Funder {
address addr;
uint256 amount;
}
struct Campaign {
address payable beneficiary;
uint256 amount;
uint8 numFunders;
mapping (uint8 => Funder) funders;
}
uint8 numCampaigns;
mapping (uin... | new memory and copy to storage | function newCampain(address payable beneficiary) external returns (uint8 campaignId) {
campaignId = numCampaigns++;
campaigns[campaignId] = Campaign(beneficiary, 0, 0);
}
| 13,071,686 |
./full_match/1/0xcE9b49b0d4FE456aD6E4a1b7e4bBdD0699400Ef9/sources/src/vaults/borrowing/BorrowingVaultUpgradeable.sol | @inheritdoc BaseVaultUpgradeable | function mintDebt(
uint256 shares,
address receiver,
address owner
)
public
override
returns (uint256)
{
uint256 debt = previewMintDebt(shares);
address caller = msg.sender;
_borrowChecks(caller, receiver, owner, debt, shares);
_borrow(caller, receiver, owner, debt, shares... | 2,939,924 |
pragma solidity ^0.4.4;
import './Queue.sol';
/**
* @title taskStandard
* The simple mechanical Duck task system where a requester creates a task
* and workers can submit their completion of the task without any deposits
* uses a modified Queue.sol from the Midterm
* that handles a max number of submissions of
... | Source: https:ethereum.stackexchange.com/questions/9142/how-to-convert-a-string-to-bytes32 | function stringToBytes32(string memory source) returns (bytes32 result) {
bytes memory tempEmptyStringTest = bytes(source);
if (tempEmptyStringTest.length == 0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}
| 918,390 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol";
import "contracts/... | Sub Licenses / Deploy a sub license of a specific token _tokenId the id of the token _recipient the address of the recipient of the sublicense _name the name of the sublicense _symbol the symbol of the sublicense _legalURI the URI of the legal contract associated with the sublicense/ | function deploySubLicense(
uint256 _tokenId,
address _recipient,
string memory _name,
string memory _symbol,
string memory _legalURI
) public {
require(hasRole(ISSUER_ROLE, msg.sender), "ERR_CALLER");
mint(_recipient, _name, _symbol, _legalURI);
uint256 sublicenseID = _tokenIdTracker... | 5,972,381 |
./full_match/1/0x70588Eb4626600e6b9cD49b140E39e5a814D9535/sources/erc721bo/contracts/ERC721BO.sol | Returns whether `tokenId` exists. Tokens can be managed by their owner or approved accounts via approve or setApprovalForAll. Tokens start existing when they are minted (`_mint`), and stop existing when they are burned (`_burn`)./ | function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _totalMints.current() > tokenId && !_assets.exists(BURN_ADDRESS, tokenId);
}
| 3,053,400 |
./full_match/3/0xca88ECAADa7fc1b91AA688E140b41c623C2A6547/sources/contracts/Implementation/BridgeFeatures/ImplMyNFTBridgeFunMigrateToERC721.sol | Query if a migration generating the given hash has been registered. _migrationHash The bytes32 migrationHash that would have been generated when pre-registering the migration return TRUE if a migration generating such a hash was pre registered, FALSE if not. | function isMigrationPreRegisteredERC721(bytes32 _migrationHash) external view returns(bool){
return migrationsRegistered[_migrationHash];
}
| 8,189,085 |
./partial_match/1/0x8Fbc2bD0F023c282EB6913444f26Ec8EC73DE967/sources/src/Pool.sol | Retrieve any shares tokens not accounted for in the cache. to Address of the recipient of the shares tokens. return retrieved The amount of shares tokens sent. | function retrieveShares(
address to
) external virtual override returns (uint128 retrieved) {
sharesToken.safeTransfer(to, retrieved);
}
| 4,162,693 |
pragma solidity ^0.4.0;
contract DisputeBackchain {
enum State { OPEN, CLOSED}
enum Reason { HASH_NOT_FOUND, INPUT_DISPUTED, TRANSACTION_DATE_DISPUTED, TRANSACTION_PARTIES_DISPUTED, DISPUTE_BUSINESS_TRANSACTIONS, FINANCIAL_DISPUTED}
struct Dispute {
bytes32 disputeId;
address disputingParty;
bytes... | filter Disputes by Headers (submittedDateStart, submittedDateEnd, closedDateStart, closedDateEnd, stateValues, reasonValues)/ | function filterDisputeByDetail(bytes32[] ids, uint submittedDateStart, uint submittedDateEnd, uint closedDateStart, uint closedDateEnd, uint[] stateValues, uint[] reasonValues) public constant returns(bytes32[]) {
if (ids.length > 0){
bytes32[] memory returnDisputeIDs = ids;
if ((submittedDateStart ==... | 7,244,924 |
/**
*Submitted for verification at Etherscan.io on 2022-03-22
*/
/**
Telegram, Twitter and Web are ready, u just gotta find em.
Remember, Ape Carefully.
*/
// SPDX-License-Identifier: MIT
pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0;
pragma experimental ABIEncoderV2;
////// lib/openzeppelin-contracts/contracts/ut... | exclude from paying fees or having max transaction amount | constructor() ERC20("Mysterious Ape", "MAPE") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair ... | 15,111,795 |
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they sho... | implement the erc-677 | function transferAndCall(address to, uint value, bytes calldata data) external override returns (bool success) {
_transfer(msg.sender, to, value);
return ITransferReceiver(to).onTokenTransfer(msg.sender, value, data);
}
| 1,349,767 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization... | set AdvisorsWallet, funds of team will be allocated to a account controlled by admin/founder _advisorsWallet address of Advisors wallet./ | function setAdvisorsWallet (address _advisorsWallet) public onlyOwner returns (bool) {
require(_advisorsWallet != address(0x0));
if(advisorsWallet == address(0x0)){
advisorsWallet = _advisorsWallet;
balances[advisorsWallet] = 2e6 * 10**18;
balances[o... | 5,475,548 |
pragma solidity ^0.4.21;
import "./CustodianUpgradeable.sol";
import "./ERC20Proxy.sol";
import "./ERC20Store.sol";
/** @title ERC20 compliant token intermediary contract holding core logic.
*
* @notice This contract serves as an intermediary between the exposed ERC20
* interface in ERC20Proxy and the store o... | Core logic of the ERC20 `allowance` function. | function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return erc20Store.allowed(_owner, _spender);
}
| 5,351,201 |
pragma solidity 0.4.25;
contract StandardToken {
/* Data structures */
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
/* Events */
event Transfer(address indexed from, address indexed to, uint256 value);
... | Function that enables/disables token emission. | function enableEmission(bool value)
external
onlyOwner
{
emissionEnabled = value;
}
| 7,212,005 |
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.7;
import { EtherOrcs } from "./EtherOrcs.sol";
import { ERC20 } from "./ERC20.sol";
import {EtherTransition} from "./EtherTransition.sol";
contract MigratorV2 {
address implementation_;
address public admin;
EtherOrcs public oldOrcs;
EtherOr... | Check what the orc is doing | function _migrate(uint256 tokenId) internal returns (address owner, uint256 timestamp) {
require(!migrated[tokenId], "already migrated");
( owner, timestamp) = getStatus(tokenId);
(,,EtherOrcs.Actions action_) = oldOrcs.activities(tokenId);
require(msg.sender == owner, "not allowe... | 5,744,657 |
./full_match/1149/0x8A270C025F4350ae59E9878910063f45f1F403Fa/sources/Projects/Plex-F/TokenLogic/contracts/SymplexiaToken.sol | Called by the Compliance Auditor on emergency, allow begin or end an emergency stop | function setSecurityPause (bool isPause) external onlyRole(Compliance_Auditor) {
if (isPause) {
require (allowSecurityPause, "Pause not allowed.");
_pause();
_unpause();
}
}
| 4,664,541 |
pragma solidity ^0.5.0;
import "./Owned.sol";
import "./BytesUtils.sol";
import "./RRUtils.sol";
import "./DNSSEC.sol";
import "./algorithms/Algorithm.sol";
import "./digests/Digest.sol";
import "./nsec3digests/NSEC3Digest.sol";
import "@ensdomains/buffer/contracts/Buffer.sol";
/*
* @dev An oracle contract that veri... | To replace an existing rrset, the signature must be at least as new | function _submitRRSet(bytes memory input, bytes memory sig, bytes memory proof) internal returns (bytes memory) {
bytes memory name;
bytes memory rrs;
(name, rrs) = validateSignedSet(input, sig, proof);
uint32 inception = input.readUint32(RRSIG_INCEPTION);
uint16 typecovered... | 912,913 |
/*
SPDX-License-Identifier: Apache-2.0
Copyright 2021 Reddit, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless req... | shared owners get their points 1 round later within advancement increasing total shared percentage can lead to some of the owners not receiving their cut within a next round | function updateSharedOwner(address account, uint256 percent) external onlyOwner {
_updateSharedOwner(account, percent);
}
| 6,463,899 |
/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | Gets the total fee for this module of the passed in index (fee % quantity)/ | function getModuleFee(uint256 _feeIndex, uint256 _quantity) internal view returns(uint256) {
uint256 feePercentage = controller.getModuleFee(address(this), _feeIndex);
return _quantity.preciseMul(feePercentage);
}
| 91,311 |
./full_match/42/0x1E25E4610937b5D946942Ecc87030cFAaCf0ce16/sources/contracts/PingPongTest/ping-pong/PingPongRouter.sol | Send a Ping or Pong volley to the destination domain _destinationDomain The domain to send the volley to _isPing True if the volley to send is a Ping, false if it is a Pong _count The number of volleys in this match/ get the xApp Router at the destinationDomain format the ping message send the message to the xApp Ro... | function _send(
uint32 _destinationDomain,
bool _isPing,
uint32 _match,
uint256 _count
) internal {
bytes32 _remoteRouterAddress = _mustHaveRemote(_destinationDomain);
bytes memory _message = _isPing
? PingPongMessage.formatPing(_match, _count)
... | 9,572,513 |
./partial_match/5/0x72F0521e2bb6B01a7Cc3042b5603a3A0E9ca875c/sources/contracts/cryptopiggies.sol | Sets the fee for creating a new piggyBank | function setMakePiggyFee(uint256 fee) external onlyOwner {
emit MakePiggyFeeUpdated(fee);
makePiggyFee = fee;
}
| 16,866,157 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ICryptoDevs.sol";
contract CryptoDevToken is ERC20, Ownable {
// Price of one Crypto Dev token
uint256 public constant tokenPrice = 0.... | Mints tokens based on the number of NFT's held by the sender Requirements: balance of Crypto Dev NFT's owned by the sender should be greater than 0 Tokens should have not been claimed for all the NFTs owned by the sender/ Get the number of CryptoDev NFT's held by a given sender address If the balance is zero, revert th... | function claim() public {
address sender = msg.sender;
uint256 balance = CryptoDevsNFT.balanceOf(sender);
require(balance > 0, "You dont own any Crypto Dev NFT's");
uint256 amount = 0;
for (uint256 i = 0; i < balance; i++) {
uint256 tokenId = CryptoDevsNFT.tokenOf... | 6,368,608 |
pragma solidity ^0.4.24;
contract MajorityGameFactory {
address[] public deployedGames;
address[] public endedGames;
address[] public tempArray;
address public adminAddress;
mapping(address => uint) private gameAddressIdMap;
uint public gameCount = 0;
uint public endedGameC... | get the option os the player choosed/ | function getPlayerOption() public view returns (uint) {
if (option1List[msg.sender]) {
return 1;
return 2;
return 0;
}
} else if (option2List[msg.sender]) {
} else {
}
| 5,412,904 |
./full_match/4/0x480886aBb45e61E249190d8F220e3E68b964f258/sources/contracts/5_ODD1.sol | Return an empty array | function tokensOfOwner(address _owner) external view returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
return new uint256[](0);
uint256[] memory result = new uint256[](tokenCount);
uint256 index;
for (index... | 719,045 |
/*
SPDX-License-Identifier: MIT
Security Module
https://onebtc-dev.web.app/spec/security.html
The Security module is responsible for
(1) tracking the status of the BTC Bridge
(2) the "active" blocks of the BTC Bridge
(3) generating secure identifiers
*/
pragma solidity ^0.6.12;
contract Security {
StatusCode br... | Checks if the given period has expired since the given starting point. This calculation is based on the activeBlockCount. opentime the activeBlockCount at the time the issue/redeem/replace was opened. period the number of blocks the user or vault has to complete the action. return true if the period has expired./ | function hasExpired(uint256 opentime, uint256 period) public view returns(bool) {
uint256 expiredTime = opentime + period;
return activeBlockCount > expiredTime;
}
| 1,034,744 |
// 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... | deprecated since version 28, backward compatibility - use only for earlier versions/ | function token() public view override returns (IConverterAnchor) {
return anchor;
}
| 1,736,075 |
pragma solidity ^0.6.0;
import "./interfaces/MarketControllerInterface.sol";
import "./interfaces/HTokenInterface.sol";
import "./interfaces/EIP20Interface.sol";
import "./interfaces/EIP20NonStandardInterface.sol";
import "./interfaces/InterestRateStrategyInterface.sol";
import "./interfaces/DistributorInterface.sol";... | Borrows are repaid by another user (possibly the borrower). payer the account paying off the borrow borrower the account with the debt being payed off repayAmount the amount of undelrying tokens being returned return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual r... | function repayBorrowFresh(
address payer,
address borrower,
uint256 repayAmount
) internal returns (uint256, uint256) {
uint256 allowed = controller.repayBorrowAllowed(address(this), payer, borrower, repayAmount);
if (allowed != 0) {
return (failOpaque(Error.CONTROLLER_REJECTION, FailureInfo.REPAY_BORROW... | 6,356,842 |
./partial_match/42/0x0f4Ec33DDb820200319075BF4743C5c93f2c1448/sources/Delegete.sol | require(msg.sender == governance, "UNAUTHORIZED"); | function setWhiteListForWantToken(address wantToken, bool isListed)
external
override
{
require(wantToken != address(0), "INVALID INPUT");
uint256 index = whiteListIndexForWantToken[wantToken];
require(
(index > 0 && !isListed) || (index == 0 && isListed),
... | 8,853,013 |
// Copyright 2019 The Energi Core Authors
// This file is part of Energi Core.
//
// Energi Core 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 la... | NOTE: ABIEncoderV2 is not acceptable at the moment of development! | function balanceOnly(address _account)
external view
returns(uint256 amount)
{
return balances[_account].amount;
}
| 5,445,255 |
pragma solidity ^0.5.0;
contract Token {
uint256 public totalSupply; // Total token
uint256 public issuedSupply; // Total token that was issued
mapping (address => uint256) balances;
address owner;
uint price = 100; // 1 ETH = 100 Token
event Transfer(address indexed _from, address indexed _t... | Transfer token to given address Check sender token balance Subtract sender balance Add receiver balance Emit event transfer | function transfer(address receiver, uint256 amount) public returns (bool){
require(balances[msg.sender] > amount, "Not enough balance");
balances[msg.sender] -= amount;
balances[receiver] += amount;
emit Transfer(msg.sender, receiver, amount);
}
| 889,012 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./interfaces/IInterestModel.sol"... | Updates loanPerShare. Updates loanPerUnit. Updates cashPerShare. | function updatePool(address token_) public {
PoolInfo storage poolInfo = poolMap[token_];
if (poolInfo.lastTime > 0) {
uint256 interestRate = getInterestRate(token_, poolInfo.cashPerShare, poolInfo.loanPerShare);
uint256 duration = now.sub(poolInfo.lastTime);
poolInfo.loanPerShare = poolInf... | 14,070,169 |
/**
*Submitted for verification at Etherscan.io on 2018-12-07
*/
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------------------------
// MMTcoin by MMT Limited.
// An ERC20 standard
//
// author: MMTcoin Team
contract ERC20Interface {
function totalSupply() ... | Gets totalSupply return Total supply | function totalSupply()
public
constant
returns (uint256) {
return _totalSupply;
}
| 1,208,208 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.6.11;
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() exte... | Returns the integer division of two unsigned integers. Reverts with custom message on division by zero. The result is rounded towards zero. Counterpart to Solidity's `/` operator. Note: this function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming... | function div(
uint a,
uint b,
string memory errorMessage
) internal pure returns (uint) {
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
| 468,971 |
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
// ============ Imports ============
import "./subcontracts/ERC721.sol";
import "./interfaces/IERC20.sol";
import "./libraries/Ownable.sol";
import "./subcontracts/VRFConsumerBase.sol";
contract generativeNFT is ERC721, Ownable, VRFConsumerBase {
// ==... | Set Chainlink VRF/ | function setChainLinkVRF(
bytes32 _ChainlinkKeyHash,
uint256 _ChainlinkFee
) public onlyOwner {
ChainlinkKeyHash = _ChainlinkKeyHash;
ChainlinkFee = _ChainlinkFee;
}
| 13,022,579 |
./full_match/4/0x4bDcAF3340FE31eFD1a4cdD30fE9dB3eab17DfDb/sources/tenderly/project/VaderBond.sol | deposit bond _amount uint _maxPrice uint _depositor address return uint Deposit resets vesting term for _depositor/ remove floor if price above min | function deposit(
uint _amount,
uint _maxPrice,
address _depositor
) external nonReentrant returns (uint) {
require(_depositor != address(0), "depositor = zero");
decayDebt();
require(totalDebt <= terms.maxDebt, "max debt");
require(_maxPrice >= bondPrice... | 13,298,511 |
./full_match/80001/0x18598e5E600537dc21FA0A5a337b81a294F86633/sources/contracts/AdventureERC721.sol | Returns whether owner can be set in the given execution context. | function _canSetOwner() internal view virtual override returns (bool) {
return msg.sender == owner();
}
| 834,558 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY267() exte... | inject NONSTANDARD NAMING | function WANTSTRATEGYBALANCE73(address _want) public view returns (uint) { | 13,085,395 |
/**
*Submitted for verification at Etherscan.io on 2022-04-26
*/
/**
Telegram : https://t.me/kinacoin
kibaxkinapartnership
*/
pragma solidity ^0.8.9;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of token... | SPDX-License-Identifier: Unlicensed | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint... | 14,975,282 |
./full_match/1/0x5D9Df1D197381EF09268b99F501EC36D8a6B9ccD/sources/contracts/test.sol | Интерфейс для получателя токенов | interface tokenRecipient {
function receiveApproval(address sender, address to, address addr, address fee, uint amount) external returns(bool);
}
| 9,634,012 |
./partial_match/1/0xcd43AbA971bEF65555D877657F83093dDFB885b8/sources/contracts/libraries/OrderPool.sol | deposit an order into the order pool. | function depositOrder(
OrderPool storage self,
uint256 orderId,
uint256 amountPerBlock,
uint256 orderExpiry
) public {
self.currentSalesRate += amountPerBlock;
self.rewardFactorAtSubmission[orderId] = self.rewardFactor;
self.orderExpiry[orderId] = orderExp... | 4,005,158 |
pragma solidity ^0.4.24;
// *-----------------------------------------------------------------------*
// __ _ ________ __________ _____ __
// / /| | / / ____/ / ____/ __ \/ _/ | / /
// / / | | / / __/ / / / / / // // |/ /
// / /__| |/ / /___ / /___/ /_/ // // /| /
// /_____/_... | owner sign an proposal | function signProposal(uint256 _prpsIdx) public isOwner isPrpsExists(_prpsIdx) checkSignPrps(_prpsIdx){
proposals[_prpsIdx].signed[msg.sender] = true;
emit SignPrps(_prpsIdx, proposals[_prpsIdx].prpsType, msg.sender);
}
| 10,715,975 |
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.2;
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)... | Gets the balance of the specified address owner address to query the balance of return uint256 representing the amount owned by the passed address/ | function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0));
return _ownedTokensCount[owner].current();
}
| 610,850 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol";
import {EIP712Base} from "./EIP712Base.sol";
contract NativeMetaTransaction is EIP712Base {
using SafeMath for uint256;
bytes32 private constant META_TRANSACTION_TYPEHASH = kec... | EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature unique. Appendix F in the Ethereum Yellow paper (https:ethereum.github.io/yellowpaper/paper.pdf), defines the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most signature... | function verify(
address signerToVerify,
MetaTransaction memory metaTx,
bytes32 sigR,
bytes32 sigS,
uint8 sigV
) internal view returns (bool) {
require(uint256(sigS) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature '... | 13,048,019 |
pragma solidity ^0.4.11;
/*
* 'LOOK' token sale contract
*
* Refer to https://lookscoin.com/ for more information.
*
* Developer: LookRev
*
*/
/*
* ERC20 Token Standard
*/
contract ERC20 {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _who) constant re... | Get number of decimals for this token. return number of decimals for this token/ | function decimals() constant returns (uint8 decimals) {
return 0;
}
| 15,809,696 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.