file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0x1A963Df363D01EEBB2816b366d61C917F20e1EbE/sources/src/ComptrollerG7.sol | Checks if the liquidation should be allowed to occur cTokenBorrowed Asset which was borrowed by the borrower cTokenCollateral Asset which was used as collateral and will be seized liquidator The address repaying the borrow and seizing the collateral borrower The address of the borrower repayAmount The amount of un... | function liquidateBorrowAllowed(
address cTokenBorrowed,
address cTokenCollateral,
address liquidator,
address borrower,
uint256 repayAmount
)
external
override
returns (uint256)
{
liquidator;
if (
!markets[cTokenBo... | 2,595,036 |
/**
*Submitted for verification at Etherscan.io on 2021-07-27
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
pragma abicoder v2;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address... | check last token Validate only middle tokens. Skip the first and last token. | function _validatePath(bytes memory _path) internal view {
require(_path.toAddress(_path.length-20) == address(wildToken), "FeeConverter: must convert into WILD");
uint numPools = ((_path.length - 20) / 23);
for (uint8 i = 1; i < numPools; i++) {
address token = _path.toAddress(23*i);
requi... | 10,666,842 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
/**
* @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 returns (uint256);
/**
* @dev Returns the amount of tokens owned by `... | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but performing a static call. _Available since v3.3._/ | function functionStaticCall(address target, bytes memory data)
internal
view
returns (bytes memory)
{
return functionStaticCall(target, data, "Address: low-level static call failed");
}
| 8,014,663 |
./full_match/3/0xc7f7406F5dBfe3E02068C3662073E7Ae8De5dd54/sources/contracts/KiwiLeaks.sol | Sends all the value of the transaction to the owner of the contract | function sendToOwner() private {
require(sent, "Failed to send value");
}
| 8,255,837 |
pragma solidity ^0.4.12;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 ... | event for token purchase logging purchaser who paid for the tokens beneficiary who got the tokens value weis paid for purchase amount amount of tokens purchased/You will change this to your wallet where you need the ETH wallet = 0x5daaAb630673a61f487965f90E13457a74F566D3; durationInMinutes = _durationInMinutes;Here... | function PCNCrowdsale () {
tokenReward = token(address(this));
}
bool public started = true;
| 7,783,538 |
./partial_match/41/0x44DCDe1bEDBB42B0119c22DeF19925fa39965d4c/sources/project_/contracts/cp06/BikeChain_flat.sol | Includes an account from fee. Emits a {IncludeAccountFromFee} event. Requirements: - `account` is excluded in fee./ | function includeAccountInFee(address account) public onlyOwner {
require(_isExcludedFromFee[account], "Account is already included.");
_isExcludedFromFee[account] = false;
emit IncludeAccountInFee(account);
}
| 3,504,219 |
/**
*Submitted for verification at Etherscan.io on 2021-10-11
*/
// File: contracts/lib/InitializableOwnable.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownershi... | =========== admin ==================== advanced ======== | interface IDPP {
function init(
address owner,
address maintainer,
address baseTokenAddress,
address quoteTokenAddress,
uint256 lpFeeRate,
address mtFeeRateModel,
uint256 k,
uint256 i,
bool isOpenTWAP
) external;
function _MT_FEE_RATE_... | 1,983,676 |
// Version of Solidity compiler this program was written for
pragma solidity ^0.5.11;
interface IBEP20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
f... | Play the Lottery game!require(msg.value > 0, "Bet more than 0");require(amount <= address(this).balance - amount, "You cannot bet more than what is available in the Contract balance");require(IERC20(GAME_TOKEN).allowance(address(msg.sender), address(this)) >= amount, "insufficient allowance amount");address(this).balan... | function LotteryGame(uint8 guess, uint256 amount) public payable returns(bool){
require(guess == 0 || guess == 1 || guess == 2 || guess == 3 || guess == 4 || guess == 5 || guess == 6 || guess == 7 || guess == 8 || guess == 9, "Variable 'guess' should be either 0 ('00') or 1 ('01') or 2 ('02') or 3 ('03') or 4 ('0... | 2,542,058 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "./YakERC20.sol";
import "./lib/SafeMath.sol";
import "./lib/Ownable.sol";
import "./interfaces/IERC20.sol";
import "./YakRegistry.sol";
import "./YakStrategy.sol";
/**
* @notice YakVault is a managed vault for `deposit ... | Deposit to currently active strategy Vaults may allow multiple types of tokens to be deposited By default, Vaults send new deposits to the active strategy token address amount amount/ | function deposit(address token, uint amount) external {
_deposit(msg.sender, token, amount);
}
| 1,046,118 |
/**
*Submitted for verification at Etherscan.io on 2020-09-28
*/
/**
*Submitted for verification at Etherscan.io on 2018-09-01
*/
pragma solidity 0.5.8;
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://gith... | Add tokenOwner to Eachable Mapping / Verify if tokenOwner was already added / If Address not present in array of iterable token owners / | function setInitialDistribution(address _address, uint256 _tokenAmount, uint256 _unlockDays) internal onlyOwner whenNotPaused {
bool isAddressPresent = false;
for(uint i = 0; i < tokenOwners.length; i++) {
if(tokenOwners[i] == _address){
isAddressPresent = true;
... | 252,897 |
pragma solidity ^0.5.0;
library safeMath {
/*
* @dev mul for two unsigned integers, reverts on overflow
*/
function emul(uint256 a, uint256 b) internal pure returns(uint256){
if (a == 0){
return 0;
}
uint256 c = a * b;
require(c / a == b);
return... | retunrs balance of particular address _addr The address of the user whos balance need to be checked/ | function balanceOf(address _addr) public view returns (uint) {
return _balanceOf[_addr];
}
| 6,411,663 |
pragma solidity ^0.4.11;
import "SafeMath.sol";
/* The SIFT itself is a simple extension of the ERC20 that allows for granting other SIFT contracts special rights to act on behalf of all transfers. */
contract SmartInvestmentFundToken {
using SafeMath for uint256;
/* Map all our our balances for issued tokens... | Transfer the balance from owner's account to another account / | function transfer(address _to, uint256 _amount) public onlyPayloadSize(2) returns (bool) {
if (balances[msg.sender] < _amount || balances[_to].add(_amount) < balances[_to])
return false;
bool isRecipientNew = balances[_to] < 1;
balances[msg.sender] = balances[msg.sender].sub(_a... | 14,089,855 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner... | Allows to migrate rewards to a new staking contract. | function migrateRewards(address _recipient, uint _amount) external onlyOwner {
rewardToken.transfer(_recipient, _amount);
}
| 1,792,265 |
pragma solidity ^0.4.19;
/*
This contract was created by Jakub Tomeš and is licensed under MIT license
Github: https://github.com/jtomes123/ethtags
*/
/*
A contract that stores data of the main contract.
This allows the main contract to be more easily updated.
*/
contract DogtagsDataStorage {
//Address of the owne... | Sets the address of DataStorageContract this is necessary for the contract to function | function setDataStorageContract(address newContract) public onlyOwner {
data = DogtagsDataStorage(newContract);
}
| 12,579,502 |
pragma solidity ^0.4.18;
library ECRecovery {
/**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*... | Remember you need pre-approval for this - nice with ApproveAndCallwe already have approval so lets do a transferFrom - transfer the tokens into this contract depositedTokens[token] = depositedTokens[token].add(tokens); | function depositTokens(address from, address token, uint256 tokens ) public returns (bool success)
{
if(!ERC20Interface(token).transferFrom(from, this, tokens)) revert();
balances[token][from] = balances[token][from].add(tokens);
Deposit(token, from, tokens, balances[token][from]);
retu... | 10,092,283 |
./full_match/5/0xE9195834385e9C235Ab22b29412951CA637DF3B1/sources/contracts/L1/universal/ProxyAdmin.sol | @custom:legacy Set the upgrading status for the Chugsplash proxy type. _upgrading Whether or not the system is upgrading./ | function setUpgrading(bool _upgrading) external onlyOwner {
upgrading = _upgrading;
}
| 7,090,037 |
pragma solidity ^0.5.16;
import "./interfaces/ICertifier.sol";
import "./interfaces/IKeyGenHistory.sol";
import "./interfaces/IRandomHbbft.sol";
import "./interfaces/IStakingHbbft.sol";
import "./interfaces/ITxPermission.sol";
import "./interfaces/IValidatorSetHbbft.sol";
import "./upgradeability/UpgradeableOwned.sol"... | Removes the specified address from the array of addresses allowed to initiate transactions of any type. Can only be called by the `owner`. See also the `addAllowedSender` function and `allowedSenders` getter. _sender The removed address. | function removeAllowedSender(address _sender)
public
onlyOwner
onlyInitialized {
require(isSenderAllowed[_sender]);
uint256 allowedSendersLength = _allowedSenders.length;
for (uint256 i = 0; i < allowedSendersLength; i++) {
if (_sender == _allowedSenders[i]) {
... | 12,565,788 |
./full_match/1/0x78791997483f25217F4C3FE2a568Fe3eFaf77884/sources/src/DiversifierFactory.sol | create pass-through wallet w {this} as owner & no passThrough parse oracle params for swapper-recipients create split w diversifier (pass-through wallet) as controller | function createDiversifier(CreateDiversifierParams calldata params_) external returns (address diversifier) {
PassThroughWalletImpl passThroughWallet = passThroughWalletFactory.createPassThroughWallet(
);
diversifier = address(passThroughWallet);
OracleImpl oracle = _parseOraclePara... | 9,756,279 |
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) {
if (a == 0) {
return 0;
}
c = ... | Transfers _value amount of tokens from address _from to address _to, and MUST fire the Transfer event. | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0));
require(balances[_from] >= _value);
require(allowed[_from][msg.sender] >= _value);
require(balances[_to] + _value >= balances[_to]);
uint256 previous... | 13,751,303 |
pragma solidity ^0.5.0;
import "../SerialityLib/BytesToTypes.sol";
import "../SerialityLib/TypesToBytes.sol";
import "../SerialityLib/SizeOf.sol";
library ColumnLib {
using BytesToTypes for bytes;
using TypesToBytes for uint256;
using TypesToBytes for bytes32;
struct Column {
bytes32 name;
... | TBD return TBD/ | function decodeColumn(bytes memory _bytes, uint256 offsetStart)
internal
pure
returns (Column memory, uint256)
{
uint256 offset = offsetStart;
Column memory column;
column.name = _bytes.toBytes32(offset);
offset -= 32;
column._dtype = _bytes.toByte... | 2,520,209 |
./partial_match/100/0x87EAde8bcf9f083b9EE1a1f280F0E89BB33CFB31/sources/Competition.sol | getOrderedIndexOfSuggestion return the index of specific suggestion in the winners list. for the case when the suggestion is NOT in the winners list, this method will return topSuggestions.length _suggestionId suggestion id/ get how many elements are greater than a given element/ | function getOrderedIndexOfSuggestion(uint256 _suggestionId)
public
view
returns(uint256 index) {
bytes32 proposalId = suggestions[_suggestionId].proposalId;
require(proposalId != bytes32(0), "suggestion does not exist");
uint256[] memory topSuggestions = proposals[proposalId].top... | 16,671,367 |
// SPDX-License-Identifier: MIT
// Copied and adjusted from OpenZeppelin
// Adjustments:
// - modifications to support ERC-677
// - removed require messages to save space
// - removed unnecessary require statements
// - removed GSN Context
// - upgraded to 0.8 to drop SafeMath
// - let name() and symbol() be implemente... | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to `transfer`, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a `Transfer` event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(recipient != address(0));
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] -= amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);... | 5,378,835 |
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// 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() external ... | This methods evacuates given funds to governance address _token Exact token to evacuate _amount Amount of token to evacuate | function seize(IERC20 _token, uint256 _amount) external onlyGovernance {
require(_token != rewardsToken, "!rewardsToken");
require(_token != governanceToken, "!governanceToken");
_token.safeTransfer(governance, _amount);
}
| 6,919,388 |
/**
* @title SafeMath
* @dev Math operations that are safe for uint256 against overflow and negative values
* @dev https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {... | assign Touch moderator to this contract address assign moderator of this contract to crowdsale manager address send approve from moderator account allowing for 100 million tokens spendable by this contract | function initialize() public onlyModerator {
require(tokenContract.allowance(moderator, address(this)) == 102306549000000000000000000);
active = true;
}
| 4,815,027 |
./full_match/4/0x52Af063278C6489a9deF8b27615Fa813797cDed1/sources/browser/AsyncArt.sol | anyone can grant permission to another address to control tokens on their behalf. Set to Address(0) to reset. | function grantControlPermission(address permissioned) public {
permissionedControllers[msg.sender] = permissioned;
}
| 722,154 |
pragma solidity ^0.6.12;
// ----------------------------------------------------------------------------
// DreamFrames Crowdsale Contract - Purchase FrameRush Tokens with ETH
//
// Deployed to : {TBA}
//
// Enjoy.
//
// (c) BokkyPooBah / Bok Consulting Pty Ltd for GazeCoin 2018. The MIT Licence.
// (c) Adrian Guerrer... | require(_startDate >= now); require(hardCapUsd >= _maxFrames.mul(_frameUsd).div(TENPOW18)); require(softCapUsd <= _maxFrames.mul(frameUsdWithBonus()).div(TENPOW18) ); | function init(address _dreamFramesToken, address _ethUsdPriceFeed, address payable _wallet, uint256 _startDate, uint256 _endDate, uint256 _minFrames, uint256 _maxFrames, uint256 _producerFrames, uint256 _frameUsd, uint256 _bonusOffList, uint256 _hardCapUsd, uint256 _softCapUsd) public {
require(_wallet != addre... | 6,438,224 |
./partial_match/97/0xf677cC91F5DCC9467Ff7bf38030ba8f66Ed85B7c/sources/TestFarm.sol | View function to see pending reward on frontend. | function pendingReward(uint256 _pid, address _user)
external
view
returns (uint256)
{
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accRewardPerShare = pool.accRewardPerShare;
uint256 lpSupply = pool.lpToken... | 11,369,826 |
// SPDX-License-Identifier: MIT
// solhint-disable not-rely-on-time
pragma solidity ^0.8.3;
import "./openzeppelin-solidity/contracts/Math.sol";
import "./openzeppelin-solidity/contracts/SafeMath.sol";
import "./openzeppelin-solidity/contracts/ReentrancyGuard.sol";
import "./openzeppelin-solidity/contracts/ERC20/Safe... | Withdraws all tokens a user has staked for each token class./ | function exit() external override {
stakingToken.setApprovalForAll(msg.sender, true);
getReward();
for (uint i = 0; i < 4; i++)
{
if (balances[msg.sender][i] > 0)
{
_withdraw(msg.sender, balances[msg.sender][i], i.add(1));
}
... | 5,360,666 |
./partial_match/3/0xbf400eD5ec1D707B3EfFb6554F18728880Aae52b/sources/YgfStaking.sol | user can check balance if they unstake now | function balanceOf(address _whom) external view returns (uint256) {
uint256 lastStackTime = lastStack[_whom];
uint256 amount = stakedAmount[_whom];
uint256 _days = safeDiv(safeSub(block.timestamp, lastStackTime), 86400);
uint256 totalReward = 0;
if (_days > ... | 5,130,525 |
pragma solidity 0.4.24;
import "solidity-bytes-utils/contracts/BytesLib.sol";
/// @title Extension to the BytesLib library.
library BytesLibEx {
using BytesLib for bytes;
// Data sizes (in bytes).
uint public constant UINT16_SIZE = 2;
uint public constant UINT32_SIZE = 4;
uint public constant UI... | Converts a big-endian bytes array to a uint64. _bytes bytes The raw buffer. _start uint The offset to start from. | function toUint64BE(bytes memory _bytes, uint _start) internal pure returns (uint64) {
return uint64(toUintBE(_bytes, _start, UINT64_SIZE));
}
| 12,601,154 |
pragma solidity ^0.4.25;
// Use github link in Remix IDE
// import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./Ownable.sol";
/**
* @title RecursiveDeposit
* @dev A gambling contract where you win if you are the last person
* to add into the pot for longer than... | allows the winning address to withdraw their winnings./ | function withdraw() public {
checkCloseBetting();
require(!isOpen, "Nobody has won yet!");
require(msg.sender==mostRecentBetter, "You're not the winner");
msg.sender.transfer(totalPot);
}
| 14,125,488 |
./full_match/97/0x1c4eA5BBC27d20Fd4a7B6aEc21C109fE24eDA9e8/sources/contracts/protocol/libraries/logic/BorrowLogic.sol | Implements the repay feature. Repaying transfers the underlying back to the aToken and clears the equivalent amount of debt for the user by burning the corresponding debt token. For isolated positions, it also reduces the isolated debt. Emits the `Repay()` event reservesData The state of all the reserves reservesLi... | function executeRepay(
mapping(address => DataTypes.ReserveData) storage reservesData,
mapping(uint256 => address) storage reservesList,
DataTypes.UserConfigurationMap storage userConfig,
DataTypes.ExecuteRepayParams memory params
) external returns (uint256) {
DataTypes.ReserveData storage rese... | 3,271,287 |
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY831() external view returns (uint256); //i... | inject NONSTANDARD NAMING | function SAFETRANSFER239(IERC20 token, address to, uint256 value) internal { | 14,087,533 |
./full_match/5/0xef0F6F951F0e62774597eB29b86065498bB7aC32/sources/contracts/periphery/lib/ControllerHelperUtil.sol | minth amount of wPowerPerp and LP in weth/wPowerPerp pool _controller wPowerPerp controller address _nonfungiblePositionManager Uni NonFungiblePositionManager address _mintAndLpParams ControllerHelperDataType.MintAndLpParams struct _isWethToken0 bool variable indicate if Weth token is token0 in Uniswap v3 weth/wPow... | function mintAndLp(address _controller, address _nonfungiblePositionManager, address _wPowerPerp, address _weth, ControllerHelperDataType.MintAndLpParams calldata _mintAndLpParams, bool _isWethToken0) public returns (uint256, uint256) {
IWETH9(_weth).withdraw(_mintAndLpParams.collateralToDeposit);
... | 11,610,663 |
./partial_match/1/0x0bC3853f47B9B8A3F5cBA8a9cBC33cb865d09B37/sources/ReputationFromToken.sol | redeem function _beneficiary the beneficiary address to redeem for _redeemer the redeemer address return uint256 minted reputation/ | function _redeem(address _beneficiary, address _redeemer, bytes32 _agreementHash)
private
onlyAgree(_agreementHash)
returns(uint256) {
require(avatar != Avatar(0), "should initialize first");
require(redeems[_redeemer] == false, "redeeming twice from the same account is not allowed");
... | 16,172,422 |
pragma solidity ^0.4.4;
/// @title Bitplus Token (BPNT) - crowdfunding code for Bitplus Project
contract BitplusToken {
string public constant name = "Bitplus Token";
string public constant symbol = "BPNT";
uint8 public constant decimals = 18; // 18 decimal places, the same as ETH.
uint256 public co... | Get back the ether sent during the funding in case the funding has not reached the minimum level. Required state: Funding Failure Abort if not in Funding Failure state. | function refund() external {
if (!funding) throw;
if (block.number <= fundingEndBlock) throw;
if (totalTokens >= tokenCreationMin) throw;
bool isEarlyBacker = false;
uint256 ethValue;
for (uint i = 0; i < earlyBackers.length; i++) {
if(earlyBacker... | 12,815,890 |
// SPDX-License-Identifier: GPL-3.0
/// @title The Rakuten Monkey Sponsors Club auction house
// LICENSE
// AuctionHouse.sol is a modified version of Zora's AuctionHouse.sol:
// https://github.com/ourzora/auction-house/blob/54a12ec1a6cf562e49f0a4917990474b11350a2d/contracts/AuctionHouse.sol
//
// AuctionHouse.sol sour... | Create an auction. Store the auction details in the `auction` state variable and emit an AuctionCreated event. If the mint reverts, the minter was updated without pausing this contract first. To remedy this, catch the revert and pause this contract./ | function _createAuction() internal {
try NFT(rmsc).mint(address(this)) returns (uint256 tokenId) {
uint256 startTime = block.timestamp;
uint256 endTime = startTime + duration;
auction = Auction({
tokenId: tokenId,
amount: 0,
... | 1,156,720 |
/*
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... | Check token approved for airdrops then handle airdropped postion./ | function _absorb(ISetToken _setToken, address _token) internal {
require(isAirdropToken(_setToken, _token), "Must be approved token.");
_handleAirdropPosition(_setToken, _token);
}
| 1,804,280 |
pragma solidity ^0.4.24;
// pragma experimental ABIEncoderV2;
interface CitizenInterface {
function addEarlyIncome(address _sender) external payable;
function pushTicketRefIncome(address _sender) external payable;
function addTicketEthSpend(address _citizen, uint256 _value) external payable;
fun... | require drawed winner require 5 citizen can draw require time; | function claim() public registered() {
require(currentRound>0&&round[currentRound].ticketSum==0);
uint256 lastRound = currentRound-1;
require(round[lastRound].numberClaimed<5);
require(round[lastRound].endRound.add(ONE_MIN)<now);
address _sender = msg.sender;
roundWin... | 12,697,124 |
// File: @aragon/os/contracts/lib/token/ERC20.sol
// See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/a9f910d34f0ab33a1ae5e714f69f9596a02b4d91/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.4.24;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC2... | Tell if a voter has cast their choice in a vote (by themselves or via a representative) _vote Vote instance being queried _voter Address of the voter being queried return True if the voter has cast their choice in the vote/ | function _hasCastVote(Vote storage _vote, address _voter) internal view returns (bool) {
return _voterState(_vote, _voter) != VoterState.Absent;
}
| 15,422,879 |
./full_match/137/0x3EA38B86b47A03549C4626AFB25C6A0C7a59e6FA/sources/project_/contracts/oracles/tellor/UsingTellor.sol | Getters/ Retrieves the next value for the queryId after the specified timestamp _queryId is the queryId to look up the value for _timestamp after which to search for next value return _value the value retrieved return _timestampRetrieved the value's timestamp/ | function getDataAfter(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bytes memory _value, uint256 _timestampRetrieved)
{
(bool _found, uint256 _index) = getIndexForDataAfter(
_queryId,
_timestamp
);
if (!_found) {
re... | 4,792,602 |
pragma solidity 0.4.26;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol";
import "../Vault/Vault.sol";
/// @title Send NFTs with a link.
/// @author Ricardo Rius - <ricardo@rius.info>
contract LinksNFT is Vault{
using SafeMath for uint;
... | Create fund. _id Fund lookup key value. _signature Sender signature. Handle Id nonce Ids could be reused if the fund was correclty claimed and deleted | function send(
bytes32 _id,
bytes memory _signature,
address _token,
uint _tokenId
)
public
ifNotValidFund(_id)
ifValidSig(_signature)
returns (bool)
{
address signer = ECDSA.recover(_id.toEthSignedMessageHash(),_signature);
... | 13,087,577 |
/**
*Submitted for verification at Etherscan.io on 2020-07-28
*/
pragma solidity 0.6.0;
/**
* @title ETH bonus pool
* @dev ETH collection and inquiry
*/
contract Nest_3_Abonus {
using address_make_payable for address;
using SafeMath for uint256;
Nest_3_VoteFactory _voteFactory; ... | Modify the decay time interval of NEST bonus pool allocation ratio | function changeDistributionTime(uint256 num) public onlyOwner {
_distributionTime = num;
}
| 2,552,224 |
./full_match/4/0xA5053f5421736A149BC01E9d68401cC04832825E/sources/contracts/ProspernetNft.sol | nftCollection[_id].status = nftSaleStatusType.forSale; | function openToSale(string memory _id) public
{
Nft memory nft = getNft(_id);
require( nft.status != nftSaleStatusType.forSale , "status is already as per requirements");
nft.status = nftSaleStatusType.forSale;
require( updateNft(_id, nft), "no nft object found");
emit... | 759,713 |
pragma solidity ^0.4.24;
contract BasicTokenInterface{
function balanceOf(address tokenOwner) public view returns (uint balance);
function transfer(address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
}
// --------------------------... | Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/ | function transferFrom(address _from,address _to,uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to]... | 537,648 |
// SPDX-License-Identifier: MIT
pragma solidity ^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() external view returns (uint256);
/**
* @dev Returns the amount o... | Adjust position by normal leverage and deleverage. _adjustBy Amount by which we want to increase or decrease _borrow _shouldRepay True indicate we want to deleverage return amount Actual adjusted amount/ We can get position via view function, as this function will be called after _calculateDesiredPosition If no borro... | function _adjustPosition(uint256 _adjustBy, bool _shouldRepay) internal returns (uint256 amount) {
(uint256 _supply, uint256 _borrow) = getPosition();
if (_borrow == 0 && _shouldRepay) {
return 0;
}
(, uint256 collateralFactor, ) = comptroller.markets(address(cToken));
... | 1,539,106 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.7.0;
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155HolderUpgradeable.sol"... | Sets `_xTokenWrapperAddress` as the xToken Wrapper module. _xTokenWrapperAddress xTokenWrapperAddress contract/ | function setXTokenWrapper(address _xTokenWrapperAddress) external onlyAdmin {
_setXTokenWrapperAddress(_xTokenWrapperAddress);
}
| 11,653,199 |
./full_match/1/0xCFc60d34949A7DBdf91ba6D5613b26d6Ff0AD504/sources/src/core/Pomace.sol | calculate the payout for one option token _tokenId token id of option token return engine engine to settle return debtId asset id to be pulled from long holder return debtPerOption amount to be pulled per option return payoutId asset id to be payed out to long holder return payoutPerOption amount paid per option/ cal... | function _getPayoutPerToken(uint256 _tokenId)
internal
view
returns (address engine, uint8 debtId, uint256 debtPerOption, uint8 payoutId, uint256 payoutPerOption)
{
(TokenType tokenType, uint32 productId, uint64 expiry, uint64 strikePrice, uint64 exerciseWindow) =
Tok... | 4,921,139 |
./full_match/5/0x5141be39e11Ba5D162e9cEDfaEEa8839Ce1e5669/sources/project_/contracts/GenesisToken.sol | It mints/creates 1 Genesis Token calling `_mint()` from ERC1155 OpenZeppelin implementation. To be called by another smart contract or wallet with the MINTER_ROLE role. _account Token owner address - cannot be the zero address. _category Genesis Token category _data Additional data with no specified format/ | function mint(
address _account,
uint256 _category,
bytes memory _data
) external nonReentrant onlyRole(MINTER_ROLE) {
_mint(_account, _category, 1, _data);
}
| 7,088,736 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity ^0.8.11;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "./utils/Admin.sol";
import "./utils/Mutex.sol";
import "./utils/MagicEthTransfer.sol";
import "./utils/EthSafeTransfer.sol";
import "./math/Sigmoid.sol";
import "..... | Allows deposits to be minted in a virtual manner and sent to the Madnet chain by simply emitting a Deposit event without actually minting or burning any tokens. This function receives ether in the transaction and converts them into a deposit of MadBytes in the Madnet chain. This function has the same effect as calling ... | function mintDeposit(uint8 accountType_, address to_, uint256 minMB_) public payable returns (uint256) {
return _mintDeposit(accountType_, to_, minMB_, msg.value);
}
| 12,836,793 |
pragma solidity ^0.5.16;
import "../interfaces/IBlockRewardHbbft.sol";
import "../interfaces/IStakingHbbft.sol";
import "../interfaces/IValidatorSetHbbft.sol";
import "../upgradeability/UpgradeableOwned.sol";
import "../libs/SafeMath.sol";
/// @dev Implements staking and withdrawal logic.
contract StakingHbbftBase i... | The internal function used by the `_withdraw` and `claimOrderedWithdraw` functions. Contains a common logic for these functions. _poolStakingAddress The staking address of the pool from which the coins are withdrawn. _staker The staker's address. | internal {
function _withdrawCheckPool(address _poolStakingAddress, address _staker)
if (_staker == _poolStakingAddress) {
address miningAddress = validatorSetContract.miningByStakingAddress(_poolStakingAddress);
if (validatorSetContract.isValidator(miningAddress)) {
... | 927,169 |
./partial_match/3/0xf03518534Ec76AEb697C99cFE0CDA08077091c7B/sources/Heroes.sol | Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator. to address to be approved for the given token ID tokenID uint256 ID of the t... | function approve(address to, uint256 tokenID) public {
address owner = ownerOf(tokenID);
require(to != owner);
require(msg.sender == owner || isApprovedForAll(owner, msg.sender));
_tokenApprovals[tokenID] = to;
emit Approval(owner, to, tokenID);
}
| 5,226,181 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Storage {
string userID;
string videoID;
string modality;
string dateRequest;
string countryLang;
string result;
// Overwrite stored values in all variables in the memory on the BlockChain
function ... | Getter that does not consume GAS as it is a view function | function retrieveData() public view returns (string memory, string memory, string memory, string memory, string memory, string memory){
return (userID, videoID, modality, dateRequest, countryLang, result);
}
| 12,810,204 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import { IAllowlist } from "../../libraries/IAllowlist.sol";
/**
* @title L1BuildDeposit
* @dev L1BuildAgent maanages OAS deposits required to build the Verse-Layer.
*/
contract L1BuildDeposit {
/**********************
* Contract Variables *
***... | Returns the total amount of the OAS tokens. _builder Address of the Verse-Builder./ | function getDepositTotal(address _builder) external view returns (uint256) {
return depositTotal[_builder];
}
| 1,791,863 |
./full_match/137/0x03927788e5A9C3E901B63EE122a08CA58eb1dD13/sources/project_/contracts/MinimaCrowdsale.sol | Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send tokens. beneficiary Address receiving the tokens tokenAmount Number of tokens to be purchased/ | function _processPurchase(address beneficiary, uint256 tokenAmount)
internal
{
_deliverTokens(beneficiary, tokenAmount);
}
| 4,677,946 |
./full_match/1/0xFEc7C6AA64fDD17f456028e0B411f5c3877ADa5e/sources/contracts/optimistic-asserter/implementation/OptimisticAsserter.sol | Validates if the identifier is whitelisted by first checking the cache. If not whitelisted in the cache then checks it from the identifier whitelist contract and caches result. | function _validateAndCacheIdentifier(bytes32 identifier) internal returns (bool) {
if (cachedIdentifiers[identifier]) return true;
cachedIdentifiers[identifier] = _getIdentifierWhitelist().isIdentifierSupported(identifier);
return cachedIdentifiers[identifier];
}
| 3,859,465 |
./partial_match/1/0x92f8F6c955f730291e66588C0D64Bf0E77DadA4e/sources/Vault.sol | Allows anyone to pay and update the price This function allows to write the new nav NAV is provided by view functions | function updatePrice()
external
nonReentrant
{
updatePriceInternal();
}
| 4,431,891 |
// SPDX-License-Identifier: MIT
/**
██ ██ ██ ██████ ███████ ███████
██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██████ █████ ███████
██ ██ ██ ██ ██ ██ ██
████ ██ ██████ ███████ ███████
*/
pragma solidity 0.8.10;
/**
* @dev Interface of the BEP20 standard as defined in the EIP... | Interface for the optional metadata functions from the BEP20 standard. _Available since v4.1._/ | interface IBEP20Metadata is IBEP20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
}
| 1,537,084 |
// File: contracts/utility/interfaces/IOwned.sol
pragma solidity 0.4.26;
/*
Owned contract interface
*/
contract IOwned {
// this function isn't abstract since the compiler emits automatically generated getter functions as external
function owner() public view returns (address) {this;}
function trans... | checks whether or not a given value is a smart token of a given convertible token _convertibleToken convertible token _value value return true if the given value is a smart token of the given convertible token, false it not/ | function isConvertibleTokenSmartToken(address _convertibleToken, address _value) external view returns (bool) {
return convertibleTokens.table[_convertibleToken].items.table[_value].valid;
}
| 2,497,690 |
./full_match/137/0xa59432d308b98115Aa6DF138e2e5978fed17F954/sources/contracts/LightTowersMarket.sol | Check permission signature free Maximum number of free items permitted signature Permission signature by the signer; not required if free == 0/ | function checkSignature(uint256 free, bytes memory signature) internal view {
if (free == 0) return;
if (ECDSA.recover(keccak256(abi.encode(msg.sender, free)), signature) != signer)
revert InvalidSignature(msg.sender, signature);
}
| 4,701,419 |
pragma solidity 0.4.15;
import './AccessControl/AccessControlled.sol';
import './AccessRoles.sol';
import './EtherToken.sol';
import './IsContract.sol';
import './MigrationSource.sol';
import './LockedAccountMigration.sol';
import './Neumark.sol';
import './Standards/IERC677Token.sol';
import './Standards/IERC677Callb... | unlocks msg.sender tokens by making them withdrawable in assetToken expects number of neumarks that is due to be available to be burned on msg.sender balance - see comments if used before longstop date, calculates penalty and distributes it as revenue | function unlock()
public
onlyStates(LockState.AcceptingUnlocks, LockState.ReleaseAll)
returns (Status)
{
return unlockFor(msg.sender);
}
| 15,882,111 |
pragma solidity >=0.4.22 <0.6.0;
contract BWSERC20
{
string public standard = 'https://leeks.cc';
string public name="Bretton Woods system"; //代币名称
string public symbol="BWS"; //代币符号
uint8 public decimals = 18; //代币单位,展示的小数点后面多少个0,和以太币一样后面是是18个0
uint256 public totalSupply=100000000 ether; ... | 管理员可以解锁1400万币到指定地址解锁1400万,需要两个管理员同时解锁才行满足了解锁条件 | function unlock_listing(address _to) public
{
require(_to != address(0x0),"参数中传入了空地址");
if(msg.sender==st_owner)
{
st_unlock_owner=true;
st_unlock_to=_to;
}
else if(msg.sender==st_owner1)
{
st_unlock_owner1=true;
st_... | 12,799,933 |
pragma solidity 0.4.18;
/**
* @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 previousOwner, ... | Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./ | function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| 9,912 |
// SPDX-License-Identifier: MIT
pragma solidity =0.8.6;
import "./OwnableToken.sol";
import "./ERC20Interface.sol";
contract AgriUTToken is OwnableToken, ERC20Interface
{
string private _name;
string private _symbol;
uint8 private _decimals = 18;
uint256 private _totalSupply;
mapping(address => m... | Destroy tokens Remove _value tokens from the system irreversibly _value the amount of money to burn/ | function burn(uint256 _value) external returns (bool success)
{
_burn(msg.sender, _value);
return true;
}
| 5,396,851 |
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../contracts/libs/IERC20.sol";
import "../contracts/libs/ERC20.sol";
// PLithToken
contract PLithToken is ERC20('PRE-LITHIUM', 'PLITHIUM'), ReentrancyGuard {
address public constant feeAddress = 0x3a1D1114269d7a786C15... | if we dont have enough left, give them the rest. shouldn't be possible to fail these asserts. max plithPurchaseAmount = 6e20, max msg.value approx 3e22 (if 10c matic, worst case). overfow check: 6e20 3e22 1e24 = 1.8e67 < type(uint256).max Rounding errors by integer division, reduce magnitude of end result. We accept ... | function buyPLith() external payable nonReentrant {
require(block.number >= startBlock, "presale hasn't started yet, good things come to those that wait");
require(block.number < endBlock, "presale has ended, come back next time!");
require(plithRemaining > 0, "No more plith remaining! Come ... | 12,952,544 |
/**
*Submitted for verification at Etherscan.io on 2022-03-03
*/
/**
Contract is by captain ike and frens
,--. ,--. ,--.,--.
,---. ,--,--. ,---. ,-' '-. ,--,--.`--',--,--, `--'| |,-. ,---.
| .--'' ,-. || .-. |'-. .-'' ,-. |,--.| \ ,--.| /| .-. :
\ `--.\ '-' || '-' ' | | \ '-' || || || | | || \ \\ --.
`---... | ERC-721 Non-Fungible Token Standard, optional metadata extension/ | interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
}
| 2,311,584 |
pragma solidity ^0.4.23;
// Based on https://github.com/axiomzen/cryptokitties-bounty/blob/master/contracts/KittyAccessControl.sol
contract MeetupAccessControl {
// The addresses of the accounts (or contracts) that can execute actions within each roles.
address public organiserAddress;
address public assistant... | Unpauses the smart contract. Can only be called by the CEO, since one reason we may pause the contract is when CFO or COO accounts are compromised. can't unpause if contract was upgraded | function unpause() public onlyOrganiser whenPaused {
paused = false;
}
| 5,382,371 |
// SPDX-License-Identifier: GPLv3
pragma solidity >=0.7.0 <0.9.0;
import './ITideBitSwapFactory.sol';
import './TransferHelper.sol';
import './ITideBitSwapRouter.sol';
import './TideBitSwapLibrary.sol';
import './SafeMath.sol';
import './IERC20.sol';
import './IWETH.sol';
contract TideBitSwapRouter is ITideBitSwapR... | SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair | function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual {
for (uint i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0,) = TideBitSwapLibrary.sortTokens(input, output);
ITideBitSwapPair pair = ITideBit... | 328,247 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
pragma experimental ABIEncoderV2;
library Bytes {
function toBytes(address x)
internal
pure
returns (bytes memory b)
{
b = new bytes(32);
assembly { mstore(add(b, 32), x) }
}
function toAddress(uint _offs... | Converts byte-array to an array of addresses/ | function toArrayAddress(bytes memory _addresses)
internal
pure
returns (address[] memory)
{
uint256 chunks = _addresses.length / 32;
address[] memory addressesFormatted = new address[](chunks);
for (uint256 i = 0; i < chunks; i++) {
addressesFormatted[... | 1,075,917 |
//! CertifierHandler contract.
//! By Parity Technologies, 2017.
//! Released under the Apache Licence 2.
pragma solidity 0.4.17;
// From Owned.sol
contract Owned {
/// STORAGE
address public owner = msg.sender;
/// EVENTS
event NewOwner(address indexed old, address indexed current);
/// MODIFIERS
modif... | Change the fee, needed if for whatever reason gas price must be modified. Only the owner of the contract can execute this method. _fee The new fee | function setFee (uint _fee) external only_owner {
NewFee(fee, _fee);
fee = _fee;
}
| 13,053,115 |
./full_match/1313161554/0x9617564b3C774E1752FD97dE8E1d2d9552dc1B3F/sources/contracts/ChToken/ChToken.sol | User redeems ChTokens in exchange for the underlying asset Assumes interest has already been accrued up to the current block redeemer The address of the account which is redeeming the tokens redeechTokensIn The number of ChTokens to redeem into underlying (only one of redeechTokensIn or redeemAmountIn may be non-zer... | function redeemFresh(
address payable redeemer,
uint256 redeechTokensIn,
uint256 redeemAmountIn
) internal returns (uint256) {
require(
redeechTokensIn == 0 || redeemAmountIn == 0,
"one of redeechTokensIn or redeemAmountIn must be zero"
);
... | 13,231,114 |
./partial_match/4/0x7139De7Ec6208BEB83944E6F218Ca2B5917AE8Ba/sources/ERC20.sol | Return count users on system/ | function totalUsers() public view returns (uint256) {
return _totalUsers;
}
| 8,504,918 |
./full_match/1/0x6fc5c937a916ba99e584050E7297dDFb235b7e2B/sources/contracts/ViiraGenesisMintable.sol | Set allowed markets | function setAllowedMarket(address market, bool allowed) external onlyOwner {
allowedMarkets[market] = allowed;
}
| 9,630,714 |
pragma solidity >=0.4.19 <0.7.0;
import "./interface/IERC20.sol";
import "./lib/safemath.sol";
/**
* The CountachToken is IERC20 contract
*/
contract CountachDemo is IERC20 {
string public constant name = "Countach Demo Token";
string public constant symbol = "CDT";
uint8 public constant decimals = 1... | Get the Balance of the specified address owner The address your will query balance of. return An uint256 value ,web3 need use bignumber handle./ | function balanceOf(address owner)
public view returns(uint256){
return _balances[owner];
}
| 1,037,659 |
pragma solidity ^0.5.10;
/** @title A contract for generating unique identifiers
*
* @notice A contract that provides an identifier generation scheme,
* guaranteeing uniqueness across all contracts that inherit from it,
* as well as the unpredictability of future identifiers.
*
* @dev This contract is i... | Pass-through control of print confirmation, allowing this contract's custodian to act as the custodian of the associated active token implementation. This contract is the direct custodian of the active token implementation, but this function allows this contract's custodian to act as though it were the direct custodi... | function confirmPrintProxy(bytes32 _lockId) public onlyCustodian {
erc20Impl.confirmPrint(_lockId);
}
| 12,961,595 |
pragma solidity ^0.4.24;
/**
* @title The STT Token contract.
*
* By Nikita Fuchs
* Credit: Taking ideas from BAT token, NET token and Nimiq token.
*/
/**
* @title Safe math operations that throw error on overflow.
*
* Credit: Taking ideas from FirstBlood token
*/
library SafeMath {
/**... | Perform an atomic swap between two token contracts Check if relocation was activated Define new token contract is Burn the old balance Perform the relocation of balances to new contract | function relocate()
external
{
require (relocationActive == true);
RelocationToken newSTT = RelocationToken(newTokenContractAddress);
uint256 balance = balances[msg.sender];
balances[msg.sender] = 0;
require(newSTT.recieveRelocation(msg.sender, balance));
... | 1,812,170 |
./full_match/4/0xF5FC973d19bfbdb5ec20868972bE18FDba05Cb75/sources/Tens.sol | _devWallet = devWallet; Create a uniswap pair for this new token exclude from receiving dividends exclude from paying fees or having max transaction amount enable owner wallet to send tokens before presales are over. | constructor() ERC20("TESRT", "TESRT") {
dividendTracker = new TENSHIDividendTracker();
liquidityWallet = owner();
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory... | 12,365,239 |
./partial_match/1/0xfdB5Dee856A2709F9D356ABb6A38c391c6eBCe6C/sources/CountdownGriefingEscrow_Factory.sol | Get the address of the given token ID. tokenID TokenManager.Tokens ID of the ERC20 token. return tokenAddress address of the ERC20 token. | function getTokenAddress(Tokens tokenID) public pure returns (address tokenAddress) {
if (tokenID == Tokens.DAI)
return BurnDAI.getTokenAddress();
if (tokenID == Tokens.NMR)
return BurnNMR.getTokenAddress();
return address(0);
}
| 4,386,837 |
./partial_match/97/0xdc73D584Bda48D3277Ac69AeB343dD692519A0A9/sources/GET_NFT_V3.sol | onlyRelayer - caller needs to be whitelisted relayer In the first transaction the ticketMetadata is stored in the metadata of the NFT. destinationAddress addres of the to-be owner of the getNFT ticketMetadata string containing the metadata about the ticket the NFT is representing (unstructured, set by ticketIssuer) ... | function primaryMint(address destinationAddress, address ticketIssuerAddress, address eventAddress, string memory ticketMetadata, uint256 orderTime, uint256 ticketPrice) public onlyRelayer() returns (uint256) {
if (balanceOf(destinationAddress) != 0) {
emit doubleNFTAlert(destinationAddress, bl... | 11,434,557 |
./full_match/4/0xD1E74cD382237a7ACADB1213598296a29814E406/sources/SpaceGate.sol | configure min max for existed gate () | function configureMinMax(
string memory _gate,
uint256 _min,
uint256 _max
)
public
onlyOwner()
{
require(validGate(_gate), "Gate not found");
Gates[_gate].min = _min;
Gates[_gate].max = _max;
}
| 660,567 |
//Address: 0x5175b0d077c19e1db45723d3fbc7ac63e91bdfc5
//Contract name: TucToken
//Balance: 0 Ether
//Verification Date: 6/21/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.13;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event Ownersh... | Retrieve ETH from the contract. The contract owner can use this method to transfer received ETH to another wallet. _safe The address of the wallet the funds should get transferred to. _value The amount of ETH to transfer./ | function retrieveEth(address _safe, uint256 _value)
external
onlyOwner
{
_safe.transfer(_value);
}
| 12,908,359 |
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../../ConverterVersion.sol";
import "../../interfaces/IConverter.sol";
import "../../interfaces/IConverterAnchor.sol";
import "../../interfaces/IConverterUpgrader.sol";
import "../..... | deprecated, backward compatibility/ | function connectorTokens(uint256 _index) public view override returns (IReserveToken) {
return __reserveTokens[_index];
}
| 12,984,744 |
./full_match/1/0xd636b1967aA1ee74785f1bf8bBc8227B621d3B62/sources/contracts/ERC721A.sol | Converts a `uint256` to its ASCII `string` decimal representation./ The maximum value of a uint256 contains 78 digits (1 byte per digit), but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged. We will need 1 32-byte word to store the length, and 3 32-byte words to store a maximum of 78 digits. T... | function _toString(uint256 value)
internal
pure
virtual
returns (string memory ptr)
{
assembly {
ptr := add(mload(0x40), 128)
mstore(0x40, ptr)
let end := ptr
for {
let temp := value
ptr := ... | 2,985,882 |
./partial_match/1/0x5Dc58f812b2e244DABA2fabd33f399cD699D7Ddc/sources/IStabilityPool.sol | The Stability Pool holds LUSD tokens deposited by Stability Pool depositors. When a trove is liquidated, then depending on system conditions, some of its LUSD debt gets offset with LUSD in the Stability Pool: that is, the offset debt evaporates, and an equal amount of LUSD tokens in the Stability Pool is burned. Thus,... | interface IStabilityPool {
event StabilityPoolETHBalanceUpdated(uint _newBalance);
event StabilityPoolLUSDBalanceUpdated(uint _newBalance);
event BorrowerOperationsAddressChanged(address _newBorrowerOperationsAddress);
event TroveManagerAddressChanged(address _newTroveManagerAddress);
event A... | 2,686,262 |
./full_match/7672/0x04742440f3272232Dd46FCDb3e86A4c2961d5164/sources/contracts/payments/ticketing/RewardsManager.sol | This function utilizes the cumulative reward factors, and the staker's value in stake to calculate the staker's share of the pending reward./ find the first reward pool where their stake was active and had generated rewards check if node initialized a reward pool for this epoch and gained rewards | function calculatePendingClaim(
bytes32 stakerKey,
address stakee,
address staker
) internal view returns (uint256) {
uint256 claim = calculateInitialClaim(stakerKey, stakee);
uint256 activeAt;
RewardPool memory initialActivePool;
uint256 currentEpochId ... | 16,296,038 |
/**
*Submitted for verification at Etherscan.io on 2021-03-15
*/
pragma solidity =0.6.6;
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
// bytes4... | SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair | function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual {
for (uint i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0,) = BeadswapV1Library.sortTokens(input, output);
IBeadswap... | 2,246,410 |
./partial_match/1/0x7eBc9E1B2bE8D0E32E0aFa95761538EBDD8304fD/sources/testContractCross.sol | Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ... | function MapContract(RouterLinker calldata linker) external;
function UnMapContract(RouterLinker calldata linker) external;
function genericDeposit(
uint8 _destChainID,
bytes calldata _data,
uint256 _gasLimit,
uint256 _gasPrice,
address _feeToken
) external returns (uint64);
function fe... | 15,766,573 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract WaffleMaker {
using SafeMath for uint;
uint constant PRIZE_POOL_COST_PERCENTAGE = 90; // The rest is gi... | Returns the profile data associated to an address/ | function getProfileInfo(address _addr)
external
view
returns (
uint[] memory ownedWaffleIds,
uint[] memory votedWaffleIds,
bool canVote
)
{
uint[] memory profileOwnedWaffles = new uint[](profiles[_addr].ownedWafflesCount);
for (... | 7,230,160 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/acc... | Update tBonePercent by the owner. | function tBonePercentUpdate(uint _tBonePercent) public onlyOwner {
tBonePercent = _tBonePercent;
emit SetPercent("tBone share", msg.sender, _tBonePercent);
}
| 13,873,773 |
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/Marketplace.sol | Changes The Type Of A Sale/ | function __ChangeFixedPriceType(uint SaleIndex, uint Type) external onlyAdmin { FixedPriceSales[SaleIndex]._Type = Type; }
| 8,471,317 |
./full_match/1/0xc1aAB2dc3Fe5082D2D3eAaf67f4D49619B9862C9/sources/Users/simondos/projects/micobo-security-token/contracts/gsn/GSNRecipient.sol | Replacement for msg.sender. Returns the actual sender of a transaction: msg.sender for regular transactions, and the end-user for GSN relayed calls (where msg.sender is actually `RelayHub`). IMPORTANT: Contracts derived from {GSNRecipient} should never use `msg.sender`, and use {_msgSender} instead./ | function _msgSender()
internal
virtual
override
view
returns (address payable)
{
if (msg.sender != _relayHub) {
return msg.sender;
return _getRelayedCallSender();
}
}
| 3,074,031 |
./partial_match/1/0xC910814c1D1c8385083a8937ccd64E0d56779E41/sources/Token0xC.sol | Purge the time in the timestamp. | function DateConverter(uint256 ts) public view returns(uint256 currentDayWithoutTime){
uint256 dayInterval = ts - BaseTimestamp;
uint256 dayCount = dayInterval.div(86400);
return BaseTimestamp + dayCount * 86400;
}
| 15,736,928 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./BalanceLimitable.sol";
import "./Blacklistable.sol";
import "./IERC20.sol";
import "./Pausable.sol";
import "./Peggable.sol";
import "./Taxable.sol";
import "./AccessControlUpgradeable.sol";
import "./OwnableUpgradeable.sol";
import "./ERC20Upgradeable.... | Burn the sender's tokens and return them the equivalent in the pegged token/ | function burn(uint256 amount) public override notBlacklisted notPaused {
super.burn(amount);
}
| 6,925,633 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {Math} from "@openzeppelin/contracts/math/Math.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {SafeERC... | Recalls an amount of funds from a vault to this contract. _vaultId the identifier of the recall funds from. _amount the amount of funds to recall from the vault. return the amount of funds that were recalled from the vault to this contract and the decreased vault value. | function _recallFunds(uint256 _vaultId, uint256 _amount) internal returns (uint256, uint256) {
require(emergencyExit || msg.sender == governance || _vaultId != _vaults.lastIndex(), "Formation: not an emergency, not governance, and user does not have permission to recall funds from active vault");
Vault.Data ... | 11,858,918 |
pragma solidity ^0.4.23;
import "./Template.sol";
/**
* @title Board
* @dev Allows host people control room
* @author Brian Dhang
*/
contract Board is Template {
mapping(uint => bool) questionIdToSubmitedAll;
mapping(uint => mapping(address => uint)) quizIdToUserScore;
mapping(uint => address[]) quizIdT... | Next Question Host people next question _quizId uint PIN of room/ Set startTime for currentQuestion Check valid time of previous question | function nextQuestion(uint _quizId) public {
require(quizIdToOwner[_quizId] == msg.sender, "Don't have permission.");
require(quizIdToUsersList[_quizId].length > 0, "Don't have any player.");
if (quizs[_quizId].currentQuestion < quizIdToQuestionIds[_quizId].length) {
... | 13,009,490 |
./full_match/1/0x7B42f8f66f088f0EEb817e17f95354b7B92f1fC3/sources/browser/Untitled.sol | gets called 21 days after when the contract balnce crosses $1,000,000 | function endPresale() external returns(bool) { | 3,143,169 |
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2; // causes high gas usage, so only use for view functions
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
contract NetEmissionsTokenNetwor... | returns issuer of a given tokenId tokenId token to check/ | function getIssuer(uint256 tokenId)
external
view
returns (address)
{
require(tokenExists(tokenId), "tokenId does not exist");
return _tokenDetails[tokenId].issuer;
}
| 5,390,258 |
./partial_match/5/0x7106619Bb2c60ab9d4DAF5FC4941d46cba6Aa4Ed/sources/OOF.sol | Returns whether 'spender' is allowed to manage 'tokenId'. Requirements: - 'tokenId' must exist./ | function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
| 16,847,202 |
./full_match/44787/0xBCba425b9Dd7D56B49d2Af59DA15E284A49dbEc5/sources/contracts/pools/BaseCarbonTonne.sol | unpause the system, wraps _unpause(), only Admin | function unpause() external virtual onlyWithRole(PAUSER_ROLE) {
_unpause();
}
| 13,272,186 |
./partial_match/1/0x5fa60726E62c50Af45Ff2F6280C468DA438A7837/sources/contracts/exchangeV2/Signatures.sol | Return version and domain separator/ | function information() external view returns (string memory version, bytes32 domainSeparator) {
version = _VERSION;
domainSeparator = _DOMAIN_SEPARATOR;
}
| 4,003,371 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.