file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/**
*Submitted for verification at Etherscan.io on 2021-03-08
*/
pragma solidity ^0.7.6;
library SafeMathUpgradeable {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - ... | The {SafeMath} overflow check can be skipped here, see the comment at the top | function increment(Counter storage counter) internal {
counter._value += 1;
}
| 7,899,423 |
pragma solidity ^0.5.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns th... | stake visibility is public as overriding ChonkTokenWrapper's stake() function | function stake(uint256 amount) public updateReward(msg.sender) {
require(amount.add(balanceOf(msg.sender)) <= 5000000000000000000, "Cannot stake more than 5 chonk");
super.stake(amount);
emit Staked(msg.sender, amount);
}
| 14,995,938 |
./partial_match/56/0xD4e40529705deDDce4C406FD17bacfa48F1e5b15/sources/StrategysoakLPV2.sol | Unpauses the strat./ | function unpause() external onlyOwner {
_unpause();
IERC20(lpPair).safeApprove(shareRewardPool, uint256(-1));
IERC20(soak).safeApprove(unirouter, uint256(-1));
IERC20(wbnb).safeApprove(unirouter, uint256(-1));
IERC20(busd).safeApprove(unirouter, uint256(-1));
IERC20... | 11,043,471 |
./partial_match/56/0xd7afF7ab21E8782134F2b3063d10700116ccB152/sources/MasterChef.sol | Safe bnbbase transfer function, just in case if rounding error causes pool to not have enough BNBBASEs. | function safeBNBBaseTransfer(address _to, uint256 _amount) internal {
uint256 bnbbaseBal = bnbbase.balanceOf(address(this));
if (_amount > bnbbaseBal) {
bnbbase.transfer(_to, bnbbaseBal);
bnbbase.transfer(_to, _amount);
}
}
| 11,061,263 |
./full_match/4/0xC209E294664C8Cb5B55EbF1CAE6CaCCd024Cb822/sources/contracts/ERC721A.sol | Packs ownership data into a single uint256./ Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. `owner | (block.timestamp << BITPOS_START_TIMESTAMP) | flags`. | function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
owner := and(owner, BITMASK_ADDRESS)
result := or(owner, or(shl(BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
| 727,649 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
pragma abicoder v2;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import 'base64-sol/base64.sol';
import './legacy_colors/Th... | Withdraw accrued funds from contract. 50% treasury, 10% to each team member/ | function withdraw() internal {
bool sent;
uint256 balance = address(this).balance;
require(sent);
require(sent);
}
| 7,284,264 |
./full_match/1/0x25127685dC35d4dc96C7fEAC7370749d004C5040/sources/unibot_token.sol | See { IERC20-transfer} . Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| 17,004,631 |
pragma solidity ^0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high ... | Deposits core coin into the fund and allocates a number of shares to the sender depending on the current number of shares, the funds value, and amount deposited return The amount of shares allocated to the depositor/ Check if the sender is allowed to deposit into the fund Require that the amount sent is not 0 Transfer ... | function deposit(uint256 depositAmount) external returns (uint256) {
verifyDWSender();
if (onlyWhitelist)
require(whitelist[msg.sender]);
require(depositAmount > 0, "ZERO_DEPOSIT");
require(IERC20(coreFundAsset).transferFrom(msg.sender, address(this), depositAmount),
"TRANSFER_FROM_ISSUE"... | 6,834,622 |
./full_match/421613/0x759b5FA1ACCFBD6778Bea30CDA525f2a23Aa836B/sources/project_/contracts/TokenBridgeUpgradeableV2.sol | Public functions/ | function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public virtual override(TokenBridgeUpgradeable) returns (bytes4) {
address tokenAddress = msg.sender;
address to = address(this);
uint256 amount = 1;
emit Transfer(INTERFACE_ID_IERC721, tokenAddress, from, to... | 11,571,346 |
pragma solidity ^0.4.17;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfe... | get released list in 39 days/ | function getReleased() public view returns (uint256[]) {
return released;
}
| 6,434,836 |
./partial_match/1/0xF1E16a63bf98f15B4dDe7C5726bb793403AF50d1/sources/AVATAR.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Avatar Inu", "$Avatar") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory... | 9,156,732 |
./full_match/44787/0x33F8d23a573544a9D80B74c029a3aB392aEDB40A/sources/contracts/StarFarm.sol | Withdraw LP tokens from MasterChef. require (_pid != 0, 'withdraw STAR by unstaking'); | function withdraw(uint256 _pid, uint256 _amount) public {
if (_pid == 0) require(userNFTs[_msgSender()].length == 0, "nft user");
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_msgSender()];
require(user.amount >= _amount, "withdraw: amount error");
... | 13,250,120 |
./full_match/42/0x18210bfc94C1272C21F9a1faABDd4719309e19f0/sources/github/FerianiAiden/CSC59866_2P_POKER/mainpagee/bot/2pPoker.sol | If a dead tie was determined, call this function | function splitPot() public{
require(stages == STAGES.PAYOUT, "Denied - Not in Payout stage");
player1.transfer(betPlayer1);
player2.transfer(betPlayer2);
restartGame();
}
| 9,596,243 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Contracts
import { RolesMods } from "../contexts2/access-control/roles/RolesMods.sol";
import { ADMIN, PAUSER, AUTHORIZED } from "../shared/roles.sol";
import {
UpgradeableBeaconFactory
} from "../shared/proxy/beacon/UpgradeableBeaconFactory.sol";
import {... | it stores multiple parameters in the AppStorageLib _args multiple arguments that are stored in the AppStorageLibrary/ | function init(InitArgs calldata _args) external {
AppStorage storage s = AppStorageLib.store();
if (s.initialized) return;
s.initialized = true;
RolesLib.grantRole(ADMIN, _args.admin);
RolesLib.grantRole(PAUSER, _args.admin);
for (uint256 i; i < _args.assets.length... | 7,242,297 |
/**
*Submitted for verification at Etherscan.io on 2021-05-18
*/
// File: @openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. T... | manager == alternative admin caller to owner/ | function setManager(address _manager) public onlyOwner {
manager = _manager;
}
| 2,408,650 |
/**
* This smart contract code is Copyright 2018 WiBX. For more information see https://wibx.io
*
* Licensed under the Apache License, version 2.0: https://github.com/wibxcoin/Contracts/LICENSE.txt
*/
pragma solidity 0.5.12;
/**
* @title BCH Handled tokens contract
*
* @dev Addresses owned by BCH
*/
contract ... | Check if the address is handled by BCH. wallet The address to check/ | function isBchHandled(address wallet) public view returns (bool)
{
return _bchAllowed[wallet];
}
| 12,851,523 |
./partial_match/1/0xDEf136D9884528e1EB302f39457af0E4d3AD24EB/sources/LimitOrders.sol | Cancels an order as long as it is not already canceled./ | function cancelOrderInternal(
address canceler,
Order memory order
)
private
{
Require.that(
canceler == order.makerAccountOwner,
FILE,
"Canceler must be maker"
);
bytes32 orderHash = getOrderHash(order);
g_status[or... | 15,486,179 |
./partial_match/1/0xe4f5cd7a511280d8656f346daA628924b36a872a/sources/ScaryInu.sol | change the minimum amount of tokens to sell from fees | function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool){
require(newAmount >= totalSupply() * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply.");
require(newAmount <= totalSupply() * 20 / 1000, "Swap amount cannot be higher than 0.5% total supply.");
... | 4,286,183 |
./full_match/1/0xD8b71e620C395253F09bAb64B8587bb0579Ef456/sources/browser/BCY.sol | Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint... | 4,852,847 |
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY831() external view returns (uint256); //i... | inject NONSTANDARD NAMING | function LOG714(address p0, bool p1, address p2) internal view { | 14,087,722 |
pragma solidity 0.5.8;
// From: https://github.com/mixbytes/solidity/blob/master/contracts/ownership/multiowned.sol
// Copyright (C) 2017 MixBytes, LLC
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// Unless required by applicab... | changes the required number of owner signatures _newRequired new number of signatures required All pending operations will be canceled! | function changeRequirement(uint256 _newRequired)
external
multiOwnedValidRequirement(_newRequired, m_numOwners)
onlyManyOwners(keccak256(msg.data))
{
m_multiOwnedRequired = _newRequired;
clearPending();
emit RequirementChanged(_newRequired);
}
| 13,119,934 |
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "../SafeMath.sol";
import "../NamedContract.sol";
import "./GovernanceStorage.sol";
import "./IGovernanceTimelock.sol";
import "./IStaking.sol";
import "./GovernanceEvent.sol";
/// @title Governance Contract
contract Governance is NamedContract, Govern... | The maximum number of actions that can be included in a proposal | function setProposalMaxOperations(uint256 proposalMaxOperations) external {
require(
msg.sender == _guardian,
"Only the guardian can set proposal max operations"
);
uint256 oldValue = _proposalMaxOperations;
_proposalMaxOperations = proposalMaxOperations;
... | 12,954,954 |
./full_match/3/0x57eC043A0CC2bb4d92B5e4F4db62dEC78249d89A/sources/contracts/nft.sol | only "notMinted" items are up for minting set tokenURI for plugging in our metadata to NFT | function mintItem(string memory tokenURI) external returns (uint256) {
require(notMinted[tokenURI],"NOT FOR SALE");
notMinted[tokenURI] = false;
_mint(msg.sender, _tokenId);
_setTokenURI(_tokenId, tokenURI);
return _tokenId;
}
| 8,204,409 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
import './interfaces/IArchRouterImmutableState.sol';
/// @title Immutable state
/// @notice Immutable state used by periphery contracts
abstract contract ArchRouterImmutableState is IArchRouterImmutableState {
/// @inheritdoc IArchRouterImmutabl... | @inheritdoc IUniV3Router it's okay that the payer is fixed to msg.sender here, as they're only paying for the "final" exact output swap, which happens first, and subsequent swaps are paid for within nested callback frames | function exactOutput(ExactOutputParams calldata params)
public
payable
override
returns (uint256 amountIn)
{
_exactOutputInternal(
params.amountOut,
params.recipient,
0,
);
amountIn = amountInCached;
require(amo... | 11,683,083 |
pragma solidity ^0.4.25;
/**
*
* Best Multiplier - profitable financial game
* Honest, fully automated smart quick turn contract with a jackpot system
*
* Web - https://bestmultiplier.biz
* Telegram channel - https://t.me/bestMultiplierNews
* Telegram chat - https://t.me/bestMultiplier
... | How many percent for your deposit to be multiplied at now | function calcMultiplier() public view returns (uint) {
if (totalInvested <= 75 ether) return 120;
if (totalInvested <= 200 ether) return 130;
if (totalInvested <= 350 ether) return 135;
}
| 12,980,975 |
pragma solidity ^0.6.2;
// SPDX-License-Identifier: MIT
... | inject NONSTANDARD NAMING | function SYMBOL131() external pure returns (string memory); | 1,820,573 |
./full_match/1/0x5E16CA75000fb2B9d7B1184Fa24fF5D938a345Ef/sources/src/libs/LibSecp256k1.sol | Returns the Ethereum address of `self`. An Ethereum address is defined as the rightmost 160 bits of the keccak256 hash of the concatenation of the hex-encoded x and y coordinates of the corresponding ECDSA public key. See "Appendix F: Signing Transactions" §134 in the Yellow Paper. Functionally equivale... | function toAddress(Point memory self) internal pure returns (address) {
address addr;
assembly ("memory-safe") {
addr := and(keccak256(self, 0x40), ADDRESS_MASK)
}
return addr;
}
| 17,126,990 |
./full_match/1/0x8aed0055D691e6d619AcC96Ad0fB3461f5774646/sources/contracts/prime-token/PrimeTokenProxy.sol | Identical function to `send` except users can bridge using prime invokeEchelon call. This way users do not have to approve PrimeTokenProxy to spend prime and bridge their tokens. prime will be sent to a primeDestinationAddress that has already approved PrimeTokenProxy and ethDestinationAddress w... | function handleInvokeEchelon(
address _from,
address _ethDestinationAddress,
address _primeDestinationAddress,
uint256,
uint256,
uint256 _primeValue,
bytes memory _data
) public payable {
if (isDisabled) {
revert ContractDisabled();
... | 3,171,404 |
./full_match/1/0x30Ce56e80aA96EbbA1E1a74bC5c0FEB5B0dB4216/sources/lib/Cooler/src/Cooler.sol | Function sig taken from gOHM contract | interface IDelegate { function delegate(address to_) external; }
| 2,954,545 |
pragma solidity ^0.4.23;
import "openzeppelin-solidity/contracts/ownership/rbac/RBAC.sol";
contract Blacklisted is RBAC {
string constant BKLST_ROLE = "blacklist";
bool public blacklistUnlocked;
constructor() public {}
modifier notBlacklisted() {
require(blacklistUnlocked || !isBlacklisted(... | Allows admins to add people to the blacklist. _toAdd The address to be added to blacklist./ | function addToBlacklist(address _toAdd) public {
require(!isBlacklisted(_toAdd), "Address is blacklisted already");
addRole(_toAdd,BKLST_ROLE);
}
| 5,515,064 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not b... | Replacement for Solidity's `transfer`: sends `amount` wei to `recipient`, forwarding all available gas and reverting on errors. of certain opcodes, possibly making contracts go over the 2300 gas limit imposed by `transfer`, making them unable to receive funds via `transfer`. {sendValue} removes this limitation. IMPORTA... | function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, ERR);
require(success, ERR);
}
| 613,822 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../libraries/MathLib.sol";
import "../interfaces/IPendleRouter.sol";
import "../interfaces/IPendleData.sol";
import "..... | Have Reentrancy protection/ note that LP minting will be done in the market | function addMarketLiquidityDual(
bytes32 _marketFactoryId,
address _xyt,
address _token,
uint256 _desiredXytAmount,
uint256 _desiredTokenAmount,
uint256 _xytMinAmount,
uint256 _tokenMinAmount
)
public
payable
override
nonRee... | 6,038,721 |
./full_match/1/0x341956C0c653d3348f86d6278f10dD52071312EE/sources/browser/CETO.sol | See {IERC20-approve}. Requirements: - `spender` cannot be the zero address./ 成都链安 用户调用该函数修改授权值时,可能导致多重授权。建议用户使用increaseAllowance与decreaseAllowance修改授权值 | function approve(address spender, uint256 amount) public virtual override returns (bool) {
return true;
}
| 8,410,968 |
pragma solidity ^0.4.11;
import './SafeMath.sol';
import './MultiAccount.sol';
import './Owned.sol';
import './DecimalMath.sol';
// prism component factories and interfaces
import './Prism.sol';
import './PrismFactory.sol';
import './PrismLogger.sol';
contract PrismCreationManager is Owned {
enum RequestState { ... | When funds are sent to the manager, record the sender and check if a prism contract is ready to be created. / only accept funds from addresses that have requested a prism fire the FundsSent event leave it up to an off-chain process to determine when the creation process should begin (i.e. when the buyer has sent enough... | function() lock payable {
if(msg.value == 0) {
cancel();
}
else {
if(requests[msg.sender].state != RequestState.Requested) revert();
account.deposit.value(msg.value)(msg.sender);
logger.logFundsSent(msg.sender, requests[msg.sender].prismDataHash, msg.value);
}
}
| 13,079,899 |
./partial_match/1/0xa89f75f227b35949F24508768252A4e31aA33e33/sources/PositionTokenLogicV2.sol | Public functions / | function()
external
payable
function mintWithEther(
address receiver,
uint256 maxPriceAllowed)
public
payable
returns (uint256)
{
return mintWithEther(
receiver,
maxPriceAllowed,
""
);
}
| 4,343,724 |
./full_match/43114/0xcd35d77c69ce4A7f5c8c2B9E4363179ed97E2EC1/sources/comptroller/avax/TraderJoeLibrary.sol | check that pair exists | function getReservesWithPair(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB, address pair) {
if (tokenA == tokenB)
return (0, 0, pair);
(address token0,) = sortTokens(tokenA, tokenB);
pair = pairFor(factory, tokenA, tokenB);
... | 4,575,069 |
./partial_match/1/0x4d1Fa6453c713216944a8d512336D9c66CE82f30/sources/contracts/Interfaces/CERC20.sol | Helper function to transfer the collected tokens from a previous grandmaster to the new one. Will be called by `illusion` and the child contract has the responsibility to implement it. Returns: - `caster` the new grandmaster/ | function _transferGrandMaster(address caster) internal virtual {}
| 2,654,663 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "../../CompositePlus.sol";
/**
* @title CurveBTC+ token contract.
*
* CurveBTC+ is a composite plus backed by a basket of Curve BTC CRV LPs,
* including vault LPs backed by Curve BTC CRV.
*/
contract CurveBTCPlus is CompositePlus {
/**
* @d... | Initializes the CurveBTC+ contract./ | function initialize() public initializer {
CompositePlus.initialize("Curve BTC Plus", "CurveBTC+");
}
| 5,417,179 |
/**
*Submitted for verification at Etherscan.io on 2022-01-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes call... | See {BEP20-approve}. Requirements: - `spender` cannot be the zero address./ function approve(address spender, uint256 amount) external override returns (bool) { _approve(_msgSender(), spender, amount); return true; } | function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| 2,083,805 |
./partial_match/4/0xfc2D83e20ac8836c897779352F54151080876dB0/sources/Files.sol | filesByIpfsHash[size] = new FileMetadataIpfs(_ipfsHash); filesByIpfsHash[size] = FileMetadataAuthor(_author); FileMetadataAuthor memory newRecordAuthor = FileMetadataAuthor(_author); filesByAuthor[size].push(newRecordAuthor); filesByIpfsHash memory newRecordHash = filesByIpfsHash(_ipfsHash); filesByIpfsHash[size].push(... | function addFile(string memory _ipfsHash, string memory _author) public returns (uint256) {
FileMetadataIpfs memory newRecordIpfs = FileMetadataIpfs(_ipfsHash);
filesByIpfsHash[size].push(newRecordIpfs);
FileMetadataAuthor memory newRecordAuthor = FileMetadataAuthor(_author);
filesBy... | 8,618,122 |
//Address: 0xaef15564aed6447ed3debd89c8f28c10a5a52eec
//Contract name: TokenFacade
//Balance: 0 Ether
//Verification Date: 1/28/2018
//Transacion Count: 346
// CODE STARTS HERE
pragma solidity ^0.4.15;
contract Permittable {
mapping(address => bool) permitted;
function Permittable() public {
permit... | Number of decimal placesTokens stored as integer values multiplied by multiplier. I.e. 1 token with 8 decimals would be stored as 100,000,000Tokens amount to send exhausting warningToken price in weis per 1Decimator for the percents (1000 = 100%)TransferFee(10) == 1%PurchaseFee(157) == 15.7%PurchaseCap(5000) == 5000.00... | function _start() public onlyPermitted {
uint decimalPlaces = 8;
setSetting("decimalPlaces", decimalPlaces);
setSetting("multiplier", 10 ** decimalPlaces);
setSetting("exhaustingNumber", 2 * 10**decimalPlaces);
setSetting("tokenPrice", 15283860872157044);
setSetti... | 7,281,214 |
./full_match/80001/0x889aD6cfb78E168BC7514D18909503821cb68E35/sources/ERC721A.sol | See {IERC721Metadata-tokenURI}./ | function tokenURI(uint256 tokenId, string memory baseExtension) public view virtual returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
if (_exists(tokenId)) return string(abi.encodePacked(baseURI, Strings.toString(tokenI... | 5,638,742 |
pragma solidity 0.5.16;
interface IBEP20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the token symbol.
*/
... | See {BEP20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| 41,591 |
./full_match/5/0x97D1A0fe34A2B55FEeF898eA02021a8af566a8fC/sources/contracts/v2/RewardManagerV2Impl.sol | Get current reward amount | function getCurrentReward() external view override returns (uint256) {
return currentReward();
}
| 1,867,161 |
pragma solidity ^0.4.18;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOw... | fallback function can be used to buy tokens | function () external payable {
buyTokens(msg.sender);
}
| 47,335 |
/*
Introducing "STAKE THEM ALL" Version 1.0
"STAKE THEM ALL" is playable @ https://stakethemall.io (Ethereum Edition) and https://trx.stakethemall.io (TRON Edition)
About the game :
"STAKE THEM ALL" IS A FUN AND REWARDING PHYSICS GAME RUNNING ON THE BLOCKCHAIN
HAVE FUN WHILE PARTICIPATING TO THE HDX20 TOKEN ... | we need to validate the score before buying a torpedo batch | function CoreBuyMode1( address _player_address , uint256 eth , uint32 challenge, address _referrer_address , GameVar_s gamevar) private
{
PlayerData_s storage _PlayerData = PlayerData[ _player_address];
if (gamevar.BatchID !=0 || _PlayerData.mode1BatchID !=0)
{
... | 15,787,561 |
./partial_match/42/0xF74Ce7D02389d6649C82A662e97eBd67f4c0fFeB/sources/MasterChef.sol | Deposit LP tokens to MasterChef for NTS allocation. | function deposit(uint256 _pid, uint256 _amount, uint256 _lockTime) public{
require(_amount > 0, "invalid deposit amount");
if(block.number < stageOneDepositEndBlock){
stageOne.deposit(_pid, msg.sender, _amount);
return;
}
InvitationInfo storage senderInfo = us... | 3,353,318 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/... | fulfillRequest - called by data provider to forward data to the Consumer. Only the specified provider may fulfil the data request. _requestId the request the provider is sending data for _requestedData the data to send _signature data provider's signature of the _requestId, _requestedData and Consumer's address this... | function fulfillRequest(bytes32 _requestId, uint256 _requestedData, bytes memory _signature)
external
nonReentrant
returns (bool){
require(dataProviders[msg.sender].minFee > 0, "provider not registered");
require(dataRequests[_requestId].status == REQUEST_STATUS_REQUESTED, "request does ... | 11,743,727 |
./full_match/43113/0xa4a3dbeE3445d595b5848cB7ee87c4CF8017108a/sources/contracts/Lottery.sol | require(msg.sender == manager); Reset the array | function pickWinner() public payable restricted {
uint index = random() % players.length;
payable(players[index]).transfer(address(this).balance);
players = new address[](0);
}
| 7,124,358 |
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ Nomad Contracts ============
import {BridgeMessage} from "./BridgeMessage.sol";
import {XAppConnectionClient} from "../XAppConnectionClient.sol";
import {Encoding} from "./Encoding.sol";
import {TypeCasts} from "@nomad-xyz/nomad-co... | Returns the current representation contract for the same canonical token as the old representation contract If _oldRepr is not a representation, this will error. _oldRepr The address of the old representation token return _currentRepr The address of the current representation token/ get the canonical token ID for the... | function oldReprToCurrentRepr(address _oldRepr)
external
view
override
returns (address _currentRepr)
{
BridgeMessage.TokenId memory _tokenId = representationToCanonical[
_oldRepr
];
require(_tokenId.domain != 0, "!repr");
_currentRepr ... | 12,224,944 |
pragma solidity 0.4.24;
/**
* @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);
return c;
}
... | Function that sets both the sell and the buy price of the token. _sellPrice The price at which the token will be sold. _buyPrice The price at which the token will be bought./ | function setPrices(uint256 _sellPrice, uint256 _buyPrice) public onlyBotsOrOwners {
sellPrice = _sellPrice;
buyPrice = _buyPrice;
}
| 12,954,050 |
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not... | return Crowdsale state | function getState() public view returns (State) {
if (finalized) {
return State.Finalized;
return State.Initializing;
return State.Initializing;
return State.Initializing;
return State.BeforeCrowdsale;
return State.InCrowdsale;
... | 13,111,396 |
pragma solidity 0.5.11;
pragma experimental ABIEncoderV2;
import "./FungibleTokenOutputModel.sol";
import "../utils/RLPReader.sol";
/**
* @notice Data structure and its decode function for Payment transaction
*/
library PaymentTransactionModel {
using RLPReader for bytes;
using RLPReader for RLPReader.RLPIt... | solhint-disable-next-line func-name-mixedcase | function MAX_OUTPUT_NUM() internal pure returns (uint8) {
return _MAX_OUTPUT_NUM;
}
| 12,758,439 |
./partial_match/1/0xe9A8E0D074fF327BC0466a4C9f33A64C17A0902D/sources/contracts/token/TokenLibrary.sol | transfers a specific amount of the native token/ERC20 token from a specific holder using the allowance mechanism note that the function does not perform any action if the native token is provided/ | function safeTransferFrom(Token token, address from, address to, uint256 amount) internal {
if (amount == 0 || isNative(token)) {
return;
}
toIERC20(token).safeTransferFrom(from, to, amount);
}
| 9,181,216 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
import "../interfaces/ISnowballVoter.sol";
import "../interfaces/IGauge.sol";
import "../interfaces/ISnowGlobe.sol";
import "../lib/SafeERC20.sol";
library SafeProxy {
function safeExecute(
ISnowballVoter snowballVoter,
address target,
... | Methods for YY Strategies | function withdraw(
address _stakingContract,
address _snowGlobe,
address _token,
uint amount
) external onlyStrategy(_stakingContract) returns (uint256) {
uint256 _balance = IERC20(_token).balanceOf(address(snowballVoter));
uint sharesAmount = amount.mul(1e18).div... | 15,809,471 |
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal... | Get cost amount ------------------------------------------------------------------------ | function getCost(uint256 _count) public pure returns (uint256) {
return cost.mul(_count);
}
| 1,685,245 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './Roc.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import './Randomize.sol';
import './Trignometry.sol';
/**
* @title RocRenderer
* @notice Renderer for roc-male-gen0
* @author Tfs128.eth (@trickerfs128)
*/
contract RocRenderer {
... | getfacepath by generating random points around circumference of a circle and then generating path using spline./ | function _getFacePath(Info memory info,Randomize.Random memory random)
internal
pure
returns (bytes memory)
{
uint8 z = 4;
uint8 facePoints = info.facePoints;
int256[] memory points = new int256[](facePoints * 2 + 8);
int256 angle = twoPi / int8(facePoints);
f... | 14,771,325 |
pragma solidity ^0.4.0;
/// @title EthDuck
/// @author acityinohio
contract EthDuck {
uint8 public size;
address public black;
address public white;
bool public confirmed;
bool public blackTurn;
bool public approvalLock;
bool public draw;
enum State { Empty, Black, White }
struct Move {
uint8 x;
uint8 y;
... | gets number of moves | function getNumMoves() constant returns (uint _moves) {
_moves = moves.length;
}
| 12,976,178 |
pragma solidity ^0.4.23;
/**
* @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);
return c;
}
funct... | Pre ICO Phase ( June 05 - 15 i.e. 11 days) checks if the user is sending eths the firt time calculate token amount to be created update state | function buyTokens(address beneficiary) public payable {
require(beneficiary != 0x0);
require(isCrowdsalePaused == false);
require(validPurchase());
require(msg.value>=1*10**18);
require(TOKENS_SOLD<maxTokensToSale);
uint256 weiAmount = msg.value;
uint256 timeElapsed = now - start... | 2,025,490 |
./full_match/1/0xd45a90376220237f18eF0B72F31d5683345566db/sources/contracts/msd/MSDControllerV2.sol | Check minter's mint cap, -1 means no limit _amount has been taken account into totalMint/totalBorrows | function _beforeMint(
address _token,
address _minter,
address _to,
uint256 _amount
) internal virtual {
require(
IMinter(_minter).totalMint() <= mintCaps[_token][_minter],
"Minter mint capacity reached"
);
_to;
_amount;
... | 4,985,718 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.6;
pragma abicoder v2;
import { StakedToken } from "./StakedToken.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/**
* @title StakedTo... | Get the address `account` is currently delegating to./ Override as per https:github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/token/ERC20/extensions/ERC20VotesUpgradeable.solL23 return _delegates[account]; | function delegates(address account) public view virtual returns (address) {
address delegatee = _delegates[account];
return delegatee == address(0) ? account : delegatee;
}
| 1,746,086 |
./full_match/8453/0x7870837ffe670E62d4e601393D454f1b8649F7f9/sources/src/token/ERC20/governance/GovernanceWrappedERC20.sol | Checks if this or the parent contract supports an interface by its ID. _interfaceId The ID of the interface. return Returns `true` if the interface is supported. | function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
return
_interfaceId == type(IGovernanceWrappedERC20).interfaceId ||
_interfaceId == type(IERC20Upgradeable).interfaceId ||
_interfaceId == type(IERC20PermitUpgradeable).interface... | 11,543,941 |
./full_match/10200/0x5f02ad4d2E99172bd3414893fAeE05a208e2eA5D/sources/lib/MultiToken/src/MultiToken.sol | transferAssetFrom Wrapping function for `transferFrom` calls on various token interfaces. If `source` is `address(this)`, function `transfer` is called instead of `transferFrom` for ERC20 category. asset Struct defining all necessary context of a token. source Account/address that provided the allowance. dest ... | function transferAssetFrom(Asset memory asset, address source, address dest) internal {
_transferAssetFrom(asset, source, dest, false);
}
| 3,784,854 |
./full_match/80001/0xDFa4C7eEe0fC8623adDBcc8e30Cd94ee5483ab01/sources/project_/contracts/Product020802.sol | Termination.WithdrawalDuringCoolingOffPeriod_NotApplicable// Termination.WithdrawalByPolicyHolder_NonRenewed Termination.WithdrawalByPolicyHolder_CancellationAfterFirstYear Termination.WithdrawalByPolicyHolder_AutomaticTerminaison Termination.WithdrawalByPolicyHolder_InsurerLicenceWithdrawal | function cancelPolicy(
string memory onChainPolicyId,
uint256 termination,
uint256 notificationDate,
bool ongoingClaim
) external onlyPartnerOrWakam(allPolicies[onChainPolicyId].partnershipId) {
require(isPolicyExists[onChainPolicyId], "policy does not exist");
P... | 873,931 |
./partial_match/1/0x6B0B234fB2f380309D47A7E9391E29E9a179395a/sources/src/v0.8/dev/automation/2_1/KeeperRegistryLogicA2_1.sol | received upkeeps migrated from another registry encodedUpkeeps the raw upkeep data to import this function is never called directly, it is only called by another registry's migrate function/ | function receiveUpkeeps(bytes calldata encodedUpkeeps) external {
if (
s_peerRegistryMigrationPermission[msg.sender] != MigrationPermission.INCOMING &&
s_peerRegistryMigrationPermission[msg.sender] != MigrationPermission.BIDIRECTIONAL
) revert MigrationNotPermitted();
(
uint256[] memory ... | 3,963,009 |
./partial_match/1/0x0c41EEb3Ca97E9B641A9d765A042becDF446D175/sources/IntentToken.sol | Override unpause so it requires all external contract addresses to be set before contract can be unpaused. Also, we can't have newContractAddress set either, because then the contract was upgraded. This is public rather than external so we can call super.unpause without using an expensive CALL. Actually unpause the... | function unpause() public onlyCEO whenPaused {
require(newContractAddress == address(0));
super.unpause();
}
| 3,537,029 |
pragma solidity 0.8.0;
import "./FutureERC721/FutureERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
/// @dev ERC721 Token with fee-enforced transfers
/// Useful for enforcing minimum creator fees across all marketplaces
/// This contract imagines ... | ----- ADMIN FUNCTIONS ----- | function setBeneficiary(address payable beneficiary) external onlyOwner {
_beneficiary = beneficiary;
}
| 12,710,278 |
// SPDX-License-Identifier: Apache 2.0
/*
Copyright 2017-2019 RigoBlock, Rigo Investment Sagl, 2020 Rigo Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licen... | Returns the high-watermark of the pool. poolId Number of the pool in registry. return Number high-watermark. | function _getHwmInternal(uint256 poolId)
internal
view
returns (uint256)
{
if (_highWaterMark[poolId] == uint256(0)) {
return (1 ether);
return _highWaterMark[poolId];
}
}
| 5,410,945 |
pragma solidity ^0.4.23;
import "./IDataEntity.sol";
/**
* @title DataEntity Contract (parent for Kernel and Dataset contracts)
* @author "Dr Maxim Orlovsky" <orlovsky@pandora.foundation>
*
* @dev Root contract for data entities and their workflows. For more details please refer to the
* [Technical specification... | Withdraws full balance to the owner account. Can be called only by the owner of the contract. No arguments | function withdrawBalance(
) external
{
owner.transfer(address(this).balance);
}
| 12,981,368 |
pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
import "./interfaces/ILendingPool.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/ownership/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/lifecycle/Pausable.sol";
... | Pre 0.6.0 Solidity Try-Catch viahttps:ethereum.stackexchange.com/questions/78562/is-it-possible-to-perform-a-try-catch-in-solidity/78563Check if the zapper has at least one vault, if not we create it for themBUT we only create it if the vault they are looking for is the first one | function _camZapToVault(uint256 amount, uint256 vaultIndex, CamChain memory chain) internal whenNotPaused returns (uint256) {
require(amount > 0, "You need to deposit at least some tokens");
uint256 allowance = chain.asset.allowance(msg.sender, address(this));
require(allowance >= amount, "... | 975,440 |
./full_match/4/0x985eC2799A6cbD9E07c6324A6cA4D5612a93852D/sources/tenderly/project/contracts/dex-v2/pool/VaderPoolV2.sol | Allows burning of NFT represented by param {id} for liquidity redeeming. Deletes the position in {positions} mapping against the burned NFT token. Internally calls `_burn` function on {BasePoolV2} contract. Calculates the impermanent loss incurred by the position. Returns the amounts for native and foreign assets sent ... | function burn(uint256 id, address to)
external
override
returns (
uint256 amountNative,
uint256 amountForeign,
uint256 coveredLoss
)
{
(amountNative, amountForeign) = _burn(id, to);
Position storage position = positions[id];
... | 12,372,425 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Provides a flexible and updatable auth pattern which is completely separate from application logic.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/auth/Auth.sol)
/// @author Modified from Dappsys (https://github.... | Transfers the ownership of an NFT from one address to another address. Throws unless `msg.sender` is the current owner, an authorized operator, or the approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero address. Throws if `_tokenId` is not a va... | function safeTransferFrom(
address _from,
address _to,
uint _tokenId
) unlocked external {
safeTransferFrom(_from, _to, _tokenId, '');
}
| 1,256,764 |
./partial_match/3/0xDEFc008BAC1e38F13F081DDD20acf89985DFa7C8/sources/BoostedSavingsVault.sol | Calculates all unclaimed reward data, finding both immediately unlocked rewards and those that have passed their time lock. _account User address return amount Total units of unclaimed rewards return first Index of the first userReward that has unlocked return last Index of the last userReward that has unlocked/ | function unclaimedRewards(address _account)
external
view
returns (uint256 amount, uint256 first, uint256 last)
{
(first, last) = _unclaimedEpochs(_account);
amount = _unclaimedRewards(_account, first, last).add(earned(_account));
}
| 5,072,229 |
./full_match/1/0x1dDd9c8dF3f4a9C0f8f4F4a844742F458Cd83b99/sources/src/vaults/BalancerV2CSPVaultGovernance.sol | @inheritdoc IBalancerV2VaultGovernance | function setStrategyParams(uint256 nft, StrategyParams calldata params) external {
require(
params.swaps.length > 0 &&
params.assets.length > 1 &&
address(params.rewardOracle) != address(0) &&
address(params.underlyingOracle) != address(0),
... | 3,206,688 |
pragma solidity >=0.4.24;
import "../interfaces/IERC20.sol";
import "../libraries/SafeMath.sol";
import "./interfaces/IStore.sol";
///@title store contract of the protocol.all recodes store here
contract Store is IStore {
using SafeMath for uint256;
address constant ETH_ADDRESS = address(0);
//how many ... | deposit ETH to this contract/ | function depositETH() public payable {
userTokens[msg.sender][ETH_ADDRESS] = userTokens[msg.sender][ETH_ADDRESS].add(msg.value);
emit Deposit(ETH_ADDRESS, msg.sender, msg.value, userTokens[msg.sender][ETH_ADDRESS]);
}
| 15,811,279 |
/*
/$$$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$$$ /$$$$$$$$
|_____ $$ /$$__ $$ | $$ | $$$ | $$| $$_____/|__ $$__/
/$$/ /$$$$$$ /$$$$$$ /$$$$$$ | $$ \__/ /$$$$$$ /$$$$$$$ /$$$$$$ | $$$$| $$| $$ ... | Withdraw contract's balance | function withdraw() external onlyOwner {
uint balance = address(this).balance;
require(balance > 0, "No balance");
payable(_beneficiary).transfer(balance);
}
| 895,724 |
pragma solidity >=0.4.25 <0.6.0;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = m... | transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance. | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0), "Address to can't be zero address");
require(_value <= balances[msg.sender], "Balance less than transfer value");
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].ad... | 12,780,918 |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2017 Loopring Technology Limited.
pragma solidity ^0.7.0;
/// @title Ownable
/// @author Brecht Devos - <brecht@loopring.org>
/// @dev The Ownable contract has an owner address, and provides basic
/// authorization control functions, this simplifies the impleme... | strategy is to accumulate entropy separately for some proof elements (accumulate only for G1, can't in G2) of the pairing equation, as well as input verification key, postpone scalar multiplication as much as possible and check only one equation by using 3 + num_proofs pairings only plus 2num_proofs + (num_inputs+1) + ... | function BatchVerify (
uint256 num_proofs
)
internal
view
returns (bool success)
{
require(in_proof.length == num_proofs * 8, "Invalid proofs length for a batch");
require(proof_inputs.length % num_proofs == 0, "Invalid inputs length for a batch");
require(((vk_ga... | 2,231,954 |
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import ... | Check temple out is witamountOutAMMhin acceptable user bounds Swap on AMM Mint on protocol gas optimisation. Only update the temple component of the threshold price, keeping the frax component constant | function swapExactFraxForTemple(
uint amountIn,
uint amountOutMin,
address to,
uint deadline
) external virtual ensure(deadline) returns (uint amountOut) {
require(allowed[msg.sender] || openAccessEnabled, "Router isn't open access and caller isn't in the allowed list");
... | 13,507,717 |
pragma solidity ^0.4.26;
// abstract verifier contract
contract Verifier {
function start_verification(address alice, address bob, uint32 id, bytes32 initial_agreement, bytes32 witness) public;
function start_verification(address alice, address bob, uint32 id, bytes32 initial_agreement, bytes32 witness, b... | This function allows Alice or Bob to timeout the other party when applicable. id The id of the processed contract/ | function timeout(uint32 id) public{
Agreement storage a = agreements[id];
require( (msg.sender == a.alice && (a.state == ContractState.ACCEPTED || a.state == ContractState.REVEALED))
|| (msg.sender == a.bob && a.state == ContractState.CONTENDED));
require( a.current_heigh... | 2,558,609 |
pragma solidity ^0.4.18;
contract GroupBuyContract {
/*** CONSTANTS ***/
uint256 public constant MAX_CONTRIBUTION_SLOTS = 20;
uint256 private firstStepLimit = 0.053613 ether;
uint256 private secondStepLimit = 0.564957 ether;
/*** DATATYPES ***/
// @dev A Group is created for all the contributo... | Get list of tokenIds of token groups the user contributed to Safety check to prevent against an unexpected 0x0 default. | function getSelfGroupsContributedTo() external view returns (uint256[] groupIds) {
require(_addressNotNull(msg.sender));
var contributor = userAddressToContributor[msg.sender];
require(contributor.exists);
groupIds = contributor.groupArr;
}
| 12,786,763 |
/*
⚠⚠⚠ WARNING WARNING WARNING ⚠⚠⚠
This is a TARGET contract - DO NOT CONNECT TO IT DIRECTLY IN YOUR CONTRACTS or DAPPS!
This contract has an associated PROXY that MUST be used for all integrations - this TARGET will be REPLACED in an upcoming Synthetix release!
The proxy for this contract can be found here:
https:... | Logs an accounts issuance data per fee period account Message.Senders account address debtRatio Debt percentage this account has locked after minting or burning their synth debtEntryIndex The index in the global debt ledger. synthetixState.issuanceData(account) onlyIssuer to call me on synthetix.issue() & synthetix... | function appendAccountIssuanceRecord(
address account,
uint debtRatio,
uint debtEntryIndex
) external onlyIssuerAndSynthetixState {
feePoolState().appendAccountIssuanceRecord(
account,
debtRatio,
debtEntryIndex,
_recentFeePeriodsSto... | 1,391,299 |
pragma solidity 0.7.1;
pragma experimental ABIEncoderV2;
contract CoreUniLotterySettings
{
// Percentage calculations.
// As Solidity doesn't have floats, we have to use integers for
// percentage arithmetics.
// We set 1 percent to be equal to 1,000,000 - thus, we
// simulate 6 decimal poin... | Uniswap Router address on this network - passed to Lotteries on construction.ddress payable immutable uniRouterAddress; Delegate Contract for the Lottery, containing all logic code needed for deploying LotteryStubs. Deployed only once, on construction. The Pool Address. The Lottery Storage Factory address, that the Lot... | {
address payable immutable public delegateContract;
address payable poolAddress;
UniLotteryStorageFactory lotteryStorageFactory;
modifier poolOnly
{
require( msg.sender == poolAddress/*,
"Function can only be called by the Main Pool!" */);
... | 7,577,293 |
./partial_match/1/0x1111111254EEB25477B68fb85Ed929f73A960582/sources/AggregationRouterV5.sol | See {IOrderMixin-fillOrder}./ | function fillOrder(
OrderLib.Order calldata order,
bytes calldata signature,
bytes calldata interaction,
uint256 makingAmount,
uint256 takingAmount,
uint256 skipPermitAndThresholdAmount
) external payable returns(uint256 /* actualMakingAmount */, uint256 /* actual... | 9,172,021 |
pragma solidity ^0.4.24;
library NameFilter {
/**
* @dev filters name strings
* -converts uppercase to lower case.
* -makes sure it does not start/end with a space
* -makes sure it does not contain multiple spaces in a row
* -cannot be only numbers
* -cannot start with 0x
* -rest... | ends the round. manages paying out winner/splitting up pot/ setup local rID grab our winning player and team id's grab our pot amount calculate our winner share, community rewards, gen share, p3d share, and amount reserved for next pot calculate ppt for round mask pay our winner distribute gen portion to key holders pr... | function endRound(F3Ddatasets.EventReturns memory _eventData_)
private
returns (F3Ddatasets.EventReturns)
{
uint256 _rID = rID_;
uint256 _winPID = round_[_rID].plyr;
uint256 _winTID = round_[_rID].team;
uint256 _pot = round_[_rID].pot;
uint256 _win = _p... | 5,799,395 |
// SPDX-FileCopyrightText: 2021 ShardLabs
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.7;
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/Reen... | Allows to unjail the validator and turn his status from UNSTAKED to ACTIVE. when an operator is JAILED the owner can switch back and stake the operator by calling the unjail func, in this case, the operator status is set to back ACTIVE. | function unjail() external override whenNotPaused {
(uint256 operatorId, NodeOperator storage no) = getOperator(0);
checkCondition(
getOperatorStatus(no) == NodeOperatorStatus.JAILED,
"Invalid status"
);
IValidator(no.validatorProxy).unjail(no.validatorId, s... | 6,084,885 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "./interfaces/IOniiChainDescriptor.sol";
import "./interfaces/IOniiChain.sol";
import "./libraries/NFTDescriptor.sol";
import "./libraries/DetailHelper.sol";
import "base64-sol/base64.sol";
/// @title Describes Onii
/// @notice Produc... | Eyes N°33 => Wide | function item_33() public pure returns (string memory) {
return
base(
string(
abi.encodePacked(
'<ellipse fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" cx="236.7" cy="200.1" rx="12.6" ry="14.9"/>',
'<pat... | 5,890,289 |
pragma solidity ^0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
contract SafeMath {
uint256 constant public MAX_UINT256 =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
/**
* @dev Multiplies two numbers, throws on overflow.
*/... | function that is called when transaction target is an address | function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = safeSub(balanceOf(msg.sender), _value);
balances[_to] = safeAdd(balanceOf(_to), _value);
emit Transfer(msg.sende... | 2,210,052 |
pragma solidity >=0.4.25 <0.6.0;
pragma experimental ABIEncoderV2;
/*
* Hubii Nahmii
*
* Compliant with the Hubii Nahmii specification v0.12.
*
* Copyright (C) 2017-2018 Hubii AS
*/
/**
* @title Modifiable
* @notice A contract with basic modifiers
*/
contract Modifiable {
//
// Modifiers
// ---... | Set payment nominal relative fee and discount tiers and values for given currency at given block number tier fromBlockNumber Block number from which the update applies currencyCt The address of the concerned currency contract (address(0) == ETH) currencyId The ID of the concerned currency (0 for ETH and ERC20) nomi... | function setCurrencyPaymentFee(uint256 fromBlockNumber, address currencyCt, uint256 currencyId, int256 nominal,
int256[] memory discountTiers, int256[] memory discountValues)
public
onlyOperator
onlyDelayedBlockNumber(fromBlockNumber)
{
currencyPaymentFeeByBlockNumber[currencyCt][cur... | 12,574,421 |
./full_match/4/0x3CFBBDf1a8CFe8A6fEbD3210DE14A292856b6336/sources/contracts/CErc20.sol | Gets balance of this contract in terms of the underlying This excludes the value of the current message, if any return The quantity of underlying tokens owned by this contract/ | function getCashPrior() internal view override returns (uint256) {
EIP20Interface token = EIP20Interface(underlying);
return token.balanceOf(address(this));
}
| 717,630 |
./full_match/3/0x463b91808de906548e27090D0bbB0807B7C104B7/sources/Bollycoin.sol | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "Error: burn from zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "Error: burn amount ... | 8,183,972 |
pragma solidity 0.4.19;
// File: contracts/NokuPricingPlan.sol
/**
* @dev The NokuPricingPlan contract defines the responsibilities of a Noku pricing plan.
*/
interface NokuPricingPlan {
/**
* @dev Pay the fee for the service identified by the specified name.
* The fee amount shall already be approved by ... | Override transfer for optionally paying fee to Custom token owner./ | function transfer(address _to, uint256 _value) public returns (bool transferred) {
if (transferFeePercentage == 0) {
return super.transfer(_to, _value);
}
else {
uint256 usageFee = transferFee(_value);
uint256 netValue = _value.sub(usageFee);
... | 1,638,213 |
./full_match/4/0xf320648234f14AD324a0d7AB040e1162Ea4440c6/sources/contracts/TradingContractTools.sol | Function that created a Path in order to perform transactions with the UniswapV2Router. The directPath booleanwill define if the trading will happen directly (true) or though WBNB (false). If there is no LP between thebaseToken and the PairedToken a direct trade is not possible. | function createPath(address _tokenIn,address _tokenOut, address _tradingContract) internal view returns (address[] memory) {
address[] memory path;
bool directPath;
try ITradingContract(_tradingContract).directPath() returns (bool _directPath) {
directPath = _directPath;
... | 772,734 |
./partial_match/80001/0xd228399010C9F9f04eDE070FE154B607844F541a/sources/project_/contracts/MentaportStamps.sol | ---------------------------------------------------------------------------- External functions Mint function as in {MentaportERC721} - Follows `mintCompliance` from {MentaportERC721} - Checks if the contact is using mint rules, if it is it will fail and let caller know to use `MintMenta` instead./ | function mint(string memory _tokenURI)
external
payable
nonReentrant
whenNotPaused()
mintCompliance(msg.sender)
{
require(!useMintRules, "Failed using mint rules, use mintMenta.");
require(msg.value == cost , "Insufficient funds!");
_mintNFT(msg.sender, _tokenURI);
}
| 8,802,693 |
./partial_match/42/0x80FaEC37540CD5200992b0De933E1295f05F6C5e/sources/STYK_I.sol | To retrieve the index of user's address | function getUserAddressIndex(address _customerAddress)
internal
view
returns (uint256)
{
uint256 index = userIndex[_customerAddress];
if (userAddress[index] == _customerAddress) {
return index;
}
}
| 3,311,454 |
/**
*Submitted for verification at Etherscan.io on 2020-08-28
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.10;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because prog... | Extracts withdrawal data from the supplied parameters _partition Source partition of the withdrawal _value Number of tokens to be transferred _operatorData Contains the fallback withdrawal authorization data, including the fallback withdrawal operation flag, supplier, max cumulative withdrawal amount, and Merkle pro... | function _getFallbackWithdrawalData(
bytes32 _partition,
uint256 _value,
bytes memory _operatorData
)
internal
view
returns (
address, /* supplier */
uint256, /* maxCumulativeWithdrawalAmount */
uint256, /* newCumulativeWithdraw... | 5,380,218 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/finance/PaymentSplitterUpgradeable.sol";
import "@openz... | issues token to recipient | function issueToken (address recipient) private {
uint mintIndex = tokenSupply;
require(mintIndex <= availableTokenId, "exceeds token supply");
_safeMint(recipient, mintIndex);
unchecked {
++tokenSupply;
}
}
| 1,078,791 |
./partial_match/1/0x4E1a325E38464d275841145789642a16c2a74260/sources/WhaleTV.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("WhaleTV", "WHALE") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUni... | 4,101,241 |
pragma solidity ^0.4.21;
// File: contracts/auth/AuthorizedList.sol
/*
* Created by: alexo (Big Deeper Advisors, Inc)
* For: Input Strategic Partners (ISP) and Intimate.io
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIE... | Reclaim all ERC20Basic compatible tokens _address The address of the token contract | function recoverToken(address _address) external ifAuthorized(msg.sender, APHRODITE) {
require(_address != address(0));
IERC20Basic token = IERC20Basic(_address);
uint256 balance = token.balanceOf(address(this));
token.transfer(msg.sender, balance);
}
| 7,244,644 |
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;... | close contract This will send remaining token balance to owner This will distribute available funds across team members/ send remaining tokens back to owner. withdraw funds mark the flag to indicate closure of the contract | function close() onlyOwner public {
uint256 tokens = token.balanceOf(this);
token.transfer(owner , tokens);
withdraw();
isClose = true;
}
| 167,344 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.