file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/7700/0xfDf5Ed2D354e05cF292808CF94Bd5c972D842D09/sources/contracts/lens/CrocQuery.sol | Queries and returns the liquidity and tokens held by a single knockout position. Note that the returned quantities do not include accumulated rewards. owner The address that owns the liquidity position base The base token address of the pair quote The quote token address of the pair poolIdx The inde... | function queryKnockoutTokens (address owner, address base, address quote,
uint256 poolIdx, uint32 pivot, bool isBid,
int24 lowerTick, int24 upperTick)
public view returns (uint128 liq, uint128 baseQty, uint128 quoteQty, bool knockedOut) {
... | 3,506,694 |
./partial_match/3/0x29559C18447e9079aD31c54166cd1194Afa74BC5/sources/Token.sol | adds dividends to the account _to | function payDividendsTo(address _to) internal {
var (hasNewDividends, dividends) = calculateDividendsFor(_to);
if (!hasNewDividends)
return;
if (0 != dividends) {
_to.transfer(dividends);
PayDividend(_to, dividends);
}
m_lastAccountEmissi... | 5,110,463 |
./partial_match/1/0x6b3E82Ddc85710Ed9c32C61b317ADE1b2A80FC77/sources/LoanManager.sol | implements: 0x76ba6009 = approveRequest(bytes32) | function requestLoan(
uint128 _amount,
address _model,
address _oracle,
address _borrower,
uint256 _salt,
uint64 _expiration,
bytes calldata _loanData
) external returns (bytes32 id) {
require(_borrower != address(0), "The request should have a bor... | 2,884,857 |
./full_match/1/0x82a7b5842085f434c6584A8c44b6A1C15c25a512/sources/contracts/test/ExternalCollateralLiquidator.sol | @inheritdoc ICollateralLiquidator/ | function liquidate(
address currencyToken,
address collateralToken,
uint256 collateralTokenId,
bytes calldata collateralWrapperContext,
bytes calldata liquidationContext
) external nonReentrant {
if (collateralToken == address(0) || currencyToken == address(0)) re... | 9,659,467 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import "@openzepp... | Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/ | interface IERC20Extended is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
pragma solidity 0.7.6;
}
| 1,688,568 |
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c... | maps time to new Price | function updatePriceAndDenominator(uint256 newNumerator, uint256 newDenominator) external onlyManagingWallets {
require(now > fundingEndTime);
require(newDenominator > 0);
require(newNumerator > 0);
require(safeSub(now, waitTime) >= previousUpdateTime);
currentPrice.denominator = newDenominator;
cur... | 6,925,702 |
./full_match/5/0x634aE0be3242aE6b8c2d0Aef977d530Ed7Fa1b64/sources/Users/pynix/PUMP/contracts/Oracle.sol | overflow is desired, casting never truncates cumulative price is in (uq112x112 price seconds) units so we simply wrap it after division by time elapsed | function consultNow(address token, uint amountIn) external view returns (uint amountOut) {
(uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) =
UniswapV2OracleLibrary.currentCumulativePrices(address(pair));
FixedPoint.uq112x112 memory price0AverageNow;
FixedP... | 7,057,790 |
./partial_match/1/0x869fb8A354a565F7576009A88F2e8b7159A20010/sources/LazyButts.sol | lionId Id of token to mint Mints token to owner/ | function mintButt(uint lionId) external payable onlySender mintActive {
require(!_exists(lionId), "Token already minted");
require(msg.value == price, "Not enough ether sent");
address lion = LazyLions.ownerOf(lionId);
_mint(lion, lionId);
emit Mint(lion, lionId);
}
| 2,891,706 |
./partial_match/1/0xa9c46D6215CD099305ddDcc5e8B8846728385e03/sources/BridgeToken.sol | Transfers are disabled. Wrapped tokens can only be bridged or unwrapped./ | function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(
false,
"Transfers are disabled. Wrapped tokens can only be bridged or unwrapped."
);
require(from != address(0), "ERC20: transfer from the zero addre... | 2,588,398 |
pragma solidity ^0.5.3;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract ExampleToken {
using SafeMath for uint256;
string public name = "ExampleToken";
string public symbol = "XMPL";
address public owner;
uint256 public totalSupply;
mapping(address => uint256) public balances;
ui... | Transfer token for a specified address _to The address to transfer to. _value The amount to be transferred. return True if the transfer succeeded./ | function transfer(address _to, uint256 _value) public returns (bool) {
require(balances[msg.sender] >= _value);
balances[msg.sender] -= _value;
balances[_to] += _value;
return true;
}
| 1,801,917 |
// File: @onchain-id/solidity/contracts/IERC734.sol
pragma solidity ^0.6.2;
interface IERC734 {
... | inject NONSTANDARD NAMING | function ISTOKENBOUND101(address _token) external view returns (bool); | 5,524,153 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.8.0;
// Sources flattened with hardhat v2.8.4 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.5.0
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC20 standard as de... | Burn unneeded or excess FPI. Burn any leftover FPI | function burnFPI(bool burn_all, uint256 fpi_amount) public onlyByOwnGov {
if (burn_all) {
FPI_TKN.burn(FPI_TKN.balanceOf(address(this)));
}
else FPI_TKN.burn(fpi_amount);
}
| 1,301,281 |
./full_match/1/0x3c95775ba56bFcd337998CC84f0388251d6AEC7B/sources/lib/multicaller/src/LibMulticaller.sol | The address of the multicaller contract./ The address of the multicaller with sender contract./ Returns the caller of `aggregateWithSender` on `MULTICALLER_WITH_SENDER`./ @solidity memory-safe-assembly | function multicallerSender() internal view returns (address result) {
assembly {
if iszero(
staticcall(
)
result := mul(mload(0x00), eq(returndatasize(), 0x20))
}
}
| 2,925,152 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.4;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {SafeERC20} from "../libs/SafeERC20.sol";
import {
ERC1155Receiver
} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol";
import {
IERC721Receiver
}... | zap into curve create deposit transfer vest token out | function zapCurveDeposit(
address pool,
address vesting,
address swapAddress,
address inputToken,
uint256 inputTokenAmount,
uint256 minOutputTokenAmount,
uint64 maturationTimestamp
) external active {
DInterest poolContract = DInterest(pool);
... | 879,879 |
./partial_match/1/0x3CF90663216378760b3f841b20cA19C5c39795cc/sources/FadedArcade.sol | Change quantity for global limit | function setPublicLimit(uint256 _limit) public onlyOwner nonReentrant {
publicLimit = _limit;
}
| 2,678,475 |
//Address: 0x8eaffe914e5bbf6784236d3f702549d8c9533d03
//Contract name: CryptoBabyName
//Balance: 0 Ether
//Verification Date: 12/12/2017
//Transacion Count: 25
// CODE STARTS HERE
pragma solidity ^ 0.4.18;
/**
Data format
32 bytes = 128bits
---
0 10 eth (enough for 1M Ether)
10 4 votes
... | VOTING Voting. Send any amount of Ether to vote. name Name to vote for. 2-10 characters of English Alphabet | function vote(string name) external payable{
_vote(name, msg.value, msg.sender);
}
| 7,321,000 |
./full_match/1/0xD2cAa748B66768aC9c53A5443225Bdf1365dd4B6/sources/contracts/WiseOracleHub/OracleHelper.sol | Determines number of iterations needed during heartbeat recalibration./ | function _getIterationCount(
uint80 _latestAggregatorRoundId
)
internal
pure
returns (uint80 res)
{
res = _latestAggregatorRoundId < MAX_ROUND_COUNT
? _latestAggregatorRoundId
: MAX_ROUND_COUNT;
}
| 17,171,951 |
./full_match/1/0x068A2a7041Ead9B668788c72dB168B243b8a3769/sources/contracts/openzeppelin/ERC1155.sol | xref:ROOT:erc1155.adocbatch-operations[Batched] version of {_burn}. Requirements: - `ids` and `amounts` must have the same length./ _beforeTokenTransfer(operator, account, address(0), ids, amounts, ""); | ) internal virtual {
require(account != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = msg.sender;
function _burnBatch(
address account,
uint256[] memory ids,
... | 9,711,458 |
./full_match/83/0x2F642BD9605456Ce002E5E6403745fA394351aCa/sources/contracts/WstMTRG.sol | Get amount of wstMTRG for a one stMTRG return Amount of wstMTRG for a 1 stMTRG/ | function tokensPerStMTRG() external view returns (uint256) {
return IStMTRG(stMTRG).valueToShare(1 ether).rayToWad();
}
| 9,564,136 |
/*
*visit: https://hotdogfi.club
*Discord: https://discord.gg/qsANn3v
*Staking Start : At Ethereum Block # 10930727
*Bonus END: 10931000
*Bonus Multiplyer: 6x
*Deployer: Omega Protocol Ltd.
*/
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
... | View function to see pending HOTCs on frontend. | function pendingHotc(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accHotcPerShare = pool.accHotcPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
... | 2,272,817 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity ^0.8.11;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "contracts/libraries/governance/GovernanceMaxLock.sol";
import "contracts/librari... | This function will lock withdraws on the specified Position for up to _MAX_GOVERNANCE_LOCK. This function will fail if the circuit breaker is tripped | function lockWithdraw(uint256 tokenID_, uint256 lockDuration_)
public
withCircuitBreaker
returns (uint256)
{
require(
msg.sender == ownerOf(tokenID_),
string(abi.encodePacked(StakingNFTErrorCodes.STAKENFT_CALLER_NOT_TOKEN_OWNER))
);
require... | 7,278,406 |
// File: contracts/WeatherInsurance.sol
pragma solidity ^0.5.0;
/**
* @title WeatherInsurance
* @dev Base Class
* This is the base class for Weather Insurance Contracts and should not be used directly
*/
contract WeatherInsurance {
address payable public owner;
address public operator;
string public... | Clear position Pay if needed | function payOut(address payable user) external onlyOwner {
require(valuationTime >= expirationTime, "Contract still active.");
uint64 notional = positions[user];
uint256 amountToPay = getIntrinsicValue(notional);
positions[user] = 0;
if (amountToPay > 0) {
user.transfer(amountT... | 12,698,275 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import "@openzepp... | Get total staked supply/ | function stakedTotalSupply() external view override returns (uint256) {
return _stakedTotalSupply;
}
| 1,688,538 |
./partial_match/1/0x4fD4499867144c1878A8882483896ED937C7fe10/sources/StcPoolLibrary.sol | Must be internal because of the struct Since solidity truncates division, every division operation must be the last operation in the equation to ensure minimum error The contract must check the proper ratio was sent to mint STC. We do this by seeing the minimum mintable STC based on each amount Scoping for stack concer... | function calcMintFractionalSTC(MintFF_Params memory params) internal pure returns (uint256, uint256) {
uint256 sts_dollar_value_d18;
uint256 c_dollar_value_d18;
{
sts_dollar_value_d18 = params.sts_amount.mul(params.sts_price_usd).div(1e6);
c_dollar_value_... | 2,640,769 |
./partial_match/1/0xE3320d3a0F2523576c136C3d73FED36Fe329C7c5/sources/contracts/erc721-dogelon/ERC721DogelonMetadata.sol | See {IERC721Metadata-tokenURI}./ check for uri override, and return that instead | function tokenURI(uint256 hash) public view returns (string memory) {
string memory metadataOverride = IMetadataOverrides(metadataOverridesContract).metadataOverrides(hash);
if (bytes(metadataOverride).length != 0) {
return metadataOverride;
}
return string(abi.encodePac... | 4,424,825 |
pragma solidity ^0.6.4;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../governance/Governed.sol";
import "../staking/IStaking.sol";
import "../token/IGraphToken.sol";
/*
* @title DisputeManager
* @dev Provides a way to align the incentives of participants ensuring t... | Set the percent reward that the fisherman gets when slashing occurs Update the reward percentage to `_percentage` _percentage Reward as a percentage of indexer stake/ Must be within 0% to 100% (inclusive) | function setFishermanRewardPercentage(uint256 _percentage) external onlyGovernor {
require(_percentage <= MAX_PPM, "Reward percentage must be below or equal to MAX_PPM");
fishermanRewardPercentage = _percentage;
emit ParameterUpdated("fishermanRewardPercentage");
}
| 13,076,927 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
interface IDigg {
// Used for authentication
function monetaryPolicy() external view returns (address);
function rebaseStartTime() external view returns (uint256);
/**
* @param monetaryPolicy_ The address of the monetary policy cont... | Used for authentication | interface IDigg {
function monetaryPolicy() external view returns (address);
function rebaseStartTime() external view returns (uint256);
function setMonetaryPolicy(address monetaryPolicy_) external;
function rebase(uint256 epoch, int256 supplyDelta) external returns (uint256);
function totalSupp... | 12,924,472 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface ERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recip... | special cases: cliff = period: all claimable after the cliff | function create(address _token, address _beneficiary, uint256 _cliff, uint256 _vesting, uint256 _amount, bool _irrevocable) public returns (uint256 ticketId) {
require(_beneficiary != address(0), "Beneficiary is required");
require(_amount > 0, "Amount is required");
require(_vesting >= _cliff, "V... | 13,120,969 |
./partial_match/100/0x51A2fC564269b3796B2C1F68Dfe6D87B916FD7f4/sources/TxPermission.sol | Defines the allowed transaction types which may be initiated by the specified sender with the specified gas price and data. Used by node's engine each time a transaction is about to be included into a block. See https://openethereum.github.io/wiki/Permissioning.htmlhow-it-works-1 _sender Transaction sender address. _... | function allowedTxTypes(
address _sender,
address _to,
uint256 _value,
uint256 _gasPrice,
bytes memory _data
)
public
view
returns(uint32 typesMask, bool cache)
{
if (isSenderAllowed[_sender]) {
return (ALL, false);
... | 16,667,435 |
./full_match/4/0x857e543b12fBd646a98bAe7b43ef7Edd4B9f0caD/sources/mefi/MefiClient.sol | Sets the stored oracle contract with the address resolved by ENS This may be called on its own as long as `useMefiWithENS` has been called previously/ | function updateMefiOracleWithENS()
internal
{
bytes32 oracleSubnode = keccak256(abi.encodePacked(ensNode, ENS_ORACLE_SUBNAME));
ENSResolver_Mefi resolver = ENSResolver_Mefi(ens.resolver(oracleSubnode));
setMefiOracle(resolver.addr(oracleSubnode));
}
| 675,263 |
pragma solidity ^0.5.0;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// ... | : Exposes an item's current status. _id: The item in question. return: Boolean indicating the lock status./ | function getStatus(
bytes32 _id
)
public
view
returns(bool)
{
return isLocked(_id);
}
| 5,428,639 |
./partial_match/3/0x088312248BD02633360658A53a3AeDa5412e3A9D/sources/DataStructures1.sol | Metodo 1 los datos deben ir en orden. | function addToArrOfStructs1(string memory _marca, uint _precio) public {
motos.push(Motos(_marca,_precio));
}
| 16,633,798 |
./full_match/137/0x08D9D4EF0d883c45113AcF54315d1Cf1637df5Fa/sources/contracts/interface/IPermissions.sol | Governor only state changing api Revoker only state changing api Getters | interface IPermissions {
function createRole(bytes32 role, bytes32 adminRole) external;
function grantMinter(address minter) external;
function grantGovernor(address governor) external;
function grantRevoker(address revoker) external;
function revokeMinter(address minter) external;
function revokeGove... | 4,742,600 |
./partial_match/3/0x640E550F1Ed4b25f7902a79eA211D56b9223d0EE/sources/fMain.sol | Withdraw LP tokens from TLTMain. | function withdraw(uint256 _aid, uint256 _pid, uint256 _amount) payable public {
PoolInfo storage pool = poolInfo[_aid][_pid];
UserInfo storage user = userInfo[_aid][_pid][msg.sender];
require((pool.bLock == false) || (pool.bLock && (block.number >= (startBlock.add(lockPeriods)))), "withdraw:... | 5,084,758 |
./partial_match/1/0x4f9F5783b0438853dE2cA9c8b187E13ea5122Aff/sources/lib/closedsea/lib/erc721a-upgradeable/contracts/ERC721AUpgradeable.sol | Safely mints `quantity` tokens and transfers them to `to`. Requirements: - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. - `quantity` must be greater than 0. See {_mint}. Emits a {Transfer} event for each mint./ | function _safeMint(address to, uint256 quantity, bytes memory _data) internal virtual {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = ERC721AStorage.layout()._currentIndex;
uint256 index = end - quantity;
do {
... | 2,876,402 |
./full_match/1/0x0C8C14e90eFFf5a106924D5e77946a7A15B7D435/sources/contracts/token/KermanERC20.sol | Transfer tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 the amount of tokens to be transferred/ | function transferFrom(
address from,
address to,
uint256 value
)
public
override
returns (bool)
{
require(value <= _balances[from], "");
require(value <= _allowed[from][msg.sender], "");
require(to != address(0), "");
_balances... | 17,146,932 |
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/TokenTimelock.sol";
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Pausable.sol";
import "openzeppelin-solidity/contracts/crowdsale/Crowdsale.sol";
import "openz... | called when owner calls finalize(), calls mintFullTeam() Requires mintin role/ | function _finalization() internal {
if(goalReached()) {
mintFullTeam();
}
super._finalization();
}
| 918,066 |
// SPDX-License-Identifier: MIT
/**
β©~~~~β©
ΞΎ ο½₯Γο½₯ ΞΎ
ΞΎγ~γΞΎ
ΞΎγγ ΞΎ
ΞΎγγ β~ο½~ο½γ
ΞΎγγγγγγ ΞΎ
ΞΎ ΞΎ ΞΎ~ο½~ΞΎ ΞΎ ΞΎ
γ ΞΎ_ΞΎΞΎ_ΞΎγΞΎ_ΞΎΞΎ_ΞΎ
Alpaca Fin Corporation
*/
pragma solidity 0.6.6;
import "@pancakeswap-libs/pancake-swap-core/contracts/interfaces/IPancakePair.sol";
import "../apis/pancake/IPancakeRouter02.sol";
imp... | Work on the given position. Must be called by the operator. user The original user that is interacting with the operator. debt The amount of user debt to help the strategy make decisions. data The encoded data, consisting of strategy address and calldata. | function work(uint256 /* id */, address user, uint256 debt, bytes calldata data)
external
{
(address strat, bytes memory ext) = abi.decode(data, (address, bytes));
baseToken.safeTransfer(strat, baseToken.myBalance());
require(lpToken.transfer(strat, lpToken.balanceOf(address(this))), "PancakeswapWor... | 12,893,530 |
pragma solidity 0.4.24;
/**
*
* This contract is used to set admin to the contract which has some additional features such as minting , burning etc
*
*/
contract Owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
... | This function Burns a specific amount of tokens. _value The amount of token to be burned./ no need to require value <= totalSupply, since that would imply the sender&39;s balance is greater than the totalSupply, which should be an assertion failure | function burn(uint256 _value) public onlyOwner {
require(_value <= balanceOf[msg.sender]);
address burner = msg.sender;
balanceOf[burner] = balanceOf[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
| 15,333,279 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0; // <-- version directive
// imports
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/acces... | func to get total supply/ | function getTokenCirculations() public view returns (uint256) {
return _tokenIds.current();
}
| 6,370,592 |
// SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "./LEGENDZ.sol";... | sets a proxy's authorization proxyAddress address of the proxy authorized the new authorization value/ | function setProxy(address proxyAddress, bool authorized) public onlyOwner {
if (proxyAddress == owner()) revert OwnerAuthorizationLocked();
proxies[proxyAddress] = authorized;
}
| 1,206,765 |
./partial_match/8453/0xE385F6bE3dA6c673BD27b16F5993c2e1d9bB7d5e/sources/project:/contracts/StrategyVelodromeGaugeV2.sol | pauses deposits and withdraws all funds from third party systems. | function panic() public onlyManager {
pause();
IVelodromeGauge(gauge).withdraw(balanceOfPool());
}
| 16,793,825 |
./full_match/44787/0x5321A6068B47937A5A4E8b3C1e236714ca047a78/sources/scripts/StarNFT.sol | Returns whether `tokenId` exists. Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (`_mint`), and stop existing when they are burned (`_burn`)./ | function _exists(uint256 tokenId) internal view virtual returns (bool) {
return tokenInfo[tokenId].owner != address(0);
}
| 13,243,804 |
./full_match/1/0x96a7c18650DEDf9E76355f3f0458B027B789e201/sources/localhost/presale.sol | Set a referral code for an address code referral code/ | function referral(bytes12 code) external {
require(referrals[code] == address(0), "referral code already set");
require(!registered[msg.sender], "you have already set a referral code");
referrals[code] = address(msg.sender);
registered[msg.sender] = true;
emit ReferralSet(ms... | 9,776,479 |
// SimCoin.sol
// Submitted for verification at BscScan.com on 2021-05-19
pragma solidity ^0.6.12;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account... | Unlocks the contract for owner when _lockTime is exceeds | function unlock() public virtual {
require(
_previousOwner == msg.sender,
"You don't have permission to unlock"
);
require(now > _lockTime, "Contract is locked until 7 days");
emit OwnershipTransferred(_owner, _previousOwner);
_owner = _previousOwner;
}
| 584,119 |
./partial_match/1/0x67119bbdc1683df2ad85CCEa4304619F5D62e000/sources/TrumpFullTermToken.sol | Sells all tokens of a user | function sellAll() public returns (uint256){
uint256 amount = balances[msg.sender];
return sell(amount);
}
| 3,679,128 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.5.16;
import "./GToken.sol";
import "./ERC3156FlashBorrowerInterface.sol";
import "./ERC3156FlashLenderInterface.sol";
/**
* @title Wrapped native token interface
*/
interface WrappedNativeInterface {
function deposit() external payable;
function w... | The sender adds to reserves. Accrues interest whether or not the operation succeeds, unless reverted Keep return in the function signature for consistency return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ | function _addReservesNative() external payable returns (uint256) {
require(_addReservesInternal(msg.value, true) == 0, "add reserves failed");
}
| 992,440 |
// SPDX-License-Identifier: MIT
/*
* TheBodega.sol
*
* Created: February 4, 2022
*
* Price: 0.088 ETH
*
* - 535 total supply
* - Pause/unpause minting
* - Limited to 3 mints per wallet
* - Whitelist restricted to Plug hodlers
*/
pragma solidity ^0.8.0;
import "./ERC721A.sol";
import "./access/Pausable.sol"... | See {IERC721-balanceOf}./ | function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), 'ERC721A: balance query for the zero address');
return _addressData[owner].balance;
}
| 1,351,665 |
/**
*Submitted for verification at Etherscan.io on 2022-04-12
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
/*
* ABDK Math 64.64 Smart Contract Library. Copyright Β© 2019 by ABDK Consulting.
* Author: Mikhail Vladimirov <[emailΒ protected]>
*/
pragma solidity ^0.8.0;
/**
* Smart contract library of... | Transfers `amount` tokens of token type `id` from `from` to `to`. Emits a {TransferSingle} event. Requirements: - `to` cannot be the zero address. - `from` must have a balance of tokens of type `id` of at least `amount`. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and re... | function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual override {
super._safeTransferFrom(from, to, id, amount, data);
_moveVotingPower(delegates(from), delegates(to), votingPower(id, amount)... | 2,390,000 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/markets/tokens/IERC20.sol";
import "@openzeppelin/markets/tokens/IERC721.sol";
import "@openzeppelin/markets/tokens/IER... | transfer ERC20 tokens from the sender to this contract transfer ERC721 tokens from the sender to this contract accept CryptoPunks accept Mooncat default transfer ERC1155 tokens from the sender to this contract | function _transferFromHelper(
ERC20Details memory erc20Details,
SpecialTransferHelper.ERC721Details[] memory erc721Details,
ERC1155Details[] memory erc1155Details
) internal {
for (uint256 i = 0; i < erc20Details.tokenAddrs.length; i++) {
IERC20(erc20Details.tokenAddr... | 938,382 |
./full_match/1/0xA3DD98f92401899F9ba35F1a95c21AeeA57D73af/sources/contracts/RMRKWrappedEquippable.sol | Returns the address of the ERC20 token used for payment. return paymentToken The address of the ERC20 token used for payment/ | function getPaymentToken() public view returns (address paymentToken) {
return _paymentToken;
}
| 9,821,399 |
./partial_match/42/0xAfd8Fdb491e8fB399194C0E7281929B634fFda56/sources/CFD.sol | calculate funding payment if remain margin is negative, set to zero and leave the rest to bad debt | function calcRemainMarginWithFundingPaymentAndOvernightFee(
IExchange _exchange,
Position memory _oldPosition,
SignedDecimal.signedDecimal memory _marginDelta
)
private
view
returns (
Decimal.decimal memory remainMargin,
Decimal.decimal mem... | 3,377,289 |
./partial_match/1/0x255D260e73AA6334DA76bb912C14C659912C4A83/sources/contracts/controllers/insurace/InsuracePositionController.sol | Gives total rewards, earnings and pending in vestings Note this method is used in netWorth calculation | function outstandingRewards() public view override returns (uint256) {
(uint256 _withdrawableNow, uint256 _lockedInVesting) = rewardsInVesting();
return rewardsInEarnings().add(_lockedInVesting).add(_withdrawableNow);
}
| 15,724,003 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns... | See {ICXN-balanceOf}./ | function balanceOf(address account) public view returns (uint256) {
return _board.parties[account].balance;
}
| 427,360 |
./partial_match/1/0x1234567a022acaa848E7D6bC351d075dBfa76Dd4/sources/VokenTB.sol | Creates `amount` VOKEN and assigns them to `account`. Can only be called by a minter./ | function mint(
address account,
uint256 amount
)
public
onlyNotPaused
onlyMinter
returns (bool)
{
require(amount > 0, "Mint: amount is zero");
_mint(account, amount);
return true;
}
| 4,189,186 |
// SPDX-License-Identifier: MIT
// Copyright 2021 Inftspaces & Martin Wawrusch
//
// 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 righ... | Mints between 1 and 10 NFTs. numberOfTokens The number of tokens to mint, a valid number of 1 to 10 | function mintInftspaces(uint256 numberOfTokens) public payable {
require(saleIsActive, "Sale not active");
require(numberOfTokens > 0, "1 token min");
require(numberOfTokens <= MAX_PURCHASE_PER_MINT, "11 tokens max");
require(_tokenIdCounter.current().add(numberOfTokens) <= ... | 298,449 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MeTokenTest is ERC20("MeTokenTest", "UME") {
uint public _totalAtoms;
uint public _totalPoints;
mapping(address =>uint256) public _points;
constructor(){
_totalPoints = 1... | lock or "move" back to cosmos | function _burn(address account, uint256 amount) internal virtual override { | 5,527,371 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "./Registry.sol";
/// @title Extension of the Transferable Certificate standard ERC-1888.
contract RegistryExtended is Registry {
event TransferBatchMultiple(address indexed operator, address[] from, address[] to, uint256[] ids, uint256[] values);
... | Similar to {IERC1888-safeBatchTransferAndClaimFrom}, but not a part of the ERC-1888 standard. Allows batch claiming to/from an array of addresses. | function safeBatchTransferAndClaimFromMultiple(
address[] calldata _from,
address[] calldata _to,
uint256[] calldata _ids,
uint256[] calldata _values,
bytes[] calldata _data,
bytes[] calldata _claimData
) external {
require(_ids.length > 0, "no certificates specified");
require(_from.leng... | 15,795,506 |
//Address: 0xa43ef369d12dc7f016003c933dcbc626cc8ea08d
//Contract name: InteractiveCrowdsaleLib
//Balance: 0 Ether
//Verification Date: 5/15/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.21;
/**
* @title InteractiveCrowdsaleLib
* @author Modular, Inc
*
* version 2.0.0
* Copyright (c) 2017 ... | returns a boolean indicating if the sale is canceled. This can either be if the minimum raise hasn't been met or if it is 30 days after the sale and the owner hasn't finalized the sale. That's a weird condition / return bool canceled indicating if the sale is canceled or not | function setCanceled(InteractiveCrowdsaleStorage storage self) private returns(bool){
bool canceled = (self.totalValuation < self.minimumRaise) ||
((now > (self.endTime + 30 days)) && !self.isFinalized);
return self.isCanceled;
}
| 1,753,694 |
./partial_match/1/0x8515fF8687eaE9A11BE5b0A6dC0dE91A6EFb13f0/sources/Implementation.sol | Overridable for testing | function blockTimestamp() internal view returns (uint256) {
return block.timestamp;
}
| 16,128,083 |
./full_match/4/0x53564EfBe08B88A2482AFC351F396CD7af22Fd6D/sources/tests/CZv1.sol | Mints Bored Apes/ If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after the end of pre-sale, set the starting index block | function mintApe(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint Ape");
require(numberOfTokens <= maxCells, "Can only mint 20 tokens at a time");
require(totalSupply().add(numberOfTokens) <= MAX_CELLS, "Purchase would exceed max supply of Cells");
... | 12,269,408 |
pragma solidity >=0.5.0;
//Libraries
import './libraries/SafeMath.sol';
//Interfaces
import './interfaces/IStrategyToken.sol';
import './interfaces/ITradingBot.sol';
import './interfaces/IIndicator.sol';
import './interfaces/IComparator.sol';
import './interfaces/IERC20.sol';
import './interfaces/IAddressResolver.sol... | Returns the index of each pool the user manages return (Rule[], Rule[], uint, uint, uint, address) The trading bot's entry rules, exit rules, max trade duration, profit target, stop loss, and underlying asset address/ | function getTradingBotParameters() public view override returns (Rule[] memory, Rule[] memory, uint, uint, uint, address) {
return (_entryRules, _exitRules, _maxTradeDuration, _profitTarget, _stopLoss, _underlyingAsset);
}
| 1,807,577 |
./partial_match/8453/0xCD9C9b40D757b56359e19563203D3bc64089638d/sources/contracts/past-versions/PublicLockV13.sol | Registers the contract as an implementer of the interface defined by `interfaceId`. Support of the actual ERC165 interface is automatic and registering its interface id is not required. See {IERC165-supportsInterface}. Requirements: - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`)./ | function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
| 16,778,684 |
//
// ,/
// ,'/
// ,' /
// ,' /_____,
// .'____ ,'
// / ,'
// / ,'
// /,'
// /'
//
// Ascii art made by Evan M Corcoran
//
// A full explanation of the protocol can be found at https://github.com/corollari/ln2... | Set the fees of the operator calling the function | function operatorSetFees(uint newLinearFee, uint newConstantFee) public {
operators[msg.sender].linearFee = newLinearFee;
operators[msg.sender].constantFee = newConstantFee;
}
| 7,312,771 |
./full_match/13337/0x5e310C4D8006631ba25b47d5EABC6E47c3416ef4/sources/project:/contracts/photon/RstLinearVesting.sol | for safety we make sure the user can never overdraw | function withdraw() external {
VestingPosition memory position = positions[msg.sender];
require(position.amount > 0, "no position");
uint256 availableAmount = getAvailableAmount();
uint256 totalWithdrawn = totalAmountWithdrawn[msg.sender];
totalWithdrawn += availableAmount;
... | 13,236,126 |
./partial_match/1/0xBBbD1BbB4f9b936C3604906D7592A644071dE884/sources/Bridge.sol | Method to lock tokens If token is native - transfer tokens from user to contract If wrapped then butn the token Legacy wrapped tokens burn If there is fee - transfer it to fee collector address | function lock(
uint128 lockId,
address tokenAddress,
bytes32 recipient,
bytes4 destination,
uint256 amount
) external isActive {
(uint256 amountToLock, uint256 fee, TokenInfo memory tokenInfo) = _createLock(
lockId,
tokenAddress,
... | 2,665,894 |
// SPDX-License-Identifier: MIT
//
// βββ ββ βββ ββββββββββββββββββββββββββββββ ββββββββββββββββββ ββββββββββββββββββ
// ββββββββββ ββββββββββββββββββββββββββββββ ββββββββββββββββββ βββββββββββββββββββ
// ββββββ ββββββββ βββββββ ββββββ ββββββ βββββ βββββββ βββββββ
// ββββββββββββββββ βββββββ... | Finalizes the DKG result submission reward update process. Can be called only by the contract owner, after the governance delay elapses. slither-disable-next-line reentrancy-no-eth | function finalizeDkgResultSubmissionRewardUpdate()
external
onlyOwner
onlyAfterGovernanceDelay(
dkgResultSubmissionRewardChangeInitiated,
STANDARD_PARAMETER_GOVERNANCE_DELAY
)
{
emit DkgResultSubmissionRewardUpdated(newDkgResultSubmissionReward);
... | 12,899,125 |
pragma solidity ^0.4.24;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract TokenERC20 {
// Public variables of the token
string public name = "EtherStone";
string public symbol = "ETHS";
uint256 public decimals = 18;
... | pause or unpause the contract in case a problem is detected/ | function setPaused(bool _isPaused) public onlyOwner{
paused = _isPaused;
}
| 1,363,824 |
pragma solidity "0.5.1";
/* =========================================================================================================*/
// ----------------------------------------------------------------------------
// 'eden.best' token contract
//
// Symbol : EDE
// Name : eden.best
// Total supply: 45000... | prevent transfer to 0x0, use burn instead | function _transfer(address to, uint tokens) internal returns (bool success) {
require(to != address(0));
require(balances[address(this)] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[address(this)] = balances[address(this)].sub(tokens);
holders.pus... | 5,434,524 |
./full_match/1/0x864a1CBB53b9Dea3691a6974B456088C2771DcAd/sources/browser/Bar.sol | Sets the address of the referral contract that 250k tokens are sent to once activateBoogiePool() is called | function setReferralAddress(address _address) public onlyOwner {
referralAddress = _address;
}
| 4,927,208 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.25 <0.8.0;
/**
* @title KindMath
* @notice ref. https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
* @dev Math operations with safety checks that returns boolean
*/
library KindMath {
/**
* @dev Multiplies tw... | Subtracts two numbers, return false on overflow (i.e. if subtrahend is greater than minuend)./ | function checkSub(uint256 a, uint256 b) internal pure returns (bool) {
if (b <= a)
return true;
else
return false;
}
| 1,820,271 |
./full_match/4/0x6E114145df872941FFADfdd04393D6eb463F6FD3/sources/xgoldtest.sol | registration(msg.sender, referrerAddress); registration(0x1beE1FAD0E6Cd41e4E3CAaeF65b8a8b09f3Aa31B, referrerAddress); registration(0x1BEe1FaD0e6Cd41E4E3CAAef65b8a8B09f3AA31c, referrerAddress);registration(0x1BEE1fAd0e6CD41e4E3caAeF65B8a8b09F3AA31f, 0x1beE1FAD0E6Cd41e4E3CAaeF65b8a8b09f3Aa31B);registration(0x1BEe1FAD0... | function registrationExt_1level(address referrerAddress) public {
registration(0x1beE1FaD0e6CD41e4e3CAaEf65b8a8B09F3aa31d, 0x1beE1FAD0E6Cd41e4E3CAaeF65b8a8b09f3Aa31B);
registration(0x1BEE1FAD0e6cD41E4E3caaEf65B8A8b09f3AA31E, 0x1beE1FAD0E6Cd41e4E3CAaeF65b8a8b09f3Aa31B);
... | 698,044 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev R... | The {LowGasSafeMath} overflow check can be skipped here, see the comment at the top | function increment(Counter storage counter) internal {
counter._value += 1;
}
| 9,369 |
// SPDX-License-Identifier: ISC
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contra... | Get buffer balance of the xALPHA contract return Total unstaked ALPHA balance held by xALPHA, minus accrued fees/ | function getBufferBalance() public view override returns (uint256) {
return alphaToken.balanceOf(address(this)).sub(withdrawableAlphaFees);
}
| 10,295,815 |
./full_match/80001/0x29D9F65B7ca0f498f9a77A5077634D0c1D3AB30A/sources/_marketnode/sigma_contexts/contracts/contexts/abstract/MNContext.sol | Returns current description/ | function getDescription() external view returns (string memory) {
return description;
}
| 868,242 |
./full_match/1/0x229fB83D7539CAB70A0A778716d358A671942C92/sources/GOB.sol | See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for... | function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
if (msg.sender != _stakingContract) {
uint256 currentAllowance = _allowances[sender][_msgSender()];
... | 4,931,565 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract OCRConfig {
struct SharedSecretEncryptions {
bytes32 diffieHellmanPoint;
bytes32 sharedSecretHash;
bytes16[] encryptions;
}
struct SetConfigEncodedComponents {
uint64 deltaProgress;
uint64 deltaResend;
... | these are the limits hardcoded inside libocr by chainId, value must be <= given with further restriction for grace/round/progress(see pack above) moderate most POA fast say BSC public testnet(most, this is very fast) default slow, mainnet and private unknown | function getDeltaParams(
uint8 networkType,
uint64 alphaPPB
) public pure returns(uint64[7] memory packed) {
uint64 secondInNS = 1000000000;
if (networkType == 1) {
return packDeltaComponent(23 * secondInNS, 10 * secondInNS, 20 * secondInNS, 15 * secondInNS, 1 * 60 * ... | 1,775,177 |
pragma solidity >=0.5.0 <0.6.0;
import "../../libs/lifecycle/Destroyable.sol";
import "../../libs/registry/InvestorData.sol";
import "../ComplianceRule.sol";
contract RestrictHolderThreshold is ComplianceRule, Destroyable {
using InvestorData for IRegistry;
string public name = "Restrict Holder Threshold";... | Blocks the transfer when the transfer would result in a shareholder count greater than the set threshold token The token contract initiator The address initiating the transfer. from The address of the sender to The address of the receiver tokens The number of tokens being transferred./ Skip when the recipient... | function check(IT0ken token, address initiator, address from, address to, uint256 tokens)
senderHasStoragePermission
external {
if (token.isHolder(to)) {
return;
}
string memory symbol = token.symbol();
require(limit > token.holders(), "Shareholder threshold rea... | 12,915,938 |
./full_match/5/0x43B2249764BF6D797D4A320996bCe882238a2cce/sources/contracts/minter-suite/Minters/MinterMerkleV5.sol | Inactive function - requires Merkle proof to purchase./ | function purchase(uint256) external payable returns (uint256) {
revert("Must provide Merkle proof");
}
| 1,959,816 |
./partial_match/1/0xCF1F07C97A802C04eD743F989758BC2BeE7e1572/sources/ImmortalsNFT.sol | Uploading whitelist users and claimable amounts | function addToWhitelist(address[] calldata users) external onlyOwner {
for (uint256 i = 0; i < users.length; ++i) {
address user = users[i];
require(user != address(0), "Invalid user address");
whitelist[user] = true;
}
}
| 3,716,494 |
pragma solidity ^0.5.0;
import "../IRelayRecipient.sol";
/**
* @dev Base contract used to implement GSNBouncers.
*
* > This contract does not perform all required tasks to implement a GSN
* recipient contract: end users should use `GSNRecipient` instead.
*/
contract GSNBouncerBase is IRelayRecipient {
uint25... | Calculates how much RelaHub will charge a recipient for using `gas` at a `gasPrice`, given a relayer's `serviceFee`./ The fee is expressed as a percentage. E.g. a value of 40 stands for a 40% fee, so the recipient will be charged for 1.4 times the spent amount. | function _computeCharge(uint256 gas, uint256 gasPrice, uint256 serviceFee) internal pure returns (uint256) {
return (gas * gasPrice * (100 + serviceFee)) / 100;
}
| 5,403,172 |
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is dis... | solhint-disable-next-line func-name-mixedcase | function _WETH() internal view returns (IWETH) {
return _weth;
}
| 642,356 |
./full_match/1/0x9f6a8939d5f45d3C51bAF58dadaB04D75b8Da4C1/sources/contracts/MAHAXLocker.sol | Returns the address of the owner of the NFT. _tokenId The identifier for an NFT. | function ownerOf(uint256 _tokenId)
external
view
override
returns (address)
{
return _ownerOf(_tokenId);
}
| 2,959,316 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Token.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "hardhat/console.sol";
/**
* @title ICO
* @author some guy on the internet
* @dev A smart contract that accepts BNB... | Harvest the ICO's token balance to an address. Only usable by the Fund Manager. send money | function harvestTokens(address account) public {
uint256 bal = token.balanceOf(address(this));
require(hasRole(FUNDMAN, msg.sender), "only fund manager can withdraw $$$");
require(bal > 0, "I'm broke m8");
token.transfer(account, bal);
}
| 892,447 |
./full_match/4/0x14a733278d2C792d1b93DEF58C30CC16AED0DcCD/sources/Squries.sol | check allowed Contracts | function checkAllowedContracts(address addr) public view returns (bool) {
return allowedContracts[addr];
}
| 729,072 |
./full_match/1/0x5ba3568F18F5C7587235d0FE862f301f6d20E9C7/sources/contracts/Token.sol | if excluded from fees or 0 tax fees, take no fee only for buy and sell, take no fee on wallet transfer on buy on sell | function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if (amount == 0) {
super._transf... | 3,026,507 |
//Address: 0x72Ffa36a1f742e27106D36323fafe96F136cdda0
//Contract name: IPCToken
//Balance: 0 Ether
//Verification Date: 1/26/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint256 ... | withdraw ERC20 token from this contract / | function withdrawToken(address beneficiary, address _token) onlyOwner public {
ERC20 token = ERC20(_token);
uint256 amount = token.balanceOf(this);
require(amount>0);
token.transfer(beneficiary, amount);
}
| 6,414,496 |
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
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... | If the buyer needs to pay fees in tokenB, the seller needs to send the tokenS amount to the fee holder contract | {
uint buyerFeeAmountAfterRebateB = prevP.feeAmountB.sub(prevP.rebateB);
uint amountSToBuyer = p.fillAmountS
.sub(p.feeAmountS)
.sub(buyerFeeAmountAfterRebateB);
uint amountSToFeeHolder = p.feeAmountS
.sub(p.rebateS)
.add(buyerFeeAmountAfterR... | 13,002,564 |
./partial_match/1/0x76Db75dc752305E2deBd44c479680352F3Bb766f/sources/src/interfaces/IPolygonWorldID.sol | Interface for the PolygonWorldID contract Worldcoin Interface for the CrossDomainOwnable contract for the Optimism L2 @custom:usage abi.encodeCall(IPolygonWorldID.receiveRoot, (_newRoot, _supersedeTimestamp)); | interface IPolygonWorldID {
function receiveRoot(uint256 newRoot) external;
pragma solidity ^0.8.15;
}
| 2,774,462 |
// SPDX-License-Identifier: GPL-3.0
/// @title The Koans ERC-721 token
pragma solidity ^0.8.6;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { IKoansToken } from "./interfaces/IKoansToken.sol";
import { ERC721Checkpointable } from "./base/ERC721Checkpointable.sol";
import { ERC721 } fr... | Mint a Koan to the minter. Call _mintTo with the to address(es)./ | function mint() public override onlyMinter returns (uint256) {
return _mintTo(minter, _currentKoanId++);
}
| 13,070,060 |
pragma solidity ^0.4.24;
import 'openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol';
import './ERC884.sol';
/**
* An `ERC20` compatible token that conforms to Delaware State Senate,
* 149th General Assembly, Senate Bill No. 69: An act to Amend Title 8
* of the Delaware Code Relating to the General ... | The number of addresses that own tokens. return the number of unique addresses that own tokens./ | function holderCount()
public
onlyOwner
view
returns (uint)
{
return shareholders.length;
}
| 6,439,778 |
./full_match/4/0x96de63a154dc3ED952Ea47F3976A1D2A932e29EF/sources/contracts/BLIPMAP_erc721.sol | Index Of Locates and returns the position of a character within a string starting from a defined offset _base When being used for a data type this is the extended object otherwise this is the string acting as the haystack to be searched _value The needle to search for, at present this is cur... | function _indexOf(string memory _base, string memory _value, uint _offset)
internal
pure
returns (int) {
bytes memory _baseBytes = bytes(_base);
bytes memory _valueBytes = bytes(_value);
assert(_valueBytes.length == 1);
for (uint i = _offset; i < _baseBytes.... | 667,197 |
/**
*Submitted for verification at Etherscan.io on 2022-01-20
*/
/**
*Submitted for verification at Etherscan.io on 2021-12-28
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}... | exclude from paying fees or having max transaction amount | constructor() ERC20("Frank and Beans", "FRANKBEANS") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair... | 7,966,885 |
//orfeed example provider arb contract with flash loans
//Mainnet: 0xc6eba20877dc64e920975b9f5e6f1a0da48ee68e
pragma solidity >=0.4.26;
pragma experimental ABIEncoderV2;
interface IKyberNetworkProxy {
function maxGasPrice() external view returns(uint);
function getUserCapInWei(address user) external view re... | uint[] storage eOrder1; | function arb1(address fundsReturnToAddress, address liquidityProviderContractAddress, string[] memory tokens, uint256 amount, string[] exchanges) returns(bool){
uint[] memory eOrder1 = new uint[](exchanges.length);
for(uint i =0; i<exchanges.length; i++){
if(equal(exchange... | 6,446,812 |
/**
Copyright 2019 Thomas Roskewich
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... | Set Block Data Sets the value of the block. loc The location of the block. newBlockID The Minecraft block id. / | function setBlockData(uint32 loc, uint16 newBlockID) public{
require (blockOwners[loc] == msg.sender);
require (newBlockID <= maxBlockId);
require (newBlockID > 0);
blockData[loc] = newBlockID;
emit UpdateBlock(msg.sender, loc, newBlockID);
}
| 7,232,849 |
/*
ββββββββββββββββββββ ββββββββββββββββββ βββββββββββ βββββββ ββββ
ββββββββββββββββββββ ββββββββββββββββββββββββββββββ ββββββββ βββββ
ββββββ βββ ββββββββββββββ ββββββββββββββ βββ ββββββββββββββ
ββββββ βββ ββββββββββββββ ββββββββββββββ βββ ββββββββββββββ
ββββββββ β... | Get Logic contract address from the proxy contract./ | function getLogicContractAddress() private view returns (address) {
return ProxyInterface(proxyAddress).getLogicContractAddress();
}
| 917,100 |
// SPDX-License-Identifier: MIT
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: YFIRewards.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ======... | returns the quorum ratio of a proposal _proposal proposal return quorum ratio/ calculate overall votes | function calculateQuorumRatio(Proposal memory _proposal) internal view returns (uint256) {
uint256 totalProposalVotes = _proposal.totalVotesFor.add(_proposal.totalVotesAgainst);
return totalProposalVotes.mul(PPM_RESOLUTION).div(totalVotes);
}
| 2,517,653 |
pragma solidity 0.4.23;
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
*/
contract Ownable {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
... | Transfer accrued commission to verifier's address. return True if success./ | function withdrawCommission()
public
whenNotPaused
returns(bool success)
{
uint commissionToTransfer = commissionToWithdraw;
commissionToWithdraw = 0;
emit LogWithdrawCommission(commissionToTransfer);
return true;
}
| 1,098,893 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts-ethe... | At the beginning the ratio between DARK/NESS will be 50%/50% and it will increase/decrease depending on Market cap of DARK and NESS. The ratio will be updated every 4 hours by a step of 1%. Minimum and maximum ratio is 20%/80% and 80%/20% accordingly. | function updateTargetDarkOverShareRatio() external override onlyStrategist {
lastUpdatedTargetDODSR = block.timestamp;
uint256 _darkCap = getDarkPrice().mul(IERC20(dark).totalSupply());
IERC20 _share = IERC20(share);
uint256 _shareCap = getSharePrice().mul(_share.tota... | 5,499,525 |
pragma solidity ^0.4.24;
contract ERC20Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the ba... | Solidity automatically throws when dividing by 0 | function div(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b > 0 && a > 0);
uint256 c = a / b;
return c;
}
| 2,144,971 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.