file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0xd02b9FcF9AeCB18019021e3f1b0a19508c600f71/sources/FAITHFULOfficial.sol | Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./ | While loyalty may breed complacency, $FAITHFUL embraces evolution. By consistently exploring cutting-edge solutions and adapting to the ever-changing crypto landscape, $FAITHFUL strives to remain at the forefront of innovation. Through ongoing research and development, the project aims to provide users with unparallele... | 3,634,909 |
./partial_match/1/0xdefac16715671b7b6aeeFE012125f1E19Ee4b7d7/sources/_PrimeToken.sol | Reward tokens to account stake balances. Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)/ | function stakeReward(address[] calldata to, uint256[] calldata value)
public
whenNotPaused
returns (bool)
{
expect(isAutomator(msg.sender), ERROR_UNAUTHORIZED);
expect(value.length == to.length, ERROR_LENGTH_MISMATCH);
for (uint256 i = 0; i < to.length; i++) {
... | 2,630,708 |
./partial_match/3/0x478e379d5F3E2F949a94F1ccFB7217FB35916615/sources/SavingsContract.sol | Converts masset amount into credits based on exchange rate m = credits exchangeRate/ e.g. (1e20 1e18) / 1e18 = 1e20 e.g. (1e20 14e17) / 1e18 = 1.4e20 | function _creditToUnderlying(uint256 _credits)
internal
view
returns (uint256 underlyingAmount)
{
underlyingAmount = _credits.mulTruncate(exchangeRate);
}
| 5,156,156 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
import "../../sale/FixedOrderSandNftSale.sol";
/**
* @title FixedOrderSandNftSaleMock
* A FixedOrderSandNftSale contract mock implementation that handles the purchases of pre-minted
* Sandbox NFTs from a holder account to the recipient. The provisioning of th... | Calls the internal `_delivery()` purchase lifecycle function. Emits the DeliveryData event. recipient The recipient of the purchase. token The token to use as the payment currency. sku The identifier of the SKU to purchase. quantity The quantity to purchase. userData Optional extra user input data. totalPrice Th... | function underscoreDelivery(
address payable recipient,
address token,
bytes32 sku,
uint256 quantity,
bytes calldata userData,
uint256 totalPrice,
bytes32[] calldata pricingData,
bytes32[] calldata paymentData
) external {
PurchaseData memo... | 2,514,785 |
pragma solidity 0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
... | Claim pending rewards for all pools | function claimAll() external {
massUpdatePools();
uint256 pending;
for (uint pid = 1; pid <= poolInfo.length; pid++) {
PoolInfo storage pool = poolInfo[pid - 1];
UserInfo storage user = userInfo[pid][msg.sender];
if (user.amount > 0) {
pend... | 1,729,062 |
./partial_match/42/0xF3cCFb9c0ba0AeDa18306eeacAe569dc29Bb2d39/sources/contracts/BitbaseLGE.sol | Bonus tokens being distributed per wei. | function addLiquidityToUniswap() public onlyOwner {
addLiquidityETHToUniswapPair();
addLiquidityToDEFLCTUniswapPair();
bonusTokenPerETHUnit = bonusTokens.mul(1e18).div(totalETHContributed);
require(bonusTokenPerETHUnit != 0, "Token calculation failed");
LPGenerationCompleted = true;
}
| 3,414,983 |
./partial_match/1/0xeB63fb68dF9B6ec08605Dc3Ac74d3987C07d64cd/sources/VlokiInuCoin.sol | _Available since v4.1._ Interface for the optional metadata functions from the ERC20 standard./ | interface IERC20Metadata is IERC20 {
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
}
| 2,647,750 |
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
import {SafeMath} from "../lib/SafeMath.sol";
import {DecimalMath} from "../lib/DecimalMath.sol";
import {DODOMath} from "../lib/DODOMath.sol";
import {Types} from "../lib/Types.sol";
... | calculate capital handle penalty, penalty may exceed amount settlement | function withdrawBaseTo(address to, uint256 amount) public preventReentrant returns (uint256) {
(uint256 baseTarget, ) = getExpectedTarget();
uint256 totalBaseCapital = getTotalBaseCapital();
require(totalBaseCapital > 0, "NO_BASE_LP");
uint256 requireBaseCapital = amount.mul(totalB... | 5,469,004 |
// SPDX-License-Identifier: MIT
// Developed by KG Technologies (https://kgtechnologies.io)
pragma solidity 0.8.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
/**
* @notice Represents MetaTriad Smart Contract
*/
con... | Allows owner to change the duration of the redeem period newDuration. The new duration of the redeem period/ | function setRedeemDuration(uint256 newDuration) external onlyOwner {
redeemDuration = newDuration;
emit setRedeemDurationEvent(newDuration);
}
| 10,178,738 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.4;
import {ILendPoolAddressesProvider} from "../interfaces/ILendPoolAddressesProvider.sol";
import {ILendPoolConfigurator} from "../interfaces/ILendPoolConfigurator.sol";
import {ILendPool} from "../interfaces/ILendPool.sol";
import {IBToken} from "../interfaces... | return Abstract function implemented by the child bToken/debtToken. Done this way in order to not break compatibility with previous versions of bTokens/debtTokens/ | function _getIncentivesController() internal view virtual returns (IIncentivesController);
function _getUnderlyingAssetAddress() internal view virtual returns (address);
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual override {
uint256 oldSenderBalance... | 6,907,920 |
./full_match/1/0xBAAA3053e773544561a119DB1F86985581D3fE7F/sources/contracts/stakerewardV2pool.sol | Allows the owner to set the boost contract address | function setBoost(address _boost) external onlyOwner {
esLBRBoost = IesLBRBoost(_boost);
}
| 17,119,162 |
./full_match/80001/0x32eB355270230643321561E84f04A6d7Cc022b03/sources/project_/contracts/curves/BancorFormula.sol | given a pool token supply, reserve balance, reserve ratio and an amount of reserve tokens to fund with, calculates the amount of pool tokens received for purchasing with the given amount of reserve tokens Formula: return = _supply ((_amount / _reserveBalance + 1) ^ (_reserveRatio / MAX_WEIGHT) - 1) _supply p... | function fundSupplyAmount(
uint256 _supply,
uint256 _reserveBalance,
uint32 _reserveRatio,
uint256 _amount
) public view override returns (uint256) {
require(_supply > 0, "ERR_INVALID_SUPPLY");
require(_reserveBalance > 0, "ERR_INVALID_RESERVE_BALANCE");
r... | 840,867 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC20.sol";
import "./IERC20.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
co... | lp type If lp contains usdc, we can take a short-cut If token0 or token1 is bnb, use that, else use token0. As we arent working with usdc at this point (early return), this is okay. | function getTokenUSDCValue(uint256 tokenBalance, address token, uint8 tokenType, bool viaMaticUSDC, address usdcAddress) external view returns (uint256) {
require(tokenType == 0 || tokenType == 1, "invalid token type provided");
if (token == address(usdcAddress))
return tokenBalance;
... | 908,065 |
/**
*Submitted for verification at Etherscan.io on 2021-04-01
*/
// File: contracts\modules\SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint ... | settle user's mint balance when user want to modify mine database. mineCoin the mine coin address account user's account recipient the recipient's address if operator is transfer amount the input amount for operator operators User operator to modify mine database./ | function settleMinerBalance(address mineCoin,address account,address recipient,uint256 amount,uint256 operators)internal{
uint256 _totalSupply = totalSupply();
uint256 tokenNetWorth = _getTokenNetWorth(mineCoin);
if (_totalSupply > 0){
minerBalances[mineCoin][account] = minerBala... | 2,437,817 |
pragma solidity ^0.5.8;
/**
* @title The standard ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address, uint256) external returns (bool);
function approve(address, uint256) external returns (bool);
function transferFrom(address, address, uint25... | Propose a new transfer, which can be confirmed after two weeks. Delay by at least two weeks. We are relying on block.timestamp for this, and aware of the possibility of its manipulation by miners. But we are working at a timescale that is already much longer than the variance in timestamps we have observed and expect i... | function propose(address destination, uint256 value, string calldata notes) external onlyOwner {
uint256 delayUntil = now + delay;
require(delayUntil >= now, "delay overflowed");
proposals[proposalsLength] = TransferProposal({
destination: destination,
value: value,
... | 6,874,275 |
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
retu... | Counts the number of nonoverlapping occurrences of `needle` in `self`. self The slice to search. needle The text to search for in `self`. return The number of occurrences of `needle` found in `self`./ | function count(slice self, slice needle) internal returns (uint cnt) {
uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len;
while (ptr <= self._ptr + self._len) {
cnt++;
ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr) +... | 2,547,674 |
./full_match/40/0x6D1F230f479f14e717204f2053E8e7c0397B0937/sources/contracts/Omnidex-incentives/incentives/TempIncentivesVault.sol | Deposits funds into the Vault Only possible when contract not paused. _amount: number of tokens to deposit (in TLOS)/ | function deposit(uint256 _amount) external whenNotPaused {
require(_amount > 0, "Nothing to deposit");
token.safeTransferFrom(msg.sender, address(this), _amount);
emit Deposit(msg.sender, _amount);
}
| 9,548,277 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
import "contracts/protocol/tokens/MinterPauserClaimableERC20.sol";
import "contracts/interfaces/apwine/IFutureVault.sol";
/**
* @title APWine interest bearing token
* @notice Interest bearing token for the futures liquidity provided
* @dev the value of ... | Returns the current balance of one user including the pt that were not claimed yet account the address of the account to check the balance of return the total pt balance of one address/ | function balanceOf(address account) public view override returns (uint256) {
return super.balanceOf(account).add(futureVault.getClaimablePT(account));
}
| 14,092,904 |
/**
*Submitted for verification at Etherscan.io on 2020-08-17
*/
pragma solidity 0.5.16;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0)
return 0;
uint256 c = a * b;
require(c / a == b);
return c;
}
functio... | Transfer tokens from one address to another. Note that while this function emits an Approval event, this is not required as per the specification, and other compliant implementations may not emit the event. from address The address which you want to send tokens from to address The address which you want to transfer t... | function transferFrom(address from, address to, uint256 value) public returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
return true;
}
| 882,577 |
./partial_match/42/0xF74fD2daa87DF8d99e1Ea7dF493a18B546957099/sources/YaxisChef.sol | Update the given pool's YAX allocation point. Can only be called by the owner. | function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner {
if (_withUpdate) {
massUpdatePools();
}
PoolInfo storage pool = poolInfo[_pid];
if (pool.isStarted) {
totalAllocPoint = totalAllocPoint.sub(pool.allocPoint).add(_allocPoint);
... | 3,378,431 |
./partial_match/1/0xF67A479dcEB61947994De1C5Caa1ba4092e9e25c/sources/BEBEToken.sol | Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), reverting when dividing by zero. Counterpart to Solidity's `%` operator. This function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remaining gas). Requirem... | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
| 2,739,744 |
// SPDX-License-Identifier: Apache-2.0
// VolumeFi Software, Inc.
pragma solidity 0.8.11;
/// Imported from Openzeppelin
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Tra... | Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement on the return value: the return value is optional (but if data is returned, it must not be false). token The token targeted by the call. data The call data (encoded using abi.encode or one of its variants)./ We ... | function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata =
address(token).functionCall(
data,
);
if (returndata.length > 0) {
require(
abi.decode(returndata, (bool)),
);
}
... | 883,993 |
./full_match/1/0x420CBD9f1CB5351D347F4B5D44D83a91514C43b0/sources/contracts/OlimpoPass.sol | This internal verification will validate the minting process and set the `mintedInPhase` mapping to an address as true if the verification passes. Minting Phases are created by the admin and can be activated or deactivated. When a phase is active, anyone can mint a token if the `msg.sender` is in the allowlist, otherwi... | function _safeCheck(uint256 _id, uint256 _addressIndex) internal {
MintPhases memory phase = phases[_id];
if (!phase.isActive) {
revert PhaseNotActive(_id);
}
if (msg.value != phase.mintPrice) {
revert MismatchingPrice(msg.value);
}
if (
... | 2,976,835 |
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
import "Ownable.sol";
import "Pausable.sol";
import "PaymentSplitter.sol";
import "ERC721A.sol";
import "Whitelist.sol";
contract InvisibleKennel is ERC721A, Ownable, Pausable, Whitelist, PaymentSplitter {
/**
* General constants and immutable v... | Burns `tokenId`. See {ERC721A-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator./ | function burn(uint256 tokenId) external {
_burn(tokenId, true);
}
| 267,740 |
./partial_match/1/0xAF5078bCEE5B9DE9Bb9394207Ca48ac32648C45f/sources/Workspace.sol | Allow the owner to withdraw tokens from the contract. tokens quantity of tokens to be withdrawn/ | function withdrawTalao(uint256 tokens)
public
onlyOwner
{
token.transfer(msg.sender, tokens);
}
| 3,939,091 |
./partial_match/1/0xd6F2E30B99214B6eaffBE2B270d2e42c762a929B/sources/DisputeManager.sol | Sets the global configuration for the max number of jurors to be drafted per batch to `_maxJurorsPerDraftBatch` _maxJurorsPerDraftBatch Max number of jurors to be drafted per batch/ | function setMaxJurorsPerDraftBatch(uint64 _maxJurorsPerDraftBatch) external onlyConfigGovernor {
_setMaxJurorsPerDraftBatch(_maxJurorsPerDraftBatch);
}
| 4,343,467 |
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol | Reads the int208 at `mPtr` in memory. | function readInt208(
MemoryPointer mPtr
) internal pure returns (int208 value) {
assembly ("memory-safe") {
value := mload(mPtr)
}
}
| 8,452,181 |
// File: @chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol
pragma solidity ^0.8.0;
interface LinkTokenInterface {
function allowance(
address owner,
address spender
)
external
view
returns (
uint256 remaining
);
function approve(
address spender,
uint256 val... | Callback function used by VRF Coordinator/ | function fulfillRandomness(bytes32 requestId, uint256 randomness)
internal
override
{
randomNumbers[requestIdToId[requestId]].randomNumber = randomness;
randomNumbers[requestIdToId[requestId]].blockTime = block.timestamp;
randomNumbers[requestIdToId[requestId]].blockNumbe... | 6,338,770 |
./full_match/1001/0xfCCf3d314806a76D405c31F45188a7A5393C119a/sources/_klaytn/contracts/KIP/token/KIP7/KIP7.sol | Same as {xref-KIP7-_safeMint-address-uint256-}[`_safeMint`], with an additional `_data` parameter which is forwarded in {IKIP7Receiver-onKIP7Received} to contract recipients./ | function _safeMint(
address account,
uint256 amount,
bytes memory _data
) internal virtual {
_mint(account, amount);
require(
_checkOnKIP7Received(address(0), account, amount, _data),
"KIP7: transfer to non IKIP7Receiver implementer"
);
... | 16,364,099 |
./partial_match/1/0x1A963Df363D01EEBB2816b366d61C917F20e1EbE/sources/src/ComptrollerG7.sol | Calculate COMP accrued by a borrower and possibly transfer it to them Borrowers will not begin to accrue until after the first interaction with the protocol. cToken The market in which the borrower is interacting borrower The address of the borrower to distribute COMP to/ | function distributeBorrowerComp(
address cToken,
address borrower,
Exp memory marketBorrowIndex
)
internal
{
CompMarketState storage borrowState = compBorrowState[cToken];
Double memory borrowerIndex =
compBorrowerIndex[cToken][borrower] = borrowIndex.... | 2,595,129 |
./partial_match/1/0x9490CCf93Cd750dc47f72402A163022cfB94CFC9/sources/contracts/vaults/TreasuryVault/RibbonTreasuryVaultLite.sol | Sends oToken to buyer _buyer is the buyer of the oToken/ | function sendOTokens(address _buyer) external onlyOwner nonReentrant {
require(_buyer != address(0), "T29");
IERC20 oToken = IERC20(optionState.currentOption);
oToken.safeTransfer(_buyer, oToken.balanceOf(address(this)));
}
| 3,540,708 |
./full_match/11155111/0x209B3b79a4D10A88c72f58cA166902b9d8442a0f/sources/src/tokens/KERC1155.sol | Disabled token URI upgradeability/ | function setUriImmutable() external onlyOwner isImmutable {
immutableUri = true;
}
| 3,826,024 |
./full_match/5/0xc962E67D9490E154D81181879ddf4CD3b65D2132/sources/contracts/Safe.sol | Returns the domain separator for this contract, as defined in the EIP-712 standard. return bytes32 The domain separator hash./ | function domainSeparator() public view returns (bytes32) {
return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));
}
| 1,889,515 |
pragma solidity ^0.5.17;
// Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol
// Adapted to use pragma ^0.5.17 and satisfy our linter rules
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
string private constan... | Internal function to tell the current term identification number. Note that there may be pending term transitions. return Identification number of the current term/ | function _currentTermId() internal view returns (uint64) {
return termId.add(_neededTermTransitions());
}
| 91,645 |
//Address: 0x4a30a93e2562257b3c49aba2a79ed633b5b3c393
//Contract name: CryptoCopyCrowdsale
//Balance: 0 Ether
//Verification Date: 11/11/2017
//Transacion Count: 46
// CODE STARTS HERE
pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath... | Construct _tokenAddress Address of the token _start Start of ICO _end End of ICO/ | function CryptoCopyCrowdsale(address _tokenAddress, uint256 _start, uint256 _end) {
CryptoCopyToken = Token(_tokenAddress);
creator = msg.sender;
start = _start;
end = _end;
}
| 957,528 |
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
... | ------------------------------------------------------------------------ Transfer `tokens` from the `from` account to the `to` account The calling account must already have sufficient tokens approve(...)-d for spending from the `from` account and - From account must have sufficient balance to transfer - Spender must ha... | function transferFrom(address from, address to, uint tokens)override public returns (bool success) {
if(blocked[msg.sender]==0x424C4F434B)
{
return false;
}
if( permit_mode && permitted[msg.sender]!=0x7065726D6974)
{
return false;
}
... | 6,047,227 |
// solhint-disable
// Imported from https://github.com/UMAprotocol/protocol/blob/4d1c8cc47a4df5e79f978cb05647a7432e111a3d/packages/core/contracts/common/implementation/FixedPoint.sol
pragma solidity 0.6.12;
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts-e... | / Cheap way to see if it's an invalid number | function getAddress(uint256 addressKey) public view returns (address) {
ConfigOptions.Addresses(addressKey);
return addresses[addressKey];
}
| 1,093,593 |
./full_match/84531/0x879708ff58F252e7e46ed51FC69924E609a2d8Ef/sources/project_/contracts/seedify-fund.sol | validate update userdetail | function buyPoolOverflow()
whenNotPaused
whenCompletedChecklist
inOverflowTime
nonReentrant
public
payable
{
require(IsRefundedEndPoolSale() == false, "This pool was refunded");
uint256 ethValue = msg.value;
require(ethValue > 0, "amount p... | 11,497,866 |
// SPDX-License-Identifier: Apache License Version 2.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract IssuersContract {
// Mapping UIDs to issuer public keys
mapping(bytes16 => address) idTypes;
event AddIdType(
bytes16 idType,
address signer
... | Get the public key for an ID type | function getSigner(bytes16 idType) internal view returns (address) {
return idTypes[idType];
}
| 1,080,677 |
./partial_match/1/0xDeca6fC3D1C5ae0C9D31775489C0c930760f5f28/sources/contracts/SwapToBurnBase.sol | need to override hereif token is LUFFY TOKEN just burn it buy ETH and send to fee-handler contract to buy-back and burn LUFFY | function LUFFY() public pure virtual returns (address);
function UNISWAP_V2_ROUTER() internal pure virtual returns (IUniswapV2Router02);
function UNISWAP_FACTORY() internal pure virtual returns (IUniswapV2Factory);
function burn(uint256 _burnAmount, address[] memory _path) internal {
address ... | 2,784,759 |
./full_match/80001/0x1086cA67795093D6af31998DaDdB446F5C41006C/sources/contracts/PremiumChallenge.sol | check is reward to claim | function isRewardClaimed(address _wallet) public senderIsAddress challengeWinnersIsSet view returns (bool) {
require(_wallet != address(0), 'Invalid wallet address');
require(winners[_wallet].wallet != address(0), 'Winner not found');
return winners[_wallet].claimed;
}
| 843,402 |
pragma solidity ^0.4.18;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
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;
}
/**
* @dev Integer division o... | action, opposite to claim. Player, who claimed the token can call this before convert, or anybody can call this after prize is expired. _tokenId ID of claimed ERC721 token player get his ERC721 back, and advertiser receives token price IZX amount. This transaction reverts claim transaction./ | function reclaim(uint _tokenId) public {
Prize storage prize = prizes[_tokenId];
require( (prize.winner == msg.sender) || (now > prize.expires_at) );
address advertiser = prize.advertiser;
address winner = prize.winner;
erc721token.transfer(prize.winner, _tokenId);
r... | 7,313,600 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "../ERC721/extensions/ERC721URIContract.sol";
import "../ERC721/extensions/ERC721Pausable.sol";
import "../utils/Base64.sol";
impor... | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
_safeTransfer(from, to, tokenId, _data);
}
| 1,639,319 |
pragma solidity ^0.6.11;
/*
A gauge to allow users to commit to Stacker.vc fund 1. This will reward STACK tokens for hard and soft commits, as well as link with a ibETH gateway, to allow users
to deposit ETH directly into the fund.
ibETH is sent to the STACK DAO governance contract, for future VC fund initialization.
... | withdraw funds that haven't been committed to VC fund (fund in commitSoft before deadline) update globals & add amtToWithdraw to final tally. IMPORTANT: send tokens to msg.sender, not _withdrawFor. This will send to msg.sender OR vaultGaugeBridge (see second require() ). the bridge contract will then forward these toke... | function withdraw(uint256 _amount, address _withdrawFor) nonReentrant external {
require(block.number <= endBlock, ">endblock");
CommitState memory _state = balances[_withdrawFor];
require(_amount <= _state.balanceCommitSoft, "GAUGE: insufficient balance softCommit");
_state.balanceCommit... | 14,401,394 |
./full_match/5/0xEf8F1fe8918eB5BB70853F2dF2cAC85626d6FB56/sources/project_/contracts/base/modules/MintingPhases.sol | Set the phases times. _earlyminting_startTime Start time: early-minting (in Unix timestamp) _minting_delay Early-minting duration(in seconds) _end_delay Minting phase duration (in seconds)/ | function phase_setTimes (
uint256 _earlyminting_startTime,
uint256 _minting_delay,
uint256 _end_delay)
external
virtual
onlyRole(METAWIN_ROLE)
onlyInPhase(MintingPhase.setup) {
phaseStartTime[MintingPhase.earlyMinting] = _earlyminting_startTime;
... | 7,035,533 |
./full_match/44787/0x7978Bd49bdA4FFb94ed4aF46c2cC383Ec82ea399/sources/contracts/cross-chain/ToucanCrosschainMessenger.sol | Receive messages sent via Optics from other remote xApp Routers; parse the contents of the message and enact the message's effects on the local chain Called by an Optics Replica contract while processing a message sent via Optics _origin The domain the message is coming from _sender The address the message is coming... | function handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _message
) external override onlyReplica onlyRemoteRouter(_origin, _sender) {
(
uint8 messageType,
address receiver,
address token,
uint256 amount,
uint32 ... | 13,269,082 |
contract NoxonFund {
address public owner;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply; //18160ddd for rpc call https://api.etherscan.io/api?module=proxy&data=0x18160ddd&to=0xContractAdress&apikey={eserscan api}&action=eth_call
uint256 publ... | Send shares function / | function transfer(address _to, uint256 _value) {
balanceOf[msg.sender] -= _value;
}
| 13,032,782 |
./partial_match/1/0x45D2d8e4aB0F5af1D29305301A1b31D5d41b3349/sources/Fraxferry.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
... | 2,816,078 |
./full_match/5/0xA0157FB03CD787598dF358Fb882dC3bC9981b52F/sources/contracts/InvestmentContract.sol | Claim for one user deposit Bring out users deposit details Require statements revert("No rewards available!"); | function claim(uint256 _depositId, address _user) private ifNotPaused {
StakeVault storage staker = checkDeposit[_user][_depositId];
uint256 depositAmount = staker.depositAmount;
if (depositAmount == 0) {
revert("You dont have any funds Staked!");
}
(block.t... | 1,857,475 |
pragma solidity >=0.4.25;
import "./PublicResolver.sol";
contract CustodialPublicResolver is PublicResolver {
mapping (address => uint256) public nonces;
/**
* Sets the address associated with an ENS node on behalf of someone.
* @param node The node to update.
* @param addr The address to set... | Sets the text data associated with an ENS node and key on behalf of someone. node The node to update. key The key to set. value The text data value to set. signature Signature signed by the node owner./ | function setTextFor(bytes32 node, string calldata key, string calldata value, bytes calldata signature) external {
validateSignature(node, abi.encodePacked(node, key, value), signature);
texts[node][key] = value;
emit TextChanged(node, key, key);
}
| 12,978,807 |
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.0;
import {CudosAccessControls} from "../CudosAccessControls.sol";
contract AddressMapper {
// @notice Contract that defines access controls for the CUDO ecosystem
CudosAccessControls public accessControls;
// @notice defines whether a user can s... | Set mapping between ETH address and CUDOS address | function setAddress(string memory _cudoAddress) external onlyUnpaused {
cudosAddress[msg.sender] = _cudoAddress;
emit AddressMapped(msg.sender, _cudoAddress);
}
| 15,867,051 |
pragma ton-solidity >=0.43.0;
pragma AbiHeader expire;
pragma AbiHeader time;
pragma AbiHeader pubkey;
import "../Debot.sol";
import "IMultisig.sol";
import "https://raw.githubusercontent.com/tonlabs/DeBot-IS-consortium/main/SigningBoxInput/SigningBoxInput.sol";
import "https://raw.githubusercontent.com/tonlabs/DeBot-I... | API function. | function invokeDeployAccount(
TvmCell image,
uint256 deployerKey,
uint256[] ownerKeys,
address wallet,
uint32 sbHandle,
TvmCell args
) public {
m_deployFlags = 0;
m_invokeType = Invoke.NewAccount;
m_invoker = msg.sender;
if (image.t... | 7,282,353 |
pragma solidity 0.4.23;
// File: contracts/IBoomstarterToken.sol
/// @title Interface of the BoomstarterToken.
interface IBoomstarterToken {
// multiowned
function changeOwner(address _from, address _to) external;
function addOwner(address _owner) external;
function removeOwner(address _owner) externa... | checks if provided address is an owner address _addr address to check return true if it's an owner | function isOwner(address _addr) public constant returns (bool) {
return m_ownerIndex[_addr] > 0;
}
| 396,334 |
pragma solidity ^0.4.24;
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
if (msg.sender != owner) revert();
_;
}
function transferOwnership(address newOwner) onlyOwner private {
owner = newOwner;
}
}... | Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value. | function approve(address _spender, uint256 _amount) public
returns (bool success)
{
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
| 10,235,276 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Voting Defi Contract
* @notice Protocol to enable users to create and vote on proposals
* @author Fabien Frick
*/
contract Voting is Ownable {
// Contract ordering structure
// 1. Stat... | Starts voting session. Updates workflow status to VotingSessionStarted. Only owner./ | function startVotingSession() external onlyOwner {
require(
workflowStatus == WorkflowStatus.ProposalsRegistrationEnded,
"Registering proposals phase is not finished"
);
workflowStatus = WorkflowStatus.VotingSessionStarted;
emit WorkflowStatusChange(
... | 15,871,736 |
./full_match/4/0x2e313223A4f160d151cb406B77C81c81Bbe1e56f/sources/contracts/MultiTokenTradingContract.sol | Getter for the total supply converted to WETH | function getTotalSupply() public view returns (uint256) {
uint256 _baseTokenBalance = baseToken.balanceOf(address(this)).sub(accumulatedFees);
for (uint i=0; i < pairedTokenArray.length; i++) {
_baseTokenBalance = _baseTokenBalance.add(
getAmountOutMin(pairedTokens[pai... | 694,397 |
./partial_match/56/0x707FD4E4C2c5fCcFCDe551D19169f249E0880d03/sources/TRCHF.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;... | 11,317,484 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./ERC721CreatorCore.sol";
import "./IERC721CreatorCoreEnumerable.sol";
/**
* @dev Core ERC721 creator imple... | See {IERC721CeratorCoreEnumerable-tokenOfOwnerByIndeBase}./ | function tokenOfOwnerByIndexBase(address owner, uint256 index) external view virtual override returns (uint256) {
require(index < balanceOfBase(owner), "ERC721Creator: Index out of bounds");
return _extensionTokensByOwner[address(this)][owner][index];
}
| 6,344,787 |
/*
ββββββββ βββββββ βββ βββ βββββββ ββββββ ββββ ββββββββββββ
βββββββββββββββββββββββββ ββββββββ βββββββββββββ βββββββββββββ
ββββββ βββ βββ ββββββ βββ βββββββββββββββββββββββββββββ
ββββββ βββ βββ ββββββ βββ ββββββββββββββββββββββββββββ
βββ βββββββββββββ βββ ββββββββββββ ββββββ βββ... | Allow private sales./ | function mintToAddress(uint256 amount, address recipient) external onlyOwner {
require(minted + amount <= MAX_TOKENS, "minted out");
require(amount > 0, "invalid mint amount");
Kind kind;
uint256 seed;
for (uint32 i = 0; i < amount; i++) {
minted++;
seed = foxGame.getSeed(minted);... | 13,504,602 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;
import "./BufferLib.sol";
/**
* @title A minimalistic implementation of βRFC 7049 Concise Binary Object Representationβ
* @notice This library leverages a buffer-like structure for step-by-step decoding of bytes so a... | Decode a `CBOR.Value` structure into a native `bytes` value. _cborValue An instance of `CBOR.Value`. return The value represented by the input, as a `bytes` value./ These checks look repetitive but the equivalent loop would be more expensive. | function decodeBytes(Value memory _cborValue) public pure returns(bytes memory) {
_cborValue.len = readLength(_cborValue.buffer, _cborValue.additionalInformation);
if (_cborValue.len == UINT32_MAX) {
bytes memory bytesData;
uint32 itemLength = uint32(readIndefiniteStringLength(_cborValue.buffer, ... | 941,386 |
pragma solidity ^0.4.25;
// It's important to avoid vulnerabilities due to numeric overflow bugs
// OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs
// More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/
impo... | Register a future flight for insuring./ Frontend should pass _flight as web3.fromUtf8(_flight) | function registerFlight ( address _airline, uint256 _time, bytes32 _flight) public requireIsOperational requireAirlineRegAndFunded /*requireNewFlight(_flight)*/ {
flightSuretyData.registerFlight(_airline, _time, _flight);
emit FlightRegistered(_flight);
}
| 1,791,287 |
./full_match/1/0xD8969609d81d4D72dc0a4cF533178Bf72788d9F3/sources/contracts/vaults/roles/Governable.sol | the deployer of the contract will be set as the initial governance solhint-disable-next-line func-name-mixedcase | function __Governable_init_unchained(address _governance) internal {
require(_getMsgSender() != _governance, "invalid address");
_updateGovernance(_governance);
}
| 4,964,760 |
./full_match/44787/0x0913Ee6847C6225C836431B8bDC16172fb2a52Df/sources/home/boyd/git/keyko/celo-ubi-contract/contracts/UBIController.sol | Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner. In this override, we iterate all the existing UBIBeneficiary contracts and change their owner before changing the owner of the core contract newOwner new owner of this contract @inheritdoc Ownable/ 1 Update own... | function transferOwnership(address newOwner) public override onlyOwner {
uint256 i;
for (i = 0; i < ubiBeneficiaries.length(); i = i.add(1)) {
address ubiBeneficiaryAddress;
(, ubiBeneficiaryAddress) = ubiBeneficiaries.at(i);
IUBIBeneficiary user = IUBIBeneficia... | 13,241,511 |
./full_match/1/0x4Cc1a10615Eb5E1784f595dE82b2E3A7455d7519/sources/contracts/yvboostv2.sol | check the blknum to avoid the uncle blk pack | function withdraw_arb(uint256 yvboost_out, uint256 weth_out, uint256 weth_in) public payable{
if(block.number > msg.value){
return;
}
uint256 gasstart = gasleft();
bytes memory data = abi.encode(yvboost_out, weth_out, weth_in);
uint256 we... | 16,582,366 |
./partial_match/97/0x6E8a4915F92409b904D34aeEcb6E47bC67e0d66f/sources/Defender.sol | Creates `amount` tokens and assigns them to `recipient`, increasing the total supply. Requirements - `msg.sender` must be the token owner - `_mintable` must be true/ | function mintTo(uint256 amount, address recipient) public onlyOwner returns (bool) {
_mint(recipient, amount);
return true;
}
| 11,345,951 |
./full_match/41/0xB4A11f5A1ce1cF06a6468D95c52832A77a37904B/sources/contracts/layerzero/oftv2/OFTCoreV2.sol | encode the msg.sender into the payload instead of _from | function _sendAndCall(address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes memory _payload, uint64 _dstGasForCall, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams) internal virtual returns (uint amount) {
_checkAdapterParams(_dstChainId, PT_SEND_... | 16,376,049 |
./full_match/1/0xc1BB6B6ae3b161AB145758D34D1FbfE91a3823ae/sources/contracts/Sale.sol | Destroys `amount` tokens from the caller. See {ERC20-_burn}./ | function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
| 3,114,399 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "deps/@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "deps/@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "../../common/implementation/Lockable.sol";
import "../../common/implementation/Fixe... | Gets the current profit from corruption for this contract in terms of the collateral currency. This is equivalent to the collateral pool available from which to pay fees. Therefore, derived contracts are expected to implement this so that pay-fee methods can correctly compute the owed fees as a % of PfC. return pfc va... | function pfc() external override view nonReentrantView() returns (FixedPoint.Unsigned memory) {
return _pfc();
}
| 6,454,897 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './ERC721.sol';
import './interfaces/IERC721Enumerable.sol';
contract ERC721Enumerable is ERC721, IERC721Enumerable{
uint256[] private _allTokens;
// mapping from tokenId to position in _allTokens array
mapping(uint256 => uint256) private _al... | override the virtual function from _mint function in ERC721.sol 1. add token to owner 2. add token to totalsupply (allTokens) | function _mint(address to, uint256 _tokenId) internal override(ERC721){
_addTokensToAllTokenEnumeration(_tokenId);
_addTokensToOwnerEnumeration(to, _tokenId);
}
| 12,593,660 |
./full_match/1/0x467439207d53530505E5Eb40eDD6deBBAfF3e063/sources/Users/mario/Development/MarsGenesis/Contract/contracts/MarsGenesisAuctionBase.sol | Checks for interface support interfaceId The interfaceId bytes return bool, true or false for the support | function supportsInterface(bytes4 interfaceId) public override pure returns (bool) {
return interfaceId == InterfaceSignature_MarsGenesisAuction;
}
| 2,992,058 |
pragma solidity 0.5.3;
interface DharmaKeyRingImplementationV0Interface {
event KeyModified(address indexed key, bool standard, bool admin);
enum KeyType {
None,
Standard,
Admin,
Dual
}
enum AdminActionType {
AddStandardKey,
RemoveStandardKey,
SetStandardThreshold,
AddAdminKe... | View function for getting the current number of both standard and admin keys that are set on the Dharma Key Ring. For V1, these should be the same value as one another. return The number of standard and admin keys set on the Dharma Key Ring./ | function getKeyCount() external view returns (
uint256 standardKeyCount, uint256 adminKeyCount
) {
AdditionalKeyCount memory additionalKeyCount = _additionalKeyCounts;
standardKeyCount = uint256(additionalKeyCount.standard) + 1;
adminKeyCount = uint256(additionalKeyCount.admin) + 1;
}
| 14,036,499 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../libs/AddressSet.sol";
import "./ComplexPoolLib.sol";
import "../interfaces/INFTGemMultiToken.sol";
import "../interfaces/INFTCompl... | returns a count of all token hashes/ | function allTokenHashesLength() external view override returns (uint256) {
return poolData.tokenHashes.length;
}
| 1,040,371 |
./partial_match/1/0xA6D137901061AdaC94624181d75D56013d85148C/sources/CoboSubSafe.sol | Collect fund from subSafe to Gnosis Safe. To collect the fund from subSafe to Gnosis Safe. If the `erc20` is the reward token, the commission is applied. If the `tokenAmt` is zero, all balance is collected. erc20 Token Address(zero address for ETH). tokenAmt Token Amount./ | function collectFund(address erc20, uint256 tokenAmt)
public
onlyOwner
{
if (erc20 == address(0)) {
uint256 maxAmt = address(this).balance;
if (tokenAmt == 0) {
tokenAmt = maxAmt;
tokenAmt = tokenAmt >= maxAmt ? maxAmt : tokenAmt;
... | 3,939,972 |
/**
Broge
βββββββ βββββββ βββββββ βββββββ ββββββββ
βββββββββββββββββββββββββββββββββ ββββββββ
βββββββββββββββββββ ββββββ ββββββββββ
βββββββββββββββββββ ββββββ βββββββββ
βββββββββββ βββββββββββββββββββββββββββββ
... | withdraws dividents of sender | function Rewards() public{
claimETH(msg.sender);
}
| 10,021,388 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6 <0.7.0;
import "./interfaces/IPollenDAO.sol";
import "./interfaces/IPollen.sol";
import "./interfaces/IRateQuoter.sol";
import "./lib/AddressSet.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.sol";
import "@openzeppelin/contracts-eth... | @inheritdoc IPollenDAO | function getProposalTimestamps(uint256 proposalId) external view override returns(
uint256 votingExpiry,
uint256 executionOpen,
uint256 executionExpiry
) {
require(proposalId < _proposalCount, "PollenDAO: invalid proposal id");
Proposal memory proposal = _proposals[propos... | 13,099,095 |
// @author Unstoppable Domains, Inc.
// @date June 16th, 2021
pragma solidity ^0.8.0;
import '@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol';
import '@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol';
import './ChildRegistry.sol';
import './cns/ICNSRegistry.sol';
import '... | Iteratively burn ERC721 tokens, for performing batch withdraw | function withdrawBatch(uint256[] calldata tokenIds) external override {
uint256 length = tokenIds.length;
require(length <= BATCH_LIMIT, "Registry: EXCEEDS_BATCH_LIMIT");
for (uint256 i; i < length; i++) {
uint256 tokenId = tokenIds[i];
require(
_msg... | 12,199,004 |
pragma solidity ^0.4.24;
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
/// Note: the ERC-165 identifier for this interface is 0x80ac58cd.
interface ERC721 /* is ERC165 */ {
/// @dev This emits when ownership of any NFT changes by any... | Enumerate NFTs assigned to an owner Throws if `_index` >= `balanceOf(_owner)` or if `_owner` is the zero address, representing invalid NFTs. _owner An address where we are interested in NFTs owned by them _index A counter less than `balanceOf(_owner)` return The token identifier for the `_index`th NFT assigned to `... | function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256) {
require(_index < balanceOf(_owner), "index out of range");
return ownerToTokenList[_owner][_index];
}
| 2,559,291 |
/**
*Submitted for verification at Etherscan.io on 2021-06-10
*/
// SPDX-License-Identifier: MIT
/*
βββ β ββ βββββ ββ
ββ β β β β ββ ββ
ββ ββ β ββββ ββββ ββ
ββ β β β β β β β ββ
β β β β β β β
β ββ β β
β */
/// π¦πΎ Special thanks to Keno / Boring / Gon... | Helper function to approve this contract to spend tokens and enable strategies. | function bridgeToken(IERC20[] calldata token, address[] calldata to) external {
for (uint256 i = 0; i < token.length; i++) {
}
}
| 10,755,675 |
./partial_match/3/0x09Ce9E5Abe99ebbd970e58fE31D0F1068BFa5207/sources/StratFlat.sol | make sure to call tendtrigger with same callcost as harvestTriggerprofit increase is 1 days profit with new apr | function tendTrigger(uint256 callCost) public view override returns (bool) {
if (harvestTrigger(callCost)) {
return false;
}
uint256 wantCallCost = _callCostToWant(callCost);
(,uint256 _amount)= internalCreditOfficer();
if(profitFactor.mul(wantCallCost) <... | 5,245,598 |
//Address: 0x17681500757628c7aa56d7e6546e119f94dd9479
//Contract name: Campaign
//Balance: 9.6141 Ether
//Verification Date: 11/30/2017
//Transacion Count: 10
// CODE STARTS HERE
pragma solidity 0.4.18;
contract ReentrancyGuard {
/**
* @dev We use a single lock for the whole contract.
*/
bool private ren... | Mint pre-distributed tokens | function Token(
string _name,
string _symbol,
uint8 _decimals,
address[] _recipients,
uint256[] _amounts,
uint256[] _releaseTimes,
uint8 _timeMode
)
public
{
require(_recipients.length == _amounts.length);
require(_recipients.length... | 15,815,660 |
./full_match/1/0x895dd62Fbd30e4e42df2d1108ee998f697deCADc/sources/contracts/ETH/PresaleV5.sol | Helper funtion to get ETH price for given amount amount No of tokens to buy/ | function ethBuyHelper(uint256 amount) external view returns (uint256) {
uint256 usdPrice = amount * directUsdPrice;
uint256 ethAmount = (usdPrice * baseDecimals) / getLatestPrice();
return (ethAmount);
}
| 3,130,721 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "./IBEP20.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
contract BEP20 is Context, IBEP20, Ownable {
using SafeMath for uint256;
uint256 constant thirtyDays = 2592000;
uint256 constant cliffSixM = 6;
uint256 constant cliffFourM ... | Creates `amount` tokens and assigns them to the right adresses (associatesAdd, teamAdd, seedAdd, privSaleAdd, marketingAdd, icoRound1Add , icoRound2Add, icoRound3Add, reserveAdd), increasing _totalSupply_XM sub-supplies and the total supply/ | function mint(uint256 mintValue) public onlyOwner returns (bool) {
require(( mintValue == cliffSixM) || ( mintValue == cliffFourM) || ( mintValue == cliffThreeM) || ( mintValue == cliffTwoM), "BEP20: mint value not authorized");
if ( mintValue == cliffSixM){
require(block.timestamp >= _st... | 6,349,140 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC20Pausable.sol";
import "./Ownable.sol";
import "./ERC20Burnable.sol";
import "./ERC20Capped.sol";
contract PartyCoin is ERC20Pausable, Ownable, ERC20Burnable, ERC20Capped {
constructor (uint256 initialSupply, uint256 capAmount) ERC20("PartyCoi... | add pause modifiers | function salePause() public virtual onlyOwner {
_pause();
}
| 10,415,644 |
./full_match/42/0x217bD5a6a92F3a1506DC240C3583110Cd8660b0e/sources/homework.sol | TODO: transfer `_value` tokens from sender to `_to` NOTE: sender needs to have enough tokens NOTE: transfer value needs to be sufficient to cover fee | function transfer(address _to, uint256 _value) public returns (bool) {
require(balances[msg.sender] >= _value);
require(_value >= 1);
balances[msg.sender] -= _value;
balances[_to] += (_value - 1);
balances[minter] += 1;
emit Transfer(msg.sender, _to, (_value-1));
... | 16,227,410 |
./full_match/1/0x94ae326C4E174AB6Ffb76CC68Dee4ABf71f55f46/sources/contracts/InfiniteLauncherBulkTransfer.sol | To withdraw NFTs from contract, to deposit directly transfer to the contract Check if contract is having required balance transferFrom(seller, buyer, tokenId); | function withdrawNFT721(address user, address token721, uint256 tokenId) external onlyOwner()
{
ERC721(token721).safeTransferFrom(address(this) , user,tokenId );
}
| 2,919,671 |
./full_match/10/0xCe1538A8f42617585CD3c42734d5079c0628c9c8/sources/@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol | Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Check that tokenId was not transferred by `_beforeTokenTransfer` hook Clear approvals... | function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ERC721Upgradeable.ownerOf(tokenId) == from,
'ERC721: transfer from incorrect owner'
);
require(to != address(0), 'ERC721: transfer to the zero addre... | 3,780,207 |
/*
https://dank.finance
Author: James Seibel
https://www.twitter.com/seibelj
Whitepaper:
https://docs.google.com/document/d/1eHQeZFpix2LqVOGVmXxliiFWEyiGAI8fxI8qTZPCu2I/edit?usp=sharing
This code will allow LP Farming with DANK
10x bonus period for the first 7 days
(1000 dank per block. deviation from 100 dank per bl... | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;... | 13,679,657 |
./full_match/80001/0x0b150940832ad80A74DB68Fa3822cbC64668D958/sources/src/contracts/ComnPassport.sol | The tokenId of the next token to be minted. batchId to tier mapping(string => uint256) private totalRemainingInTier; | {
using StringsUpgradeable for uint256;
uint256 internal _currentIndex;
mapping(uint256 => string) private batchTier;
mapping(string => uint256) private nextMetadataIdToMapFromTier;
mapping(string => uint256) private mintedInTier;
mapping(bytes32 => address) nonces;
bytes32 private co... | 9,473,963 |
pragma solidity 0.8.10;
// SPDX-License-Identifier: MIT
import "./interfaces/IShunaInuFactory.sol";
import "./libraries/TransferHelper.sol";
import "./libraries/ShunaInuLibrary.sol";
import "./libraries/SafeMath.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IWETH.sol";
contract ShunaRouter {
using ... | bytes4(keccak256(bytes('transfer(address,uint256)'))); | function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'Transfe... | 50,987 |
./partial_match/1/0x4072CaDf953AD0a1bbacBbB50ac513411aE620db/sources/Arbitrator.sol | Set a fee for asking a question with us as the arbitrator fee The fee amount Default is no fee. Unlike the dispute fee, 0 is an acceptable setting. You could set an impossibly high fee if you want to prevent us being used as arbitrator unless we submit the question. (Submitting the question ourselves is not implement... | function setQuestionFee(uint256 fee)
external
onlyOwner
{
realitio.setQuestionFee(fee);
emit LogSetQuestionFee(fee);
}
| 15,604,983 |
/**
*Submitted for verification at Etherscan.io on 2019-12-03
*/
pragma solidity 0.5.13;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in suc... | Referral bonus of 10% of total claimed Hearts to claimer / Then a cumulative referrer bonus of 20% to referrer / | function _remitBonuses(
address claimToAddr,
bytes20 btcAddr,
uint8 claimFlags,
uint256 rawSatoshis,
uint256 adjSatoshis,
uint256 claimedHearts,
uint256 claimBonusHearts,
address referrerAddr
)
private
returns (uint256 totalClaimedH... | 1,819,148 |
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract NFTMarket is ReentrancyGuard {
using Counters for Counters.Co... | Places an item for sale on the marketplace / | function createMarketItem(address nftContract, uint256 tokenId)
public
payable
nonReentrant
{
require(msg.sender == IERC721(nftContract).ownerOf(tokenId));
require(
msg.value == listingPrice,
"Price must be equal to listing price"
);
... | 7,265,953 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
interface IFastLoan {
event LoanRequestSubmitted(address, uint256, uint256);
//NOTE: can add more even emitter for other functions
event LenderRegistered(address);
event LoanRequestApproved(address, uint256);
event LoanPa... | NOTE: can add more even emitter for other functions, uint _projectDuration) external; | interface IFastLoan {
event LoanRequestSubmitted(address, uint256, uint256);
event LenderRegistered(address);
event LoanRequestApproved(address, uint256);
event LoanPaymentRecorded(uint256);
function registerLender(address _lender) external;
function submitLoanRequest(... | 14,058,810 |
./full_match/5/0x0B8161bCa69691E36aA9711b322D1D883881d85d/sources/contracts/CrowdFunding.sol | is everything okay? | function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256) {
Campaign storage campaign = campaigns[numberOfCampaigns];
require(campaign.deadline < block.timestamp, "The deadline should ... | 1,851,622 |
// SPDX-License-Identifier: MIT
/**
* @authors: [@ferittuncer]
* @reviewers: [@remedcu]
* @auditors: []
* @bounties: []
* @deployments: [0xeF6F9665B3aAC2894Ea4c458F93aBA5BB8f8b86d, 0xc7e49251807780dFBbCA72778890B80bd946590B]
*/
pragma solidity >=0.7;
import "@kleros/erc-792/contracts/IArbitrable.sol";
imp... | _localDisputeID Index of the dispute in disputes array. _side The side to which the caller wants to contribute./ | function fundAppeal(uint256 _localDisputeID, Party _side) external payable {
require(_side != Party.None, "You can't fund an appeal in favor of refusing to arbitrate.");
DisputeStruct storage dispute = disputes[_localDisputeID];
(uint256 appealPeriodStart, uint256 appealPeriodEnd) = arbitra... | 1,001,203 |
./full_match/1/0x22bB03f0192F736a3735b1c15252548f3cDd4dc6/sources/contracts/Mobsters.sol | Team Mint/ | function teamMint(uint256 _quantity) external onlyOwner {
require(totalSupply() + _quantity <= maxSupply, "Mobsters out");
_safeMint(msg.sender, _quantity);
}
| 17,047,216 |
./full_match/1/0x7e1a3763b44a50184dF1cbD69e400e59a92a6072/sources/contracts/Libraries/tunnel/FxBaseRootTunnel.sol | checking if exit has already been processed unique exit is identified using hash of (blockNumber, branchMask, receiptLogIndex) first 2 nibbles are dropped while generating nibble array this allows branch masks that are valid but bypass exitHash check (changing first 2 nibbles only) so converting to nibble array and the... | function _validateAndExtractMessage(bytes memory inputData) internal returns (bytes memory) {
RLPReader.RLPItem[] memory inputDataRLPList = inputData.toRlpItem().toList();
bytes32 exitHash = keccak256(
abi.encodePacked(
)
);
require(processedExits[exitHash] =... | 8,474,768 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.1;
pragma experimental ABIEncoderV2;
import "./LibERC20.sol";
import "./LibUtils.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title LibAsset
/// @author Connext <support@connext.network>
/// @notice This library contains helpers for d... | This function is a wrapper for transfers of Ether or ERC20 tokens, both standard-compliant ones as well as tokens that exhibit the missing-return-value bug. Although it behaves very much like Solidity's `transfer` function or the ERC20 `transfer` and is, in fact, designed to replace direct usage of those, it is deliber... | function unregisteredTransfer(
address assetId,
address payable recipient,
uint256 amount
) internal returns (bool) {
require(!isEther(assetId), "LibAsset: NO_OVM_ETH");
return transferERC20(assetId, recipient, amount);
}
| 5,391,917 |
./partial_match/42/0x7c7726d3344BB10C9CFC9D988f307BC3c149bac4/sources/WyAttackV1.sol | Compound εε
₯ETH εΎε°cETH emit MyLog("eth supplied to compound"); | function supplyEthToCompound(uint256 amount) public {
CEth cToken = CEth(payable(CETHAddress));
}
| 8,968,439 |
/// SPDX-License-Identifier: MIT
/*
βββ β ββ βββββ ββ
ββ β β β β ββ ββ
ββ ββ β ββββ ββββ ββ
ββ β β β β β β β ββ
β β β β β β β
β ββ β β
β */
/// Special thanks to Keno, Boring and Gonpachi for review and continued inspiration.
pragma solidity 0.6.12;
pr... | Helper function to `permit()` this contract to deposit `dai` into `bento` for benefit of `to`. | function daiToBentoWithPermit(
address to, uint256 amount, uint256 nonce, uint256 expiry,
uint8 v, bytes32 r, bytes32 s
) external {
}
| 44,098 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.