file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
//Address: 0xb56c725467c7eec851b1a4a4222d930932b04e89
//Contract name: E4RowEscrow
//Balance: 0.1862646004623971 Ether
//Verification Date: 6/15/2017
//Transacion Count: 3958
// CODE STARTS HERE
pragma solidity ^0.4.11;
// version (LAVA-Q)
contract E4RowEscrow {
event StatEvent(string msg);
event StatEventI(string... | ------------------------------------------------------ set operation gas amounts for forwading operations------------------------------------------------------ | function setOpGas(uint _ag, uint _tg)
{
if (msg.sender != owner)
throw;
acctCallGas = _ag;
tokCallGas = _tg;
}
| 12,615,564 |
./full_match/43114/0x90784DDfCc264134bEF540830508101d3D013dB2/sources/contracts/lmol.sol | remove subsidy controller for bond contract _subsidyController address/ | function removeSubsidyController( address _subsidyController ) external onlyPolicy() {
bondForController[ _subsidyController ] = address(0);
}
| 4,560,353 |
pragma solidity ^0.4.24;
/*
ETHEREUM WORLD CUP : 14th June - 15th July 2018 [Russia]
- designed and implemented by Norsefire.
- thanks to Etherguy and oguzhanox for debugging and front-end respectively.
Rules are as follows:
* Entry to the game costs 0.2018 Ether. Use the register function when sending t... | What is the current score of a given tournament participant? | function showPlayerScores(address _participant)
view
public
returns (int8[64])
{
return playerPointArray[_participant];
}
| 2,278,714 |
// solium-disable linebreak-style
pragma solidity ^0.4.15;
/*
Crypto Market Prices via Ethereum Smart Contract
A community driven smart contract that lets your contracts use fiat
amounts in USD, EURO, and GBP. Need to charge $10.50 for a contract call?
With this contract, you can convert ETH and other crypto... | default function so this contract can accept ETH with low gas limits. | function() payable {
}
| 12,573,737 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when d... | Withdraw depositor collateral. token Withdraw token. depositor Depositor address. amount Withdraw amount./ | function withdraw(
address token,
address depositor,
uint256 amount
) external onlyOwner {
require(amount > 0, "DepositorCollateral::withdraw: empty amount");
require(balanceOf(token, depositor) >= amount, "DepositorCollateral::withdraw: negative balance");
_bala... | 1,408,476 |
/**
*Submitted for verification at Etherscan.io on 2022-02-05
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
... | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amo... | 2,066,582 |
/**
*Submitted for verification at Etherscan.io on 2021-06-10
*/
pragma solidity ^0.5.17;
// Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol
// Adapted to use pragma ^0.5.17 and satisfy our linter rules
/**
* @title SafeMath
* @dev Math operations with safety checks tha... | Internal function to fetch a dispute with its config _disputeId Identification number of the dispute to be fetched return dispute Dispute instance requested return config Court config used for the given dispute/ | function _getDisputeWithConfig(uint256 _disputeId)
internal
view
returns (Dispute storage dispute, Config memory config)
{
dispute = _getDispute(_disputeId);
config = _getDisputeConfig(dispute);
}
| 10,544,638 |
./full_match/1/0x0ae007720fef743079933e0e7794faa54187A54a/sources/contracts/CoreModules/SmartWallet/libraries/LibSmartWallet.sol | gets the smartwallet address given a user address | function getWalletFromuser(address user) internal view returns(address) {
SmartWalletFactoryState storage smartWalletFactoryState = diamondStorage();
return smartWalletFactoryState.userWalletMap[user];
}
| 17,002,130 |
./full_match/4/0xDC750c9a411e3BfA0fB0Dd1248251D5831321352/sources/cache/solpp-generated-contracts/Bytes.sol | Trim bytes into single word | function trim(bytes memory _data, uint256 _new_length) internal pure returns (uint256 r) {
uint256 a;
assembly {
}
return a >> ((0x20 - _new_length) * 8);
}
| 749,305 |
./full_match/1/0x9837Ce9825D52672Ca02533B5A160212bf901963/sources/contracts/interfaces/ITrade.sol | Simple generalized trading interface for all Trade contracts to obey Usage: if (canSettle()) settle()/ | interface ITrade {
function sell() external view returns (IERC20Metadata);
function buy() external view returns (IERC20Metadata);
function endTime() external view returns (uint48);
function canSettle() external view returns (bool);
function settle() external returns (uint256 soldAmt, uint256 bou... | 16,407,486 |
// Sources flattened with hardhat v2.6.2 https://hardhat.org
// File @openzeppelin/contracts/utils/Context.sol@v4.3.1
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are... | Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d... | function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try
IERC721Receiver(to).onERC721Received(
_msgSender(),
fro... | 1,393,887 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning wi... | This mining pool was already whitelisted | function setBlockSubmissionsOperator(address newBlockSubmissionsOperator) external {
assert(msg.data.length == 36);
require(blockSubmissionsOperator[msg.sender] != 0x0000000000000000000000000000000000000000);
blockSubmissionsOperator[msg.sender] = newBlockSubmissionsOperator;
}
| 6,308,176 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../utils/TridentBatchable.sol";
import "../utils/TridentPermit.sol";
/// @notice Interface for handling Balancer V1 LP.
interface IBalancerV1 {
function getFinalTokens(... | Decreases the amount of liquidity in a position and accounts it to the position params tokenId The ID of the token for which liquidity is being decreased, amount The amount by which liquidity will be decreased, amount0Min The minimum amount of token0 that should be accounted for the burned liquidity, amount1Min The mi... | interface ITridentRouterMinimal {
function decreaseLiquidity(DecreaseLiquidityParams calldata params) external payable returns (uint256 amount0, uint256 amount1);
function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);
}
struct TokenInput {
addr... | 1,784,308 |
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
// Forked from uniswap Uni, Removed Minter and mint() function
/**
* @dev Wrappers over Solidity's arithmetic operations with add... | 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, "doro::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
... | 15,359,638 |
pragma solidity ^0.4.11;
/**
* @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(uint25... | 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 durationInMinutes = _durationInMinutes;Here will come the checksum address we got | function Crowdsale() {
wallet = 0xA438F169eb2889E4F7c5A684b5bfF8FE04036846;
addressOfTokenUsedAsReward = 0xdeA0A6D88A21AA5D8aA5E0231EfD709Ce381e2aA;
tokenReward = token(addressOfTokenUsedAsReward);
}
bool public started = true;
| 2,305,663 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity w... | Add credit to a job to be paid out for work job the job being credited amount the amount of credit being added to the job/ | function addKPRCredit(address job, uint amount) external {
require(msg.sender == governance, "addKPRCredit: !gov");
require(jobs[job], "addKPRCredit: !job");
credits[job][address(this)] = credits[job][address(this)].add(amount);
emit AddCredit(address(this), job, msg.sender, block.n... | 494,227 |
// File: contracts\modules\Ownable.sol
pragma solidity =0.5.16;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the ... | Operation for transfer user's payback and deduct transaction fee. Only manager contract can invoke this function. recieptor the recieptor account. settlement the settlement coin address. payback the payback amount feeType the transaction fee type. see transactionFee contract/ | function transferPaybackAndFee(address payable /*recieptor*/,address /*settlement*/,uint256 /*payback*/,
uint256 /*feeType*/)public{
delegateAndReturn();
}
| 13,779,845 |
pragma solidity ^0.5.12;
library SafeMath {
function MUL98(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING
if (a == 0)
return 0;
uint256 c = a * b;
require(c / a == b);
... | inject NONSTANDARD NAMING | function BALANCEOF767(address _owner) external view returns (uint256 balance); | 5,544,603 |
/**
*Submitted for verification at Etherscan.io on 2020-05-28
*/
pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
interface IPlatformIntegration {
/**
* @dev Deposit the given bAsset to Lending platform
* @param _bAsset bAsset address
* @param _amount Amount to deposit
*/
funct... | Get data for a specific bAsset, if it exists _bAsset Address of bAsset return bAsset Struct with full bAsset data/ | function getBasset(address _bAsset)
view
returns (Basset memory bAsset)
{
(bool exists, uint8 index) = _isAssetInBasket(_bAsset);
require(exists, "bAsset must exist");
bAsset = _getBasset(index);
}
| 12,752,904 |
// File: @openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.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 ... | Pancake has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all. | function updateEmissionRate(uint256 _ddexxPerBlock) public onlyOwner {
massUpdatePools();
ddexxPerBlock = _ddexxPerBlock;
}
| 12,220,123 |
//Address: 0x400c969095ebb8b053956105458ff033e58fc025
//Contract name: Eagle
//Balance: 0 Ether
//Verification Date: 11/14/2017
//Transacion Count: 1
// CODE STARTS HERE
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) i... | Fallback function Does not accept ethers This will throw an exception - in effect no one can purchase the coin | function() {
assert(true == false);
}
| 12,695,648 |
pragma solidity ^0.4.18;
// File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(ad... | this is used if previous stage did not reach the softCap, the refaund is available before the next stage begins | function toggleVaultStateToAcive() public onlyOwner {
require(now >= stages[currentStage].startTime - 1 days);
vault.activate();
}
| 1,350,960 |
//SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
/**
* @title Write nested JSON using solidity
* @author Ben Meredith
* @dev https://github.com/bmeredith/solidity-json-writer
*/
library JsonWriter {
using JsonWriter for string;
struct Json {
int256 depthBitTracker;
string value;
}
bytes1 c... | Writes the end of a JSON array or object based on the token parameter./ | function writeEnd(Json memory json, bytes1 token)
public
pure
returns (Json memory)
{
json.value = string(abi.encodePacked(json.value, token));
json.depthBitTracker = setListSeparatorFlag(json);
if (getCurrentDepth(json) != 0) {
json.depthBitTracker--;
}
return json;
}
| 11,829,153 |
./full_match/42/0xa262F943f7D9527333c6eD3c4f222b9Ee7FBB373/sources/bos.sol | Interface for low-level Boshi `swap()` call. | interface IBoshiCallee {
function boshiCall(address sender, uint256 amount0, uint256 amount1, bytes calldata data) external;
}
| 9,586,096 |
pragma solidity >=0.5.10 <0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view retu... | ISavingStrategy.accrueInterest implementation | function accrueInterest() external returns (bool) {
return cToken.accrueInterest() == 0;
}
| 5,848,608 |
// File: @openzeppelin/contracts-ethereum-package/contracts/math/Math.sol
pragma solidity ^0.5.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint2... | the function is name differently to not cause inheritance clash in truffle and allows tests | function initializeVault(address _storage,
address _underlying,
uint256 _toInvestNumerator,
uint256 _toInvestDenominator
) public initializer {
require(_toInvestNumerator <= _toInvestDenominator, "cannot invest more than 100%");
require(_toInvestDenominator != 0, "cannot divide by 0");
ERC2... | 10,662,473 |
./partial_match/42220/0x8f19093D675dA819E0De6Ab4E03A2e612f63a599/sources/src/grants/StakedGrantManager.sol | CREATE/ Get ImpactVault addresses for owner & beneficiary. Create them if they don't exist yet. | function createGrant(address _beneficiary, bytes32 _externalGrantId)
external
whenNotPaused
returns (bytes32 id)
{
ImpactVaultManager vaultMgr = getImpactVaultManager();
address _owner = msg.sender;
bytes32 ownerVaultId = vaultMgr.getOwnerVaultId(_owner, _benefic... | 3,496,024 |
./partial_match/1/0x2550b21422535fEa08E0672a5391075a9fe9ca39/sources/src/HolyBread.sol | -------------------------------------------------------------------------- / ERC20 / -------------------------------------------------------------------------- / | function approveMax(address spender) external returns (bool) {
return approve(spender, type(uint256).max);
}
| 3,710,556 |
pragma solidity ^0.4.19;
// File: contracts/storage/interface/RocketStorageInterface.sol
// Our eternal storage interface
contract RocketStorageInterface {
// Modifiers
modifier onlyLatestRocketNetworkContract() {_;}
// Getters
function getAddress(bytes32 _key) external view returns (address)... | Set assetsCertified | function setAssetsCertified(uint256 _total) public onlyAuditor whenRedemptionPaused {
uint256 totalSupply_ = rocketStorage.getUint(keccak256("token.totalSupply"));
require(_total >= totalSupply_);
rocketStorage.setUint(keccak256("issuable.assetsCertified"), _total);
emit Certificatio... | 12,812,683 |
pragma solidity ^0.5.0;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "./utils/Math.sol";
import "./utils/DateTimeLibrary.sol";
import "./PersistentStorage.sol";
import "./Abstract/InterfaceInverseToken.sol";
/**
*... | Returns cash without fee _cash The cash provided to create token/ | function removeCurrentMintingFeeFromCash(uint256 _cash)
public
view
returns (uint256 cashAfterFee)
{
uint256 creationFee = persistentStorage.getMintingFee(_cash);
uint256 minimumMintingFee = persistentStorage.minimumMintingFee();
cashAfterFee = removeMintingFeeFro... | 12,877,757 |
./full_match/43113/0x3d7F33c9703efe638467B40bf47441a6C43a4d25/sources/contracts/SwapManager.sol | this path array will have 3 addresses [tokenIn, WAVAX, rewardToken] by calling _approve you allow the router contract to spend the tokens in this contract IERC20(tokenIn).approve(address(router), amount); if (!isApprove) (bool isSuccess,) = address(tokenIn) .delegatecall(abi.encodeWithSignature( "approve(addr... | function _swapTokensForGB(
uint256 amount,
address tokenIn)
private returns (bool isSuccess) {
address[] memory path = new address[](3);
path[0] = tokenIn;
path[1] = router.WAVAX();
path[2] = rewardToken;
address(this).call(abi.encodeWithSignature("I... | 13,173,199 |
pragma solidity 0.5.7;
import "./SafeMath.sol";
// Factory interface
contract FactoryInterface {
function deploy(bytes memory code, bytes32 salt) public returns(address);
}
// Wallet interface
contract WalletInterface {
function setOwner(address payable _owner) public;
}
// Datastore contract
contract VersionCo... | public function to view a user's data | function viewUser(string memory _username) public view returns
(uint256, address, bool, bool, address, uint256, bool) {
bytes memory usernameBytes = bytes(_username);
bytes32 usernameKey = keccak256(usernameBytes);
require(users[usernameKey].exists, "User does not exist.");
User storage user = use... | 12,736,155 |
pragma solidity ^0.4.24;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
exte... | this calculates how much Ether to reward for each game token 234 means 23.4%, using parts-per notation with three decimals of precision calculate the Ether rewards available for each movie | function calculateTotalPlayerRewardsPerMovie(uint256 _boxOfficeTotal) public view returns (uint256) {
uint256 _boxOfficePercentage = percent(_boxOfficeTotal, totalBoxOffice, 4);
uint256 _rewards = totalPlayerRewards.mul(_boxOfficePercentage).div(10**4);
return _rewards;
}
| 7,268,004 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./lib/SafeMath.sol";
import "./lib/Address.sol";
import "./lib/SafeERC20.sol";
import "./lib/OwnableUpgradeSafe.sol";
import "./lib/IXAUToken.sol";
import "./lib/IERC20.sol";
// Vault distributing incoming elastic token rewards equally amongst staked po... | Low level withdraw function | function _withdraw(uint256 _pid, uint256 _amount, address from, address to) internal {
PoolInfo storage pool = poolInfo[_pid];
require(pool.withdrawable, "Withdrawing from this pool is disabled");
UserInfo storage user = userInfo[_pid][from];
require(user.amount >= _amount, "withdraw... | 5,358,356 |
./full_match/5/0x97ea28ab540E8830fbE10B8917457007750fB4fE/sources/contracts/MetaEstateRentals.sol | See {IERC165-supportsInterface}. | function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC4907).interfaceId || super.supportsInterface(interfaceId);
}
| 1,902,015 |
./full_match/1/0x8Cba9816E49Ee0a2e6611Cf3ab81b195AD9C5514/sources/contracts/gemSwap/Atomicizer.sol | Used by ERC721BasicToken.sol | function onERC721Received(
address,
uint256,
bytes calldata
) external pure returns (bytes4) {
return 0xf0b9e5ba;
}
| 4,824,508 |
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant alphabet = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
/... | Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ internal owner Clear approvals Clear metadata (if any) | function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
_ho... | 16,138 |
// SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.5;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./IReserve.sol";
import "./whitelist.sol";
import "./safari-erc20.sol";
import "./isafari-erc721.sol";
import "./token-metadata.sol";
im... | this should only be used to correct errors in trait names | function setPartTraitNames(uint256[] calldata parts, uint256[] calldata traits, string[] memory names) external onlyOwner {
require(parts.length == traits.length && parts.length == names.length, 'all arguments must be arrays of the same length');
uint256 i;
for (i=0; i<parts.length; i++) {
... | 1,304,105 |
// File: contracts/SmartRoute/intf/IDODOV2.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
interface IDODOV2 {
//========== Common ==================
function sellBase(address to) external returns (uint256 receiveQuot... | ========== Common ============================ DODOVendingMachine ================== DODOPrivatePool ===================== CrowdPooling =========== | interface IDODOV2 {
function sellBase(address to) external returns (uint256 receiveQuoteAmount);
function sellQuote(address to) external returns (uint256 receiveBaseAmount);
function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve);
function _BASE_TOKEN_() externa... | 452,069 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.25 <0.8.0;
pragma experimental ABIEncoderV2;
import { IVault } from "./IVault.sol";
import { VaultBase } from "./VaultBase.sol";
import { IFujiAdmin } from "../IFujiAdmin.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
im... | Returns the deposit balance of a ETH/ERC20_Token. _asset: token address to query the balance./ | function getDepositBalance(address _asset) external view override returns (uint256) {
address cyTokenAddr = IFujiMappings(_getMappingAddr()).addressMapping(_asset);
uint256 cyTokenBal = IGenCyToken(cyTokenAddr).balanceOf(msg.sender);
uint256 exRate = IGenCyToken(cyTokenAddr).exchangeRateStored();
ret... | 1,311,632 |
./partial_match/1/0xe3BE0054Da2F8da5002E8bdD8AA4c7fDf851E86D/sources/ERC721CreatorMaxMint.sol | Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred da... | function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, data) returns (bytes4 retval) {
... | 2,680,788 |
./full_match/1/0xeFFe069b1c62c2f55F41A501eCc3c6Ff4dB6D70a/sources/src/base/Cellar.sol | Transfer accrued fees to the Sommelier chain to distribute. Fees are accrued as shares and redeemed upon transfer. assumes cellar's accounting asset is able to be transferred and sent to Cosmos/ Calculate platform fees earned.transfer shares to strategist Take from Solmate ERC20.sol Cannot overflow because the sum of... | function sendFees() external nonReentrant {
address strategistPayoutAddress = feeData.strategistPayoutAddress;
if (strategistPayoutAddress == address(0)) revert Cellar__PayoutNotSet();
uint256 _totalAssets = _accounting(false);
uint256 elapsedTime = block.timestamp - feeData.lastAc... | 3,124,688 |
./full_match/1/0x3b985118468164b310C5254b0710888dd57c7599/sources/contracts/pool/PoolRewards.sol | Gets withdrawn part of reward of some account return Withdrawn reward of account | function withdrawnRewardOf(address account) public view returns (uint256) {
return _withdrawals[account];
}
| 3,086,508 |
pragma solidity 0.5.1;
// File: contracts/lib/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address private _owner;
event ... | Called by a member once they have been approved to join the scheme Before calling the prospective member must have approved the appropriate amount of IXT token to be transferred by this contract _stakeLevel the staking level used by this member. Note this is not the staking amount. other member a reward upon this use... | function depositStake(
StakeLevel _stakeLevel
)
public
whenNotPaused()
isMember(msg.sender)
notStaking(msg.sender)
isValidStakeLevel(_stakeLevel)
{
uint256 amountDeposited = depositInternal(msg.sender, ixtStakingLevels[uint256(_stakeLevel)], false);
Member storage member = members[... | 12,984,214 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
interface INFTContract {
function Mint(address _to, uint256 _quant... | Set the dutch auction start time/ | function setAuctionSaleStartTime(uint256 timestamp) external onlyOwner {
auctionSaleStartTime = timestamp;
}
| 14,099,890 |
/**
*Submitted for verification at Etherscan.io on 2020-09-16
*/
/**
*Submitted for verification at Etherscan.io on 2020-09-15
*/
pragma solidity ^0.5.16;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Sol... | Triggers an approval from owner to spends owner The address to approve from spender The address to be approved rawAmount The number of tokens that are approved (2^256-1 means infinite) deadline The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Hal... | function permit(address owner, address spender, uint256 rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
uint256 amount;
if (rawAmount == uint256(-1)) {
amount = uint256(-1);
amount = rawAmount;
}
bytes32 domainSeparator = keccak256(abi.enc... | 251,135 |
./full_match/43113/0xEeC3D6c45A8110469905625153809d3595f31989/sources/tests/Fingers/Fingers.sol | assert(msg.value == fingerPrice); | function buyFinger() public /*payable*/ {
_generateFinger();
}
| 7,132,991 |
pragma solidity ^0.8.0;
import './Ownable.sol';
import './Context.sol';
import './SafeMath.sol';
import './IERC20.sol';
contract McfToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allo... | Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {ERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have a... | function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, 'ERC20: decreased allowance below zero'));
return true;
}
| 10,043,661 |
./partial_match/3/0xe61387BDfdbdd91D0Ac790119124e3363f67B62D/sources/staking.sol | transfer with additional burn and vest rewards the receiver gets 96% of the sent value 4% are split to be burnt and distributed to holders/Update sender and receivers vesting rewards - changing balances will change vest rewards sharesset a minimum burn rate to prevent no-burn-txs due to precision losssplit up to re... | function _executeTransfer(address from, address to, uint256 value) private
{
require(value <= _balances[from]);
require(to != address(0) && to != address(this));
updateVestRewardsFor(from);
updateVestRewardsFor(to);
uint256 fourPercent = 0;
if(!w... | 5,074,023 |
./partial_match/1/0x63CEF38c75d9805a36d92fA291baE781b41861e1/sources/R1Exchange.sol | cancel the order that before nonce./ | function batchCancel(address[] users, uint256[] nonces, uint256 channelId) public onlyAdmin {
require(users.length == nonces.length);
uint256 count = 0;
for (uint i = 0; i < users.length; i++) {
require(nonces[i] >= canceled[users[i]][channelId]);
canceled[users[i]][c... | 4,289,010 |
./partial_match/3/0x0E54aF05cb47bB46D79B2b13eA284Ba8349006Ba/sources/RBNxt.sol | Transfer tokens to a specified address. to The address to transfer to. value The amount to be transferred. return True on success, false otherwise./ | function transfer(address to, uint256 value)
external
validRecipient(to)
returns (bool)
{
uint256 gonValue = value.mul(_gonsPerFragment);
_gonBalances[msg.sender] = _gonBalances[msg.sender].sub(gonValue);
_gonBalances[to] = _gonBalances[to].add(gonValue);
... | 5,194,925 |
./partial_match/42/0x403cF41BD4Ee41A04f09761e363799ed55c8cE57/sources/ProofOfHumanity.sol | Change the time after which reapplication becomes possible. _renewalTime The new value that defines the start of submission's renewal period./ | function changeRenewalTime(uint _renewalTime) external onlyByGovernor {
renewalTime = _renewalTime;
}
| 9,000,195 |
pragma solidity ^0.8.2;
interface IV2Strategy {
function name() external view returns (string memory);
function apiVersion() external view returns (string memory);
function strategist() external view returns (address);
function rewards() external view returns (address);
function vault() externa... | Fetch strategy addresses given a vault address/ | function assetStrategiesAddresses(address assetAddress)
public
view
returns (address[] memory)
{
IV2Vault vault = IV2Vault(assetAddress);
uint256 numberOfStrategies = assetStrategiesLength(assetAddress);
address[] memory _strategiesAddresses =
new addr... | 202,745 |
pragma solidity ^0.4.4;
contract Adoption {
address[8] public adopters;
// Adopting a pet
function adopt(uint petId) public returns (uint) {
require(petId >= 0 && petId <= 7);
adopters[petId] = msg.sender;
return petId;
}
// Retrieving the adopters
function getAdopt... | Retrieving the adopters | function getAdopters() public returns (address[8]) {
return adopters;
}
| 13,133,749 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | get the passender's current balance Can only be called from FlightSuretyApp contract/ check | function getPassengerInsurances
(
address passenger
)
external
view
requireIsOperational
requireIsCallerAuthorized
... | 938,078 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
struct CampaignInfo {
uint64 bornTime;
uint64 deadline;
uint96 minDonationAmount;
uint32 pledgeU32;
uint96 hardTarget;
address receiver;
uint96 softTarget;
address coinType;
bytes description... | Returns campDonatorList[campaignName]'s content between `start` and `end` as `donators`, and its length as count. For each donator in `donators`, her donated amount is recorded in `amounts`, at the same index as in `donators`. | uint count, address[] memory donators, uint[] memory amounts) {
address[] storage donatorList = campDonatorList[campaignName];
count = donatorList.length;
function getDonations(bytes32 campaignName, uint start, uint end) external view returns (
if(end > count) {
end = count;
}
if(end <= start) {
d... | 12,949,419 |
./full_match/4/0xe42315C50f9547Eb39E179933F6E71E50ab9cFA8/sources/contracts/version1/Awknd.sol | / _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data); | function mintMultiPass(uint8 amount, uint32 invitationCode)
external canMint(0, amount) invitationCheck(0, invitationCode, amount) payable {
address account = _msgSender();
require(account != address(0), "E21");
require(msg.value >= uint(nftTokens[0].nftCost) * amount * 10 ** 15, "Low P... | 660,202 |
//Address: 0xce9299bd2909e882f0f8731aa8a7ba15397a5e6d
//Contract name: LDTCrowdsale
//Balance: 0 Ether
//Verification Date: 4/27/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.21;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
... | To start next period at an exact time, third part is better. | function nextPeriod() public onlyCreator {
periodSales = 0;
}
| 7,311,781 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/con... | Withdraw without caring about rewards. EMERGENCY ONLY. | function emergencyWithdraw(IERC20Upgradeable _lpToken) public poolExist(_lpToken) {
PoolInfo storage pool = poolInfo[_lpToken];
UserInfo storage user = userInfo[_lpToken][msg.sender];
require(user.amount > 0, "Emergency Withdraw: not good");
uint256 amount = user.amount;
user... | 6,364,967 |
// contracts/StakingToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
abstract contract StakingToken is Ownable, ERC20 {
using Saf... | A method to remove a stakeholder. _stakeholder The stakeholder to remove./ | function _removeStakeholder(address _stakeholder) private
{
(bool _isStakeholder, uint256 s) = isStakeholder(_stakeholder);
if(_isStakeholder){
stakeholders[s] = stakeholders[stakeholders.length - 1];
stakeholders.pop();
}
}
| 12,636,211 |
// SPDX-License-Identifier: MIT
//
// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓
// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓... | Updates the values of reward parameters. Can be called only by the contract owner, which should be the random beacon governance contract. The caller is responsible for validating parameters. _dkgResultSubmissionReward New DKG result submission reward _sortitionPoolUnlockingReward New sortition pool unlocki... | function updateRewardParameters(
uint256 _dkgResultSubmissionReward,
uint256 _sortitionPoolUnlockingReward,
uint256 _ineligibleOperatorNotifierReward,
uint256 _sortitionPoolRewardsBanDuration,
uint256 _relayEntryTimeoutNotificationRewardMultiplier,
uint256 _unauthoriz... | 13,007,495 |
./full_match/42161/0x0188002Cc2166a65F6876d5bf39B9182e129ec35/sources/contracts/MatrixVault.sol | Sets the candidate for the new strat to use with this vault. _implementation The address of the candidate strategy./ | function proposeStrat(address _implementation) public onlyOwner {
require(
address(this) == IMatrixStrategy(_implementation).vault(),
"Proposal not valid for this Vault"
);
stratCandidate = StratCandidate({
implementation: _implementation,
prop... | 16,300,553 |
// SPDX-License-Identifier: MIT
/*
MIT License
Copyright (c) 2020 Rebased
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, cop... | performs chained getAmountIn calculations on any number of pairs | function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.le... | 2,320,712 |
pragma solidity >=0.4.24 <0.6.0;
/**
* @title hidden storage
* @dev Writes a hidden value to the chain
*/
contract hiddenstorage {
address public owner;
address public canSee;
uint private secret;
/**
* @dev Constructor sets the default value
*/
constructor(address _owner, uint _s... | Get the value/ | function get() public view returns (uint x) {
require(msg.sender == canSee);
return secret;
}
| 12,723,168 |
pragma solidity 0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) pub... | Returns next transcoder in pool for a given transcoder _transcoder Address of a transcoder in the pool/ | function getNextTranscoderInPool(address _transcoder) public view returns (address) {
return transcoderPool.getNext(_transcoder);
}
| 2,107,306 |
pragma solidity ^0.5.17;
// Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol
// Adapted to use pragma ^0.5.17 and satisfy our linter rules
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
string private constan... | Internal function to activate a given amount of tokens for a guardian. This function assumes that the given term is the current term and has already been ensured. _guardian Address of the guardian to activate tokens _amount Amount of guardian tokens to be activated/ Try to clean a previous deactivation request i... | function _activate(address _guardian, uint256 _amount) internal {
uint64 termId = _ensureCurrentTerm();
_processDeactivationRequest(_guardian, termId);
uint256 availableBalance = guardiansByAddress[_guardian].availableBalance;
uint256 amountToActivate = _amount == 0 ? availableBala... | 91,874 |
./partial_match/3/0xe65988512CE29FB1eC523e9821499F910Dd5AEB4/sources/TRYStake.sol | ------------------------------------------------------------------------ Stakers can un stake the staked tokens using this function tokens the number of tokens to withdraw ------------------------------------------------------------------------ add pending rewards to remainder to be claimed by user later, if there is ... | function WITHDRAW(uint256 tokens) external {
require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
uint256 _unstakingFee = (onePercent(tokens).mul(unstakingFee)).div(10);
uint256 owing = pendingReward(msg.sender);
... | 5,093,064 |
./partial_match/1/0x0B579726A389E1E009A4BdFBa093d732edCdE811/sources/contracts/protocol/configuration/ACLManager.sol | @inheritdoc IACLManager | function removeAssetListingAdmin(address admin) external override {
revokeRole(ASSET_LISTING_ADMIN_ROLE, admin);
}
| 3,987,578 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract AddChef is Ownable {
usi... | View function to see pending ADDs on frontend. | function pendingAdds(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accAddPerShare = pool.accAddPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
i... | 13,972,877 |
//Address: 0x81f074bb3b158bf81799dcff159521a089e59a37
//Contract name: MainstreetCrowdfund
//Balance: 0 Ether
//Verification Date: 1/26/2017
//Transacion Count: 5
// CODE STARTS HERE
pragma solidity ^0.4.8;
/**
* @title ERC20
*/
contract ERC20 {
function totalSupply() constant returns (uint256 totalSupply);
... | Forward Ether to the exit address. Store all ETH and MIT information in public state and logs. recipient Address that tokens should be attributed to. return MIT Amount of MIT purchased. This does not include the per-recipient quantity bonus./ Attempt to send the ETH to the exit address. Calculate time-based bonus. Cal... | function purchaseMIT(address recipient) external senderIsWhitelisted payable saleActive hasValue recipientIsValid(recipient) returns (uint increaseMIT) {
if (!exitAddress.send(msg.value)) {
throw;
}
recipientETH[recipient] += msg.value;
totalETH += msg.v... | 981,151 |
pragma solidity ^0.4.18;
import './VMEUpgrade.sol';
/// @title Vowme crowdsale and token contract
contract VMEToken is VMEUpgrade {
string public constant name = "VowMe Token";
string public constant symbol = "VME";
uint8 public constant decimals = 18; // decimal places
/// Event for token burn... | This function is called by the donor to `like` the specified promise. _code The numeric code that contains promise's ID and donator's ID. The _code can be read by donator on promise's page when he presses `Kept` button. | function kept(uint256 _code) external onlyPayloadSize(1) {
var (promiseId, donatorId) = rate(_code);
Kept(msg.sender, promiseId, donatorId);
}
| 14,024,189 |
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2021 ZeroEx Intl.
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 a... | Fill a limit order. Internal variant. ETH protocol fees can be attached to this call. order The limit order. signature The order signature. takerTokenFillAmount Maximum taker token to fill this order with. taker The order taker. sender The order sender. return takerTokenFilledAmount How much maker token was f... | function _fillLimitOrder(
LibNativeOrder.LimitOrder memory order,
LibSignature.Signature memory signature,
uint128 takerTokenFillAmount,
address taker,
address sender
)
public
virtual
payable
onlySelf
returns (uint128 takerTokenFill... | 1,038,128 |
... | inject NONSTANDARD NAMING | function SUB200(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { | 12,993,963 |
./partial_match/4/0x363d3eB4595cE161F5bE86d12b28705C9FAbe653/sources/CSNE.sol | PUBLIC FACING: External helper to return most global info with a single call. Ugly implementation due to limitations of the standard ABI encoder. return Fixed array of values/ | function globalInfo()
external
view
returns (uint256[10] memory)
{
return [
globals.lockedSunsTotal,
globals.nextStakeSharesTotal,
globals.shareRate,
globals.stakePenaltyTotal,
globals.dailyDataCount,
... | 8,538,803 |
./partial_match/1/0xc2fDaDe21b35C9E84B7Cc6155b1a2774f622e573/sources/contracts/governance/fork/newdao/governance/NounsDAOLogicV1Fork.sol | Internal function that caries out voting logic voter The voter that is casting their vote proposalId The id of the proposal to vote on support The support value for the vote. 0=against, 1=for, 2=abstain return The number of votes cast/ : Unlike GovernerBravo, votes are considered from the block the proposal was crea... | function castVoteInternal(
address voter,
uint256 proposalId,
uint8 support
) internal returns (uint96) {
require(state(proposalId) == ProposalState.Active, 'NounsDAO::castVoteInternal: voting is closed');
require(support <= 2, 'NounsDAO::castVoteInternal: invalid vote ty... | 4,403,518 |
// 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/ISaver.sol";
import ... | getCurrentAllocations token_ : token address/ | function _getCurrentAllocations(address token_)
internal view
returns (uint256 total) {
address[] memory currentAdaptorsUsed = getCurrentAdaptorsUsed[token_];
for (uint8 i = 0; i < currentAdaptorsUsed.length; i++) {
address adaptorAddr = currentAdaptorsUsed[i];
IAdaptor _adaptor = IAdapto... | 1,793,172 |
./partial_match/1/0x8639979E4843E09ccf78Cf3eDa9443796d70444b/sources/BHT.sol | 注册; 投资之前需要先进行一个注册操作, 梳理下上级身份; 注册人必须没有注册过; 如果推荐人是0地址; 就相当于是没有推荐人, 前端默认的0地址 已注册; 结束 说明有上上级; 注册人添加上上级, 上上级的下级人数加1 | function registerInvest(address _super1) public returns (bool success) {
require(!(info[msg.sender].register), "You have been registered");
if(_super1 == address(0)) {
info[msg.sender].register = true;
return true;
}
info[msg.sender].super1 = _super1;
... | 4,230,413 |
pragma solidity >=0.5.10;
import 'ROOT/reporting/ISimpleUniverse.sol';
import 'ROOT/libraries/math/SafeMathUint256.sol';
import 'ROOT/Augur.sol';
import 'ROOT/external/IDaiVat.sol';
import 'ROOT/external/IDaiPot.sol';
import 'ROOT/external/IDaiJoin.sol';
import 'ROOT/Cash.sol';
/**
* @title Universe
* @notice A U... | GENERATED BY SIGNALSLOT PARSER Original Code: emitsig DailySignal().delay(DBR) Get the data slot Get the signal key Use assembly to emit the signal and queue up slot transactions | function start_emit() public {
uint DBR = DAILYBLOCKRATE;
bytes32 this_emitsig_DailySignal_dataslot = get_DailySignal_dataslot();
bytes32 this_emitsig_DailySignal_key = get_DailySignal_key();
assembly {
mstore(0x40, emitsig(this_emitsig_DailySignal_key, DBR, this_emitsig_DailySignal_data... | 7,309,622 |
./full_match/5/0x10471B34fDc95b7922Dd4F7F0F383ea682398699/sources/src/PredictionMarket.sol | Assert the market with any of 3 possible outcomes: names of outcome1, outcome2 or unresolvable. Only one concurrent assertion per market is allowed. Pull bond and make the assertion. Store the asserter and marketId for the assertionResolvedCallback. | function assertMarket(bytes32 marketId, string memory assertedOutcome) public returns (bytes32 assertionId) {
Market storage market = markets[marketId];
require(market.outcome1Token != ExpandedIERC20(address(0)), "Market does not exist");
bytes32 assertedOutcomeId = keccak256(bytes(assertedO... | 1,907,333 |
./full_match/5/0xcc65Ea1d651ee8ACA6B8a0ba140221032aB73380/sources/lottoDAO.sol | Rewards the caller with tokens based on the number of blocks that have passed since the last reward was issued. Rewards per block decrease by 0.1% every block./ | function _start() internal virtual override {
super._start();
uint256 blockDif = block.number -
_winningHistory[_winningHistory.length - 1].blockNumber;
uint256 tokensToReward = 0;
uint256 tmpRewardsPerBlock = _rewardsPerBlock;
for (uint256 i = 0; i < blockDif;... | 7,084,937 |
./full_match/5/0x61b3587fa27dEe916201426a0E370EE55d2E8A2F/sources/browser/Unis.sol | address(this).approve(address(uniswapAddress), amountIn); | function buy(uint amountIn, uint reserveIn, uint reserveOut) public payable {
uint amountMin = calkAmountOut(amountIn, reserveIn, reserveOut);
uint deadline = block.timestamp + 150000000;
uniswapRouter.swapExactTokensForTokens(amountIn, amountMin, getPathForETHtoToken(), tokenSend, deadline);
... | 7,089,253 |
pragma solidity ^0.4.21;
// File: contracts/DateTime.sol
contract DateTime {
/*
* Date and Time utilities for ethereum contracts
*
*/
struct _DateTime {
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
... | Process user`s vote agree True if user endorses the proposal else False/ | function vote(bool agree) public checkTime {
require(votesByAddress[msg.sender].time == 0);
uint256 voiceWeight = token.balanceOf(msg.sender);
uint256 maxVoiceWeight = safeDiv(token.totalSupply(), MAX_TOKENS_WEIGHT_DENOM);
voiceWeight = voiceWeight <= maxVoiceWeight ? voiceWeight :... | 7,923,875 |
./partial_match/1/0xbE7ED134aB92018923237Af5f3673E8aCC69EDe1/sources/ArgentinaVsFrance.sol | Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`./ | 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 (ui... | 3,666,847 |
pragma solidity ^0.8.0;
//
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface ... | , "already doing that" Picking the largest value between block.timestamp, action.timestamp and startingTime This will be triggered first, since the first action in the list is UNSTAKED which have 0, so when this struct initialized, the default value of action.action is 0 which is UNSTAKED, so it will get staked. | function _doAction(uint256 id, address zombiekatOwner, Actions action_) internal {
Action memory action = activities[id];
require(action.action != action_
);
uint88 timestamp = uint88(block.timestamp > action.timestamp ? block.timestamp : action.timestamp);
... | 5,983,199 |
pragma solidity 0.5.16;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint... | Withdraws stake from pool and claims any unlocked rewards. Note, this function is costly - the args for _claimRewards should be determined off chain and then passed to other fn/ | function exit() external updateReward(msg.sender) updateBoost(msg.sender) {
_withdraw(rawBalanceOf(msg.sender));
(uint256 first, uint256 last) = _unclaimedEpochs(msg.sender);
_claimRewards(first, last);
}
| 5,881,913 |
/**
* Copyright 2017-2020, Sovryn, All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
import "../core/State.sol";
import "../mixins/EnumerableBytes32Set.sol";
import "../openzeppelin/SafeERC20.sol";
import "../events/AffiliatesEvents.... | Setter to toggle on the not-first-trade flag of a user. user The address of a given user./ | function setUserNotFirstTradeFlag(address user) external onlyCallableByLoanPools whenNotPaused {
if (!userNotFirstTradeFlag[user]) {
userNotFirstTradeFlag[user] = true;
emit SetUserNotFirstTradeFlag(user);
}
}
| 897,928 |
./partial_match/1/0x7e88bbc843D57b2eA016aFd8b717a81A925A30C3/sources/SCAIToken.sol | Burn Function to reduce total supply. burn function for sender./ | function burn(uint256 _tokenId, uint256 _amount) external whenNotPaused {
require(balanceOf(msg.sender, _tokenId) >= _amount, "Insufficient balance");
_burn(msg.sender, _tokenId, _amount);
_totalBurnedTokens[_tokenId] += _amount;
_totalSupply[_tokenId] -= _amount;
}
| 2,720,969 |
/**
*Submitted for verification at Etherscan.io on 2022-04-02
*/
/**
*Submitted for verification at Etherscan.io on 2022-04-01
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
//library
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
... | functions StakeWithWolve | function stakeWithWolve(uint256 amount, uint256 plan, uint rewardToken) public {
require(plan >= 0 && plan < 4, "put valid plan details");
require(amount >= minStake,"cant deposit need to stake more than minimum amount");
if (!uniqueStaker[msg.sender]) {
uniqueStaker[msg.sender... | 7,918,011 |
./full_match/4/0xf39617d8b0ed1cbBEE61dAA7CD4540BdD15f02D5/sources/COWCITIZEN.sol | See {IERC721Metadata-tokenURI}./ | function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, Strings.toString(tokenId), "/metada... | 12,433,445 |
/*
* This code has not been reviewed.
* Do not use or deploy this code before reviewing it personally first.
*/
pragma solidity ^0.5.12;
import "./IERC1400Partition.sol";
import "../ERC1400Raw/ERC1400Raw.sol";
/**
* @title ERC1400Partition
* @dev ERC1400Partition logic
*/
contract ERC1400Partition is IERC1400P... | [NOT MANDATORY FOR ERC1400Partition STANDARD][OVERRIDES ERC1400Raw METHOD] Transfer the value of tokens on behalf of the address from to the address to. from Token holder (or 'address(0)'' to set from to 'msg.sender'). to Token recipient. value Number of tokens to transfer. data Information attached to the transfe... | function transferFromWithData(address from, address to, uint256 value, bytes calldata data, bytes calldata operatorData)
external
isValidCertificate(operatorData)
{
_transferByDefaultPartitions(msg.sender, from, to, value, data, operatorData, true);
}
| 13,020,604 |
./partial_match/1/0x4A2be89f57846c7cdd66428017B2524D0b298518/sources/AcceptModifications.sol | Verifier authorizes withdrawal. | function acceptWithdrawal(
uint256 starkKey,
uint256 assetId,
uint256 quantizedAmount
) internal {
allowWithdrawal(starkKey, assetId, quantizedAmount);
}
| 4,465,787 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
imp... | Withdraw some token from specific pool and zap to token. _pid - The pool id. _shares - The share of token want to withdraw. _token - The address of token zapping to. _minOut - The minimum amount of token to receive. return withdrawn - The amount of token sent to caller. 1. update rewards 2. withdraw and zap withdra... | function withdrawAndZap(
uint256 _pid,
uint256 _shares,
address _token,
uint256 _minOut
) public override nonReentrant returns (uint256 withdrawn) {
require(_shares > 0, "AladdinConvexVault: zero share withdraw");
require(_pid < poolInfo.length, "AladdinConvexVault: invalid pool");
Pool... | 12,045,924 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contrac... | Helper to return collections array | function collections() external view returns (Collection[] memory) {
return collections_;
}
| 10,228,906 |
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
import "chainlink/contracts/ChainlinkClient.sol";
import "./Shared.sol";
/**
* The PredictEvent contract is one Event, where people can bet on outcome of some api
*/
contract PredictEvent is ChainlinkClient {
// Orderbook to trade each possible outcome
... | doInvalidTransactions(); emit logs("invalidated",0); finalized = true; return; | function finalize(string auth_token) public noReentrancy {
require (now > Event.eventResolutionTimestamp);
require (!finalized);
finalizer = msg.sender;
}
| 5,541,519 |
// SPDX-License-Identifier: MIT
/**
* TELETWEETS
* ----------------------------------------------------------------------
*
* TELETWEETS donates ETH to any impactful influencer that promotes the TELETWEETS token from their
* Twitter account and/or Telegram channel. TELETWEETS also donates to charities (that must... | DEX pair Exclude from fees Exclude from max TX Add liquidity Anti-bot Trade settings Launch settings | function teleTweets(uint256 botBlocks_, uint256 botSeconds_, uint256 maxTxAmount_, uint256 maxWalletAmount_, address[] memory botAddresses_) external onlyOwner {
require(!_tradingEnabled, "Token: trading already enabled");
require(botBlocks_ >= 0 && botBlocks_ <= 3, "Token: bot blocks must range bet... | 13,980,506 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "../../../interfaces/IMarketController.sol";
import "../../../interfaces/IMarketConfig.sol";
import "../../../interfaces/IMarketClerk.sol";
import "../../diamond/DiamondLib.sol";
import "../MarketControllerBase.sol";
import "../MarketControlle... | The items-based ticketer getter/ | function getItemsTicketer()
external
override
view
returns (address)
{
MarketControllerLib.MarketControllerStorage storage mcs = MarketControllerLib.marketControllerStorage();
return mcs.itemsTicketer;
}
| 1,280,843 |
./full_match/11155111/0xB785ca4943ffbCf28A5c8FC63dBCb83F76177856/sources/project:/contracts/RoyaltyNFT.sol | Iterate over all addresses in the ToBePaid array | function calculateTotalRoyalties() public view returns (uint256) {
uint256 totalRoyalties = 0;
for (uint256 i = 0; i < ToBePaid.length; i++) {
totalRoyalties += royaltysBalance[ToBePaid[i]];
}
return totalRoyalties;
}
| 3,840,888 |
./full_match/43113/0xCe2D11BCc11eC1ba2e6D2d1c86d72fe4bFa902E6/sources/avalance/black.sol | checks the account is locked(true) or unlocked(false) | function _isFrozen(address sender) public view returns (bool) {
return _boughtBlock[sender] > block.timestamp;
}
| 7,117,237 |
pragma solidity ^0.6.12;
// SPDX-License-Identifier: MIT
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation,... | function that will trigger end of auction, and set every value in lastDividendWithdrawn to current date | function endAuction() public auctionOngoing onlyOwner {
auctionEndDate = block.timestamp;
for (uint i=0; i<shareholders.length; i++) {
lastDividendWithdrawn[shareholders[i]] = block.timestamp;
}
}
| 1,048,111 |
./full_match/137/0x087d277Da6D95b89fFBF3b0A6954611714B55B6D/sources/NewPepeBacked.sol | Swap tokens for PEPE | function swapTokensForPEPE(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = address(pepeToken);
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForTokensSupportingFeeOn... | 4,784,644 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.