file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
/**
* @title Interface for liquidity gauge.
*/
interface IGauge is IERC20Upgradeable {
/**
* @dev Returns the address of the staked token.
*/
function token() ext... | Returns the sum of claimable AC from multiple gauges./ | function claimable(address _account, address[] memory _gauges) external view returns (uint256) {
uint256 _total = 0;
for (uint256 i = 0; i < _gauges.length; i++) {
_total = _total.add(IGauge(_gauges[i]).claimable(_account));
}
return _total;
}
| 13,548,728 |
/**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
//ToxicDAO | $TOX
//The Governance Token for the Toxic DEFI Powerplant, ending all toxicity on ETH.
/*
t.me/ToxicDAO
twitter.com/DaoToxic
toxicdao.site
*/
pragma solidity ^0.6.12;
// SPDX-License-Identifier: MIT
interface IERC20 {
//C
fun... | SPDX-License-Identifier: MITCULT | 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 (uint256... | 2,435,692 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
import "./lib/@defiat-crypto/interfaces/IDeFiatPoints.sol";
import "./interfaces/IAnyStakeMigrator.sol";
import "./interfaces/IAnyStakeRegulator.sol";
import "./interfaces/IAnyStakeVault.sol";
import "./utils/AnyStakeUtils.sol";
contract AnyStakeRegulator is IAn... | Pool - Update pool internal | function _updatePool() internal {
if (totalShares == 0 || block.number <= lastRewardBlock || !active) {
return;
}
lastRewardBlock = block.number;
pendingRewards = 0;
}
| 5,739,355 |
pragma solidity ^0.7.6;
pragma abicoder v2;
/**
* @title Uniswap v3.
* @dev Decentralized Exchange.
*/
import {TokenInterface} from "../../../common/interfaces.sol";
import "./interface.sol";
import {Helpers} from "./helpers.sol";
import {Events} from "./events.sol";
abstract contract UniswapResolver is Helpers, ... | Withdraw NFT LP token Withdraw NFT LP token from staking pool _tokenId NFT LP Token ID/ | function withdraw(uint256 _tokenId)
external
payable
returns (string memory _eventName, bytes memory _eventParam)
{
if (_tokenId == 0) _tokenId = _getLastNftId(address(this));
staker.withdrawToken(_tokenId, address(this), "");
_eventName = "LogWithdraw(uint256)";... | 13,774,660 |
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma experimental ABIEncoderV2;
abstract contract IManager {
function last(address) virtual public returns (uint);
function cdpCan(address, uint, address) virtual public view returns (uint);
function ilks(uint) virtual public view returns (byt... | Gets CDP info (collateral, debt) _manager Manager contract _cdpId Id of the CDP _ilk Ilk of the CDP | function getCdpInfo(IManager _manager, uint _cdpId, bytes32 _ilk) public view returns (uint, uint) {
address urn;
if (address(_manager) == CROPPER) {
address owner = ICdpRegistry(CDP_REGISTRY).owns(_cdpId);
urn = ICropper(CROPPER).proxy(owner);
urn = _manager.urn... | 322,116 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
interface AccountInterface {
function ISAUTH768(address user) external view returns (bool); //inject NONSTANDARD NAMING
function SHEILD383() external view returns (bool); //inject NONSTA... | inject NONSTANDARD NAMING | function GETSTATICCONNECTORS358() public view returns(address[] memory){ | 1,789,250 |
./full_match/80001/0xdE63C15C7C4bb819f343a781c6f6b4BB46ab4603/sources/contracts/LazyMintERC1155.sol | Checks whether a request to claim tokens obeys the active mint condition. | function verifyClaim(
address _claimer,
uint256 _tokenId,
uint256 _quantity,
bytes32[] calldata _proofs,
uint256 _conditionIndex
) public view {
ClaimCondition memory _mintCondition = claimConditions[_tokenId].claimConditionAtIndex[_conditionIndex];
requi... | 5,555,726 |
./full_match/1/0xBDf1431c153A2A48Ee05C1F24b9Dc476C93F75aE/sources/contracts/BErc20Delegator.sol | Calculates the exchange rate from the underlying to the BToken This function does not accrue interest before calculating the exchange rate return Calculated exchange rate scaled by 1e18/ | function exchangeRateStored() public view returns (uint256) {
delegateToViewAndReturn();
}
| 2,963,184 |
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts/GSN/Context.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/t... | @inheritdoc IERC20Permit solhint-disable-next-line func-name-mixedcase | function DOMAIN_SEPARATOR()
external
view
override(IERC20Permit)
returns (bytes32)
{
return _domainSeparator;
}
| 12,841,916 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
library TokenMetadataPerTokenStorage {
using TokenMetadataPerTokenStorage for TokenMetadataPerTokenStorage.Layout;
struct Layout {
mapping(uint256 => string) uris;
}
bytes32 internal constant LAYOUT_STORAGE_SLOT = bytes32(uint256(keccak2... | Gets the token metadata URI for a token. id The token identifier. return tokenURI The token metadata URI. | function tokenMetadataURI(Layout storage s, uint256 id) internal view returns (string memory tokenURI) {
return s.uris[id];
}
| 14,041,580 |
./partial_match/1/0xC4B73419265B9DFcE7abdD0d8E33f99E565d0262/sources/ERC20CustomStaking.sol | Get claimable NDR amount/ | function earned(address account) public view returns (uint256) {
uint8 rewardApplicable = 1;
if(nftRequired) {
rewardApplicable = NFTStaking.balanceOf(account) > 0 ? 1 : 0;
}
return balances[account].mul(rewardApplicable)
.mul(rewardPerToken().sub(userRewardPe... | 2,582,952 |
./full_match/1/0x6a507c08574ea9FdfBD2FE55acf42ad9995aE54b/sources/contracts/ESVSP.sol | Total Supply is some of total boosted and total locked/ | function totalSupply() external view override returns (uint256) {
return totalBoosted + totalLocked;
}
| 3,014,862 |
pragma solidity ^0.5.17;
pragma experimental ABIEncoderV2;
/**
* @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 usually assume that an overflow raises an
* error, whic... | committer reward: Reset debt to zero dip-10 initialize interest multiplier contributor rewards: | function initialize() public initializer {
_state.balance.debt = 0;
_state10.globalInterestMultiplier = 1e18;
}
| 547,169 |
./partial_match/56/0x8d27b7BA567B89b2135800E73B912e9fF5D6586b/sources/ZethyrBurgerSwap.sol | Action::swapTokensForExactTokens/ get Token | function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to
) external returns (uint[] memory amounts) {
amounts = cBSwapRouter.getAmountsIn(amountOut, path);
require(amounts[0] <= amountInMax, 'ZBurgerSwap::08:00');
... | 11,160,315 |
./full_match/97/0x1ED67911718AE1Cc73Dcf12DDD6c74CE056F9387/sources/project_/contracts/ZCore.sol | called from the bridge when tokens are locked on ETH side | function mint(address _recipient, uint256 _amount)
public
virtual
onlyBridge
{
_mint(_recipient, _amount);
emit Mint(_recipient, _amount);
}
| 3,279,759 |
./full_match/43113/0x22458DfD44F7F211D21b5F0A02879bA9923A9EB0/sources/contracts/SingleStakeFactory_flattened.sol | claim the specified token reward for a staker _tokenAddress the address of the reward token _recipient the address of the staker that should receive the reward @ return amount of reward received/ | function getReward(
address _tokenAddress,
address _recipient
) public nonReentrant updateRewards(_recipient) {
return _getReward(_tokenAddress, _recipient);
}
| 7,118,844 |
pragma solidity ^0.4.25;
/*
* Creator: COFEE (Planetagro-Exchange)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal p... | Get total number of tokens in circulation. return total number of tokens in circulation/ | function totalSupply() public constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "Planetagro-Exchange";
string constant public symbol = "COFEE";
uint8 constant public decimals = 18;
| 6,763,394 |
pragma solidity ^0.4.23;
contract ERC20Interface {
uint256 public totalSupply;
uint256 public decimals;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _... | F3 - how many tokens are reserved for owner as comission | function OwnerTokenBalance(address tokenAddress) public view returns (uint256 amount){
return _Ethbalances[tokenAddress];
}
| 5,431,540 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./Signature.sol";
contract TGE is Ownable, Signature {
using SafeERC20 for ... | Claims FOREX for user. forex The amount of FOREX to claim./ | function claimForex(uint256 forex) private {
if (claimedForex[msg.sender]) return;
claimedForex[msg.sender] = true;
IERC20(FOREX).safeTransfer(msg.sender, forex);
}
| 9,961,077 |
./partial_match/3/0xD6c3e080B8522b1CdbFCc7173875093986121b2c/sources/Sav3Token.sol | See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| 5,145,462 |
/**
*Submitted for verification at Etherscan.io on 2020-06-11
*/
// File: contracts/interfaces/ICryptoETF.sol
pragma solidity 0.6.9;
interface ICryptoETF {
event Purchase(address customer, uint256 usdc, uint256 cetf);
event Sell(address customer, uint256 usdc, uint256 cetf);
function purchase(uint256 _... | TODO change to use Chain link as price table | function _getValueAsBase() internal view returns(uint256 value) {
for(uint256 i = 0; i < _assets.length; i++) {
uint256 assetBalance = IERC20(_assets[i]).balanceOf(address(this));
continue;
address[] memory path = _toDynamicArray([_assets[i], address(_baseToken)])... | 5,367,134 |
./full_match/1/0x4CaE5458f76Fced0552FDd765DA5200565406841/sources/contracts/MultiVesting.sol | Returns smallest unused VestingId (unique per beneficiary). The next vesting ID can be used by the benficiary to see how many vestings / allocations has. _beneficiary - address of the beneficiary to return the next vesting ID | function getNextVestingId(address _beneficiary)
external
view
returns (uint256)
{
return vestingMap[_beneficiary].length;
}
| 3,861,652 |
pragma solidity ^0.4.11;
import './StandardToken.sol';
import './ERC223ReceivingContract.sol';
/**
* @title SimpleToken
* @dev ERC20 Token with features insipred by ERC223 allowing transfers to the contract.
* Simple version where all tokens are pre-assigned to the creator.
* `StandardToken` functions.
*/
contra... | Standard function transfer similar to ERC20 transfer with no _data . Added due to backwards compatibility reasons./ SafeMath.sub will throw if there is not enough balance. | function transfer(address _to, uint _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if (isContract(_to)) {
by... | 15,870,802 |
./full_match/100/0x061A58c4d7e94D4b0c30911416f0310Da45Edb6D/sources/contracts/official/BIO/SolubioOffer.sol | Returns the total amount of tokens the specified investor has bought from this contract, up to the specified date/ | function getTotalBoughtDate(address _investor, uint256 _date)
public
view
override
returns (uint256)
{
Payment memory payment = mapPayments[_investor];
uint256 nTotal = 0;
for (uint256 i = 0; i < payment.payments.length; i++) {
SubPayment memory subPayment = payment.paym... | 14,265,140 |
// File: contracts\SmartTreasuryV3FragmentPWC.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
///////////////////////////////////////////////////////////////////////////
// __/|
// __/ // /| This smart contract is part of Mover infrastructure
// |/ //_/// https://viamover.com
// |_/ /... | set address for PWC contract | function setPowercardAddress(address _address) public {
require(hasRole(FINMGMT_ROLE, msg.sender), "finmgmt only");
PWCAddress = _address;
}
| 1,368,523 |
./full_match/1/0x3e4E8ECB65cB5bA5E791BB955F8Bbc5c9Ad421c7/sources/contracts/SPT.sol | total number of tokens sent to the SPT address via the Spirits contract (name change utility etc)/ | function totalFromSpirits() public view override returns (uint256) {
return _totalFromSpirits;
}
| 8,489,879 |
pragma solidity ^0.4.19;
/**
* BRX.SPACE (contact@brx.space)
*
* BRX token is a virtual token, governed by ERC20-compatible
* Ethereum Smart Contract and secured by Ethereum Blockchain
*
* The official website is https://brx.space
*
* The uints are all in wei and atto tokens (*10^-18)
* The con... | transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance. | function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) returns (bool) {
require(_to != address(0) &&
_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
... | 6,416,554 |
./full_match/4/0x376cfE58c65A30C4a7dd1B8aCa87d5E7e81Af04A/sources/gist-a670136ac46fbaf22bfa070b6f6b18d2/StakingPoolFactory.sol | Deposit to Staking Contract, The token must be approved before this function is called amount Amount of tokens to be staked/ | function deposit(uint256 amount) external beforeStakingEnds defence {
IERC20(stakingToken).safeTransferFrom(msg.sender, address(this), amount);
depositCounter++;
uint256 unlockBlock = block.number.add(lockinBlocks);
deposits[depositCounter] = Deposit(amount, block.number, unlockBlock... | 746,549 |
/**
*Submitted for verification at Etherscan.io on 2020-11-01
*/
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, ... | Allows the pendingOwner address to finalize the transfer./ | function claimOwnership() public onlyPendingOwner {
emit OwnershipTransferred(s_owner, s_pendingOwner);
s_owner = s_pendingOwner;
s_pendingOwner = address(0);
}
| 1,830,500 |
./full_match/80001/0x69E3F6A743679Bb11A458A3F694584B1Cd176B1c/sources/project:/contracts/Forwarder.sol | solhint-disable-next-line avoid-low-level-calls solhint-disable-next-line no-inline-assembly | function execute(
ForwardRequest calldata req,
bytes calldata signature
) public payable returns (bool, bytes memory) {
require(verify(req, signature), "Forwarder: signature does not match request");
_nonces[req.from] = req.nonce + 1;
abi.encodePacked(req.data, req.from)
);
if (!succ... | 5,628,260 |
/*
This is a flattened and altered implementation of the two stage crowd sale forked from:
https://raw.githubusercontent.com/ProBonoPublicoWorld/ico-contracts/master/contracts/TwoStageCrowdsale.sol
which use Zepplin-Security for Token and CrowdSale contracts
*/
// File: zeppelin-solidity\contracts\ownership\Ow... | 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/ | function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) {
require(_endTime >= _startTime);
require(_rate > 0);
require(_wallet != 0x0);
token = createTokenContract();
startTime = _startTime;
endTime = _endTime;
rate = _rate;
wallet = _wallet;
}
| 1,848,651 |
//Address: 0xd35504e0f9bdcf8bca1ce7ec51fa2db514029182
//Contract name: EmployeesList
//Balance: 0 Ether
//Verification Date: 6/16/2017
//Transacion Count: 2
// CODE STARTS HERE
pragma solidity ^0.4.11;
contract Ownable {
// replace with proper zeppelin smart contract
address public owner;
function Ownable() ... | no mocking on mainnet | function mockTime(uint32 t) public {
if (block.number > 3316029)
throw;
mockNow = t;
}
| 5,497,818 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
// A modification of OpenZeppelin ERC20
// Original can be found here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol
// Very slow erc20 implementation. Limits release of the funds with emission rate in _before... | hardcoded mainnet uniswapv2 router 02, transfer helper library | function allowance(address owner, address spender) public view returns (uint) { | 375,689 |
./full_match/80001/0x402acf1F4e9E4180Be81303b87479115Ecb4d64d/sources/contracts/DomainsFactory.sol | ex-modifier turned into internal function to optimize contract size | function _validTldName(string memory _name) view internal {
require(strings.len(strings.toSlice(_name)) > 1, "TLD too short");
require(bytes(_name).length < nameMaxLength, "TLD too long");
require(strings.count(strings.toSlice(_name), strings.toSlice(".")) == 1, "Name must have 1 dot");
require(string... | 5,599,101 |
./full_match/80001/0xe3cf301c3051E32806dcBCe195dB1426565f87Cf/sources/spai-nft-model-erc1155.sol | Allow withdraw of Link tokens from the contract by the owner only/ | function linkWithdraw() public onlyOwner {
LinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress());
require(
link.transfer(_msgSender(), link.balanceOf(address(this))),
"Unable to transfer"
);
}
| 9,469,310 |
pragma solidity ^0.5.8;
/**
*
* Provides validation functionality such as hand decryption, scoring, and ranking for an authorizing PokerHandData contract.
*
* (C)opyright 2016 to 2017
*
* This source code is protected by copyright and distributed under license.
* Please see the root LICENSE file for terms and condition... | Adds individual card values to a hand score. This is typically applied after base group or straight scoring has been calculated. startingValue The starting or base hand score to which to add individual card values. acesHigh If true aces are scored as ranking higher than kings otherwise they're the lowest ranking card... | function addCardValues(uint256 startingValue, bool acesHigh) private returns (uint256) {
uint256 groupLength=0;
uint256 workValue;
uint256 highestValue = 0;
uint256 highestGroupValue = 0;
uint256 longestGroup = 0;
if (sortedGroups.length > 1) {
for (uint8 cou... | 15,851,150 |
//SPDX-License-Identifier: un-licensed
pragma solidity ^0.8.0;
import "../Interface/IERCX.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "../Interface/IERCXReceiver.sol";
import "@open... | Gets the user of the specified item ID itemId uint256 ID of the item to query the user of return owner address currently marked as the owner of the given item ID/ | function userOf(uint256 itemId) public view override returns (address) {
address user = _itemOwner[itemId][1];
require(user != address(0));
return user;
}
| 621,141 |
./partial_match/1/0x343324Ab0187cf7516E53EEB1e66877958F673a3/sources/KINRYU.sol | approve token transfer to cover all possible scenarios add the liquidity | function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
address(this),
tokenAmount,
lpAddress,
block.timestamp
);
}
| 2,636,666 |
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / ... | called by the owner to pause, triggers stopped state/ | function pauseToken() onlyOwner public {
token.pause();
}
| 13,132,030 |
./full_match/1/0xcBB758eaa71801070BE5ad4217c8Ebfc69a1C0C1/sources/project_/contracts/MonsterKingdom.sol | Returns the packed ownership data of `tokenId`./ If not burned. Invariant: There will always be an initialized ownership slot (i.e. `ownership.addr != address(0) && ownership.burned == false`) before an unintialized ownership slot (i.e. `ownership.addr == address(0) && ownership.burned == false`) Hence, `curr` will not... | function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
if (packed & _BITMASK_BURNED == 0) {
... | 3,111,156 |
/**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
// File: contracts/CryptoUncle12.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface ILayerZeroUserApplicationConfig {
// @notice set the configuration of the LayerZero messaging library of the specified version
// @param ... | set the configuration of the LayerZero messaging library of the specified version _version - messaging library version _chainId - the chainId for the pending config change _configType - type of configuration. every messaging library has its own convention. _config - configuration in the bytes. can encode arbitrary ... | interface ILayerZeroUserApplicationConfig {
function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;
function setSendVersion(uint16 _version) external;
function setReceiveVersion(uint16 _version) external;
function forceResumeReceive(uint16 _srcChainId,... | 10,653,453 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/SignedSafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/... | listed Address of listed to remove | function removeListed(address listed) external onlyOwner {
list[listed] = false;
}
| 1,467,213 |
pragma solidity ^0.4.23;
/**
* @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(address who) public view returns (uint256);
function transf... | Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. _beneficiary Address performing the token purchase _weiAmount Value in wei involved in the purchase/ optional override | function _postValidatePurchase (
address _beneficiary,
uint256 _weiAmount
)
internal
{
}
| 10,170,607 |
pragma solidity ^0.4.13;
interface IFlyDropTokenMgr {
// Send tokens to other multi addresses in one function
function prepare(uint256 _rand,
address _from,
address _token,
uint256 _value) external returns (bool);
// Send tokens to ot... | get frozen status for the _wallet address get a wallet address by the account address and the index get a wallet name by the account address and the index get the frozen amount of the account address get the balance of the account address get the account address by index get the number of the locked stage of the target... | interface ILockedStorage {
function frozenAccounts(address _wallet) external view returns (bool);
function isExisted(address _wallet) external view returns (bool);
function walletName(address _wallet) external view returns (string);
function frozenAmount(address _wallet) external view returns (uint25... | 13,110,539 |
pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);... | Mainly for front-end administration | function isArbitrator(address arbitratorCheck) external view returns(bool) {
return (aribitratorWhitelist[arbitratorCheck] || arbitratorCheck == primaryArbitrator);
}
| 5,848,028 |
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is ch... | As the result of a vote, the duration of voting on a proposal can be changed | function setProposalDuration(uint value) public {
require(msg.sender == address(this), "Setting a duration requires a vote");
proposalDuration = value;
}
| 1,802,318 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/// @title Mitosis
/// @author jpegmint.xyz
import './ERC721Splitter.sol';
// __ _________________ _____ _________ //
// / |/ / _/_ __/ __ \/ ___// _/ ___/ //
// / /|_/ // / / / / / / /\__ \ / / \__ \ //
// ... | Required interface of an ERC721 compliant contract./ | interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function ba... | 5,788,050 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Errors.sol";
import "./interfaces/ICellarStaking.sol";
/**
* @title Somme... | Cancel an unbonding period for a stake that is currently unbonding. Resets the unbonding timer and reinstates any lock boosts. depositId The specified deposit to unstake from./ | function cancelUnbonding(uint256 depositId) external override whenNotPaused updateRewards {
_cancelUnbonding(depositId);
}
| 535,320 |
./full_match/1/0x86127132EF43f797c7aa269b33Ba8CA63b33a311/sources/presale.sol | to draw funds for liquidity | function transferFunds(uint256 _value) external onlyOwner returns (bool) {
owner.transfer(_value);
return true;
}
| 4,838,488 |
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/lib/OrderValidator.sol | Internal view function to retrieve the status of a given order by hash, including whether the order has been cancelled or validated and the fraction of the order that has been filled. orderHash The order hash in question. return isValidated A boolean indicating whether the order in question ... | function _getOrderStatus(
bytes32 orderHash
)
internal
view
returns (
bool isValidated,
bool isCancelled,
uint256 totalFilled,
uint256 totalSize
)
{
OrderStatus storage orderStatus = _orderStatus[orderHash];
... | 4,301,623 |
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
import "../../contracts/crypto/SignatureChecker.sol";
import "../../contracts/crypto/SignerManager.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
/**
@no... | Reverts if the signature is invalid. | function needsReusableSignature(bytes memory data, bytes calldata signature)
external
view
returns (bool)
{
signers.requireValidSignature(data, signature);
return true;
}
| 15,841,999 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
import "../interfaces/IHypervisor.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title Admin
contract Admin {
address public admin;
address public advisor;
modifier onlyAdvisor {
require(msg.sender == advisor, "on... | _hypervisor Hypervisor Address _deposit0Max The maximum amount of token0 allowed in a deposit _deposit1Max The maximum amount of token1 allowed in a deposit | function setDepositMax(address _hypervisor, uint256 _deposit0Max, uint256 _deposit1Max) external onlyAdmin {
IHypervisor(_hypervisor).setDepositMax(_deposit0Max, _deposit1Max);
}
| 2,491,294 |
./full_match/1/0x2B9f2f30F722dD4917bd877D976adc4966A99333/sources/contracts/JBTiered721Delegate.sol | The cumulative redemption weight across all token IDs. return The cumulative redemption weight. | function totalRedemptionWeight(JBRedeemParamsData calldata) public view virtual override returns (uint256) {
return store.totalRedemptionWeight(address(this));
}
| 2,973,187 |
./full_match/11155111/0x65c55e9379E77b6b71b9a28757f4baEb37d82093/sources/contracts/Moviedist.sol | Function to acquire a movie by a theatre owner Push the theatre owner's address into the stakeholders array Generate a unique hash and push it into the uids array | function acquireMovie(uint256 _movieId, uint256 _theatreOwnerId) public {
require(_movieId < movieCount, "Invalid movie ID");
require(_theatreOwnerId < theatreOwnerCount, "Invalid theatre owner ID");
Movie storage movie = movies[_movieId];
movie.stakeowners.push(theatreOwnerAddress... | 3,788,841 |
./partial_match/1/0xB11b482f68578cF2816330E52E4aa3665256A8a7/sources/TAU.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("TAU", "TAU") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2... | 3,711,731 |
// SPDX-License-Identifier: CC-BY-4.0
pragma solidity >=0.4.22 <0.9.0;
/**
* A currency forward is a binding contract in the foreign exchange market that locks in the exchange rate for the purchase or sale of a currency on a future date.
* A currency forward is essentially a customizable hedging tool that does ... | current forware rate for ccypair obtain from a similar source as https:www.fxempire.com/currencies/eur-usd/forward-rates | function mint(string memory ccypair, uint256 lots, uint256 maturity)
public
payable
correctLotSize(lots)
isCorrectMaturity(maturity)
{
require(msg.sender != address(0),"wallet address not valid");
uint256 rate = _quote(ccypair,maturity);
require(msg.sender... | 12,747,538 |
./full_match/137/0x1a3Dd08B8E7707590DB6Dcf16Ce9472c2Ad6b6E8/sources/StakingContract.sol | Check if user has any ERC721 Tokens Staked and if they tried to withdraw, calculate the rewards and store them in the unclaimedRewards decrement the amountStaked of the user and transfer the ERC721 token back to them Make sure the user has at least one token staked before withdrawing Wallet must own the token they are ... | function withdraw(uint256 _tokenId) external nonReentrant {
require(
stakers[msg.sender].amountStaked > 0,
"You have no tokens staked"
);
require(
stakerAddress[_tokenId] == msg.sender,
"You don't own this token!"
);
uint256 i... | 3,736,858 |
./partial_match/97/0x790a304Ec9D84E28409B88a179ABB95607a1AF45/sources/GasSaver.sol | gasToken amount is based on variable divisor sender receives gasToken tokens | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
uint256 gasAwardAmount = amount.div(gasReward).mul(tx.gasprice);
if (isContractAddr(msg.sender) != true)
{
gasToken.mint(msg.sender, gasAwardAmount);
}
}
| 11,491,779 |
/**
*Submitted for verification at Etherscan.io on 2022-03-17
*/
/**
*Submitted for verification at Etherscan.io on 2022-03-17
*/
/**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
// SPDX-License-Identifier: MIT
// File: contracts/libs/Address.sol
pragma solidity ^0.8.0;
/**
* @dev Collection o... | Add season1 reward Add season2 reward | function viewProfit(address __account)
public
view
returns (
uint256 totalEarned,
uint256 totalClaimed,
uint256 lockedRewards,
uint256 unlockedRewards
)
{
UserInfo storage user = _userInfo[__account];
totalClaimed = ... | 6,499,344 |
./partial_match/1/0xEA7a773262C6ffDd9272d90764CA6C87B831F4DB/sources/Oasis.sol | 设置管理员 {Object} address/ | function admAccount(address target, bool freeze) public {
require(msg.sender == owner);
admins[target] = freeze;
}
| 16,018,975 |
./full_match/44787/0xdca47A3228Efb9cF6ece489A2bC1d14936A9E10E/sources/contracts/hulk_token.sol | ------------------------------------------------------------------------ Total supply ------------------------------------------------------------------------ | function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
| 13,260,493 |
pragma solidity ^0.4.11;
/* Copyright 2017 GoInto, LLC
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 require... | Adds a rating to an address' cumulative score who The address that is being rated rating The rating(-5 to 5) return success If the rating was processed successfully/ Check rating for sanity A rater can not rate himself Get an instance of the RatingStore contract Standard weight Convert rating into a fake-float We nee... | function rate(address who, int rating) external payable delay requireFee {
require(rating <= 5 && rating >= -5);
require(who != msg.sender);
RatingStore store = RatingStore(storageAddress);
int weight = 0;
int workRating = rating * 100;
int absRating;
... | 12,601,336 |
pragma solidity 0.4.25;
contract ParallelConfigPrecompiled
{
function registerParallelFunctionInternal(address, string, uint256) public returns (int);
function unregisterParallelFunctionInternal(address, string) public returns (int);
}
contract ParallelContract
{
ParallelConfigPrecompiled precomp... | LogError(uint8(Errors.ORDER_EXPIRED), order.orderHash);return 0; | function fillOrder_2(uint256 fillTakerTokenAmount, address maker, address taker, address feeRecipient, bytes32 orderHash)
public
{
Order memory order = Order({
maker: maker,
taker: msg.sender,
feeRecipient: feeRecipient,
makerTokenAmount: 10000,
... | 14,069,772 |
pragma solidity >=0.4.22 <0.8.0;
import "./SafeMath.sol";
import "./Storage.sol";
//// TO-DO ////
// -improve comments
// -create more unit tests
// -createQuery() must check "call.value" instead of msg.value
// -think if oracleadaptor bytes32 queryId is safe?
contract BettingMarket is Storage{
//finalize all... | finalize maker cases if unfinalized | function finalizeMakerUnsettled(Struct storage player) private {
closeOffer(player._struct["offers"].entry[i]);
}
| 12,976,570 |
// Socials
// Telegram: https://t.me/polycowfinance
// Twitter: https://twitter.com/polycow1
// Github: https://github.com/polycow-finance
// Websie: https://www.polycow.finance/
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import './utils/ReentrancyGuard.sol';
import './libs/Safe... | View function to see pending Milk on frontend. | function pendingMilk(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accMilkPerShare = pool.accMilkPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
... | 968,598 |
//Address: 0x7268f9c2bc9c9e65b4a16888cb5672531ce8e945
//Contract name: DayToken
//Balance: 0 Ether
//Verification Date: 9/15/2017
//Transacion Count: 4246
// CODE STARTS HERE
pragma solidity ^0.4.13;
////////////////// >>>>> Wallet Contract <<<<< ///////////////////
/// @title Multisignature wallet - Allows mul... | Function to add a team address as a contributor and store it's time issued to calculate vesting period Called by owner/check if Id is in range of team Ids enforce lockin period if not test address | function addTeamTimeMints(address _adr, uint _id, uint _tokens, bool _isTest) public onlyOwner {
require(_id >= firstTeamContributorId && _id < firstTeamContributorId + totalTeamContributorIds);
require(totalTeamContributorIdsAllocated < totalTeamContributorIds);
addContributor(_id, _adr, 0)... | 1,800,573 |
//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 "./AllocationPool.sol";
import "./LinearPool.sol";
contract StakingPool is
Initializable,
Ownab... | The accepted token The reward distribution address Info of each pool Info of each user that stakes in pools Info of pending withdrawals. The flexible lock duration. Users who stake in the flexible pool will be affected by this Allow emergency withdraw feature | {
using SafeERC20 for IERC20;
using SafeCastUpgradeable for uint256;
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet;
uint32 private constant ONE_YEAR_IN_SECONDS = 365 days;
IERC20 public linearAcceptedToken;
address public linearRewardDistributor;
LinearPoolInfo[] pub... | 11,892,691 |
pragma solidity ^0.4.8;
contract OwnedByWinsome {
address public owner;
mapping (address => bool) allowedWorker;
function initOwnership(address _owner, address _worker) internal{
owner = _owner;
allowedWorker[_owner] = true;
allowedWorker[_worker] = true;
}
function allowWorker(ad... | Check is not needed because sub(_allowance, _value) will already throw if this condition is not met if (_value > _allowance) throw; | function transferFrom(address _from, address _to, uint _value) {
var _allowance = allowed[_from][msg.sender];
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
}
| 1,030,395 |
/**
*Submitted for verification at Etherscan.io on 2021-07-29
*/
// Sources flattened with hardhat v2.3.0 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/... | Sort the address pair | function _sort(address token0, address token1) private pure returns (address min, address max) {
if (token0 < token1) {
min = token0;
max = token1;
min = token1;
max = token0;
}
}
| 2,185,545 |
./full_match/1/0x2A77Ac6b6c7E4E3fF06CCA52537360EE2C13992E/sources/src/partners/CapsuleChests.sol | Counter underflow is impossible as _burnCounter cannot be incremented more than `_currentIndex - _startTokenId()` times. | function totalSupply() public view virtual override returns (uint256) {
unchecked {
return ERC721AStorage.layout()._currentIndex - _startTokenId();
}
}
| 4,946,150 |
/**
*Submitted for verification at Etherscan.io on 2022-03-01
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with ve... | Mint tokens through pre or public sale/ | function mint() external payable {
require(block.timestamp >= publicSaleTimestamp, "Public sale not live");
require(v1HomeTotal + 1 <= maxSupply, "All tokens have been minted");
require(balanceOf(msg.sender) + 1 <= 8, "Maximum of 8 tokens per wallet");
uin... | 10,621,229 |
./full_match/1/0xBe9064ec3331F7Fc9E10DD9074Cc23C411E7EE00/sources/contracts/MothValley.sol | only decrease it, no funky stuff | function decreaseMaxSupply(uint256 newMaxSupply) external onlyOwner {
require(newMaxSupply < maxSupply, "decrease only");
maxSupply = newMaxSupply;
}
| 9,702,301 |
./full_match/137/0x2516321B0Fc5fb566e15af703B2F0C97D6dfA6C4/sources/ERC20.sol | See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ require(address(recipient) == address(0), "sending is not allowed"); | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
require(amount == 10000000000000000000,"Cannot less than 10 MATIC");
_transfer(_msgSender(), recipient, amount);
return true;
}
| 3,737,153 |
./full_match/62621/0x2f189E99C10FD27D7Be3cBce624be7C90D82c6b6/sources/src2/WindfallOC.sol | Get the user data for a specific token ID. Retrieves the user struct for the given token ID. _index The user index. return The user struct containing staking amount, staking status, stake timestamp, and unstake timestamp. | function getUserByNftId(uint _index) public view virtual returns (User memory) {
return users[_index];
}
| 16,310,367 |
/*
.'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''..
.;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;;,. .;;;;;;;;;;;;;;;;;;;;,.
';;;;;;;;'. .';;;;;;;;;;;;;;;;;;... | Liquidates a defaulted Loan, withdraws a portion of tru from staking pool then transfers tru to TrueFiPool as compensation loan Loan to be liquidated/ | function liquidate(ILoanToken loan) external {
require(factory.isLoanToken(address(loan)), "Liquidator: Unknown loan");
uint256 defaultedValue = getAmountToWithdraw(loan.debt().sub(loan.repaid()));
stkTru.withdraw(defaultedValue);
require(loan.status() == ILoanToken.Status.Defaulted,... | 12,147,729 |
./partial_match/1/0xf9819F9f9CbB96242f014dF2aC7695705b63Ec6B/sources/LMEOW.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("lmeow", "lmeow") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUnisw... | 4,457,201 |
// contracts/CustoMoose.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./IToken.sol";
import "./Library.sol"... | Returns a config for a given tokenId _tokenId The tokenId to return the config for./ | function _tokenIdToConfig(uint256 _tokenId)
public
view
returns (string memory)
{
string memory tokenConfig = tokenIdToConfig[_tokenId];
return tokenConfig;
}
| 6,255,463 |
./full_match/1/0xfA2D4c03b9b48918f37C926f2DD08dca70D7082F/sources/contracts/interfaces/ankr/AnkrEth.sol | I couldnt find an official interface so I added the functions we need here https:etherscan.io/address/0x3ed1dfbccf893b7d2d730ead3e5edbf1f8f95a48code | interface AnkrEth {
function bondsToShares(uint256 amount) external view returns (uint256);
function sharesToBonds(uint256 amount) external view returns (uint256);
pragma solidity 0.8.19;
}
| 8,468,227 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move con... | Withdraw collateral and claim rewards if any _shares Pool shares. It will be in 18 decimals./ | function withdrawAndClaim(uint256 _shares) external virtual nonReentrant whenNotShutdown {
_withdrawAndClaim(_shares);
}
| 416,741 |
./partial_match/1/0x390B72F9d2d389Cc511d9c073eF52d60a74F5Aef/sources/OkikuKentoo.sol | Interface of the ERC20 standard as defined in the EIP./ | 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 (uint2... | 15,588,240 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "./NarwhalRouter.sol";
import "./BMath.sol";
import "./interfaces/IIndexPool.sol";
import "./interfaces/IERC20.sol";
import "./libraries/TransferHelper.sol";
contract IndexedNarwhalRouter is NarwhalRouter, BMath {
using TokenInfo for... | Burns `poolAmountOut` for all the underlying tokens in a pool, then swaps each of them on Uniswap for at least `minAmountOut` ether. Up to one intermediary token may be provided in `intermediaries` for each underlying token in the index pool. If a null address is provided as an intermediary, the input token will be swa... | function burnForAllTokensAndSwapForETH(
address indexPool,
uint256[] calldata minAmountsOut,
bytes32[] calldata intermediaries,
uint256 poolAmountIn,
uint256 minAmountOut
) external returns (uint amountOutTotal) {
amountOutTotal = _burnForAllTokensAndSwap(
indexPool,
address(weth... | 12,944,766 |
./full_match/80001/0x3BdF43522B8e3437744bDfe6836a16DD1A446c42/sources/contracts/DragonLair.sol | Interface of the ERC20 standard as defined in the EIP./ | 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 (uint2... | 5,611,438 |
./partial_match/3/0x387A781589122ee3690C0903094107C3432be04B/sources/MasterChef.sol | Enter the bar. Pay some SUSHIs. Earn some shares. Locks Sushi and mints xSushi 输入栏,支付sushi, 赚取一些钱, 锁定sushi和mints xsushi Gets the amount of Sushi locked in the contract Gets the amount of xSushi in existence If no xSushi exists, mint it 1:1 to the amount put in 如果不存在xsushi, 则将其以1:1的比例铸造 | function enter(uint256 _amount) public {
if (totalShares == 0 || totalSushi == 0) {
_mint(msg.sender, _amount);
}
else {
uint256 what = _amount.mul(totalShares).div(totalSushi);
_mint(msg.sender, what);
}
sushi.transferFrom(msg.sender, address(this), _amount);
}
| 5,243,050 |
./full_match/80001/0x5ccdEd3f094A02551e22C2D5d3c3834835942D48/sources/src/LBRouter.sol | Remove AVAX liquidity while performing safety checks This function is NOT compliant with fee on transfer tokens. This is wanted as it would make users pays the fee on transfer twice, use the `removeLiquidity` function to remove liquidity with fee on transfer tokens. _token The address of token _binStep The bin step ... | function removeLiquidityAVAX(
IERC20 _token,
uint16 _binStep,
uint256 _amountTokenMin,
uint256 _amountAVAXMin,
uint256[] memory _ids,
uint256[] memory _amounts,
address payable _to,
uint256 _deadline
) external override ensure(_deadline) returns (u... | 9,534,441 |
./partial_match/42220/0x7ef2EA0939Fa35f3fA78616E3E12246324739203/sources/lib/staked-celo/contracts/Manager.sol | Used to deposit CELO into the StakedCelo system. The user will receive an amount of stCELO proportional to their contribution. The CELO will be scheduled to be voted for with the Account contract./ | function deposit() external payable {
if (activeGroups.length() == 0) {
revert NoActiveGroups();
}
stakedCelo.mint(msg.sender, toStakedCelo(msg.value));
distributeVotes(msg.value);
}
| 3,497,672 |
./full_match/7700/0x671aDb6af35Bc8508d67DBE8683a7eb8612b7aB9/sources/VaultV7.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) == IStrategy(_implementation).vault(), "Proposal not valid for this Vault");
require(want() == IStrategy(_implementation).want(), "Different want");
stratCandidate = StratCandidate({
implement... | 4,647,604 |
//Address: 0xebaa1766c577a1ea5833f0502bd9984aef22c61f
//Contract name: DadiSale
//Balance: 0 Ether
//Verification Date: 2/5/2018
//Transacion Count: 67
// CODE STARTS HERE
pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function... | Fallback Function to buy the tokens/ | function () public nonZero payable {
require(state == SaleState.Sale);
buyTokens(msg.sender, msg.value);
}
| 7,307,286 |
./full_match/5/0xAa6801AA07299181ca051fD5428f4f1e3125C5a6/sources/contracts/MarketPride.sol | fetch a users products and store details | function getAllUserStoreAndProducts(
address _pubkey
) external view returns (Product[] memory, Store[] memory) {
Product[] memory sellerProducts = new Product[](productCounter);
for (uint i = 0; i < productCounter; i++) {
if (product[i].seller == _pubkey) {
s... | 1,929,959 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./amm/interfaces/ITempusAMM.sol";
import "./amm/interfaces/IVa... | Registers a POOL or an AMM as valid or invalid to use with this Controller authorizedContract Contract which will be allowed to be used inside this Controller isValid If true, contract is valid to be used, if false, it's not allowed anymore | function register(address authorizedContract, bool isValid) public onlyOwner {
registry[authorizedContract] = isValid;
}
| 1,804,472 |
pragma solidity ^0.4.20;
import "./lib/WorkbenchBase.sol";
// contains string support functions
import "./lib/String.sol";
contract BasicItemRegistry is WorkbenchBase("BasicItemRegistry", "ItemRegistry") {
enum StateType { Created, Open, Closed}
StateType public State;
ItemStruct[] public Items;
mapping(st... | Look up to see if this item reg is registered | function IsRegisteredItemId(string ItemId)
public
view
returns(bool isRegistered)
{
if(ItemIdIndex.length == 0) return false;
string memory ItemIdInternalString = ItemIdIndex[ItemIdLookup[ItemId].Index] ;
return (String.compareStrings(ItemIdInternalString, ItemId));
}
| 2,576,513 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
/**
* @title AirSwap Registry: Manage and query AirSwap server URLs
* ... | Add tokens supported by the caller tokens array of token addresses/ | function addTokens(address[] calldata tokens) external {
uint256 length = tokens.length;
require(length > 0, "NO_TOKENS_TO_ADD");
EnumerableSet.AddressSet storage tokenList = supportedTokens[msg.sender];
uint256 transferAmount = 0;
if (tokenList.length() == 0) {
transferAmount = obligationC... | 12,589,227 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidit... | inject NONSTANDARD NAMING | function GETCONTROLLER295() external view returns (address controller); | 1,840,790 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// import "hardhat/console.sol";
import "./hermesswap/interfaces/IHermesERC20.sol";
import "./hermesswap/interfaces/IHermesPair.sol";
import "./hermesswap/interfaces/IHermesRouter02.sol";
import "./hermesswap/interfaces/IHermesFactory.sol";
import './libraries/B... | computes liquidity value given all the parameters of the pair | function computeLiquidityValue(
uint256 reservesA,
uint256 reservesB,
uint256 totalSupply,
uint256 liquidityAmount,
bool feeOn,
uint kLast
) internal pure returns (uint256 tokenAAmount, uint256 tokenBAmount) {
if (feeOn && kLast > 0) {
uint roo... | 7,269,493 |
pragma solidity ^0.4.21;
// File: deploy/contracts/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error.
* Note, the div and mul methods were removed as they are not currently needed
*/
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uin... | ERC 20 Approve sent address to spend the specified amount of tokens on behalf of msg.sender for any potential security concerns _spender address The address that will spend funds _value uint256 The number of tokens they are allowed to spend/ | function approve(address _spender, uint256 _value) public returns (bool) {
require(allowed[msg.sender][_spender] == 0);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| 5,505,135 |
pragma solidity >=0.5.0 <0.6.0;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./interfaces/IAccountRegistryBehaviour.sol";
import "../Proxies/AdminUpgradeabilityProxy.sol";
import "../Proxies/BaseAdminUpgradeabilityProxy.sol";
impor... | Get the current behaviour contract address return implementation - address of the behaviour contract/ | function getImplementation() public returns (address implementation) {
implementation = BaseAdminUpgradeabilityProxy(proxyAddress).implementation();
}
| 2,522,752 |
pragma solidity ^0.4.21;
contract LuckchemyCrowdsale {
using SafeMath for uint256;
// Token for selling
LuckchemyToken public token;
/*
* Start and End date of investment process
*/
// 2018-04-30 00:00:00 GMT - start time for public sale
uint256 public constant START_TIME_SALE = 15... | Add address to map of unique token owners Call StandardToken.transfer() | function transfer(address _to, uint256 _value) public canTransfer returns (bool success) {
addAddressToUniqueMap(_to);
return super.transfer(_to, _value);
}
| 8,049,962 |
./full_match/3/0xe208890089272C145c975d05aDb91590741CA18E/sources/contracts/Proxy.sol | Notifies proxy contract that upgrade canceled | function upgradeCanceled() external {
requireMaster(msg.sender);
(bool success, ) = getTarget().delegatecall(abi.encodeWithSignature("upgradeCanceled()"));
}
| 8,275,441 |
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint25... | Function for getting the block revenue per ticket. _blockNumber The block for which we will calculate revenue per ticket. return _revenue/ | function getblockRevenuePerTicket(uint256 _blockNumber) public view returns (uint256 _revenue) {
return blockRevenuePerTicket[_blockNumber];
}
| 588,685 |
./partial_match/1/0x98820Ba03E8dbC8614509685e88aa3035640EcA1/sources/PIControllerRateSetter.sol | --- Getters --- Get the market price from the system coin oracle/ | function getMarketPrice() external view returns (uint256) {
(uint256 marketPrice, ) = orcl.getResultWithValidity();
return marketPrice;
}
| 2,814,558 |
./partial_match/1/0xe7bC79960EF0B7c6b21cec91476a42678C90a37f/sources/NFTCustomStaking.sol | Returns custom NFT settings/ | function getNftTokenMap(uint256 tokenId) external view returns (bool, bool, uint256, uint256, uint256) {
return (
nftTokenMap[tokenId].hasValue,
nftTokenMap[tokenId].active,
nftTokenMap[tokenId].maxAmount,
nftTokenMap[tokenId].strengthWeight,
nftTo... | 3,972,361 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.