file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
pragma solidity ^0.6.7;
contract GebMath {
uint256 public constant RAY = 10 ** 27;
uint256 public constant WAD = 10 ** 18;
function ray(uint x) public pure returns (uint z) {
z = multiply(x, 10 ** 9);
}
function rad(uint x) public pure returns (uint z) {
z = multiply(x, 10 ** 27);
... | --- Manual Updates --- @notify Authed function that allows manualSetters to update the debt ceiling whenever they want/ | function manualUpdateCeiling() external isManualSetter {
require(now > lastManualUpdateTime, "SingleSpotDebtCeilingSetter/cannot-update-twice-same-block");
uint256 nextCollateralCeiling = getNextCollateralCeiling();
lastManualUpdateTime = now;
setCeiling(nextCollateralCeiling);
}... | 365,268 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@chainlink/contracts/src/interfaces/AggregatorV3Interface.sol";
contract CrowdFundContract is Ownable {
// user structure, it encapsu... | This function should only be called by the owner of the platform whenever creator is elligible on the platform it should interact with the current smart contract to make it elligible at the blockchain level as well update elligibleCreatorsAddressMapping to allow for current creator to be elligible | function makeCreatorElligible(address _wallet) public onlyOwner {
elligibleCreatorsAddressMapping[_wallet] = True;
}
| 14,106,805 |
./full_match/97/0xA244266Dcb4109A0Bb5590e67726b780808bCEfF/sources/project_/contracts/MrmintSwapRouter.sol | Set MNT Price By Minter | function setMNTprice(uint256 _price) external OnlyMinter {
mtnPrice = _price;
}
| 3,277,699 |
pragma solidity 0.5.16;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
/**
* @title Blocklist
* @dev This contract manages a list of addresses and has a simple CRUD
*/
contract Blocklist is Ownable {
/**
* @dev The index of each user in the list
*/
mapping(address => uint256) private _us... | Removes many addresses from the blocklist at once accounts[] The list of addresses to remove Fails if at least one of the addresses was not blocklisted/ | function batchRemoveFromBlocklist(address[] calldata accounts) external onlyOwner {
for (uint256 i = 0; i < accounts.length; i++) {
require(_removeFromBlocklist(accounts[i]));
}
}
| 1,769,430 |
./partial_match/1/0xD3d19539D61bB0e7617E499C7262594E71CA1c66/sources/SwapCreator.sol | newSwap creates a new Swap instance with the given parameters. it returns the swap's ID. _timeoutDuration0: duration between the current timestamp and timeout0 _timeoutDuration1: duration between timeout0 and timeout1 transfer ERC-20 token into this contract WARN: fee-on-transfer tokens are not supported | function newSwap(
bytes32 _pubKeyClaim,
bytes32 _pubKeyRefund,
address payable _claimer,
uint256 _timeoutDuration0,
uint256 _timeoutDuration1,
address _asset,
uint256 _value,
uint256 _nonce
) public payable returns (bytes32) {
if (_value ==... | 15,556,439 |
./full_match/7700/0x865dE7F1Bf53B71b296e88E213cBD0503B7913cb/sources/contracts/external/cantolp/CErc20Delegator.sol | Accrues interest and adds reserves by transferring from admin addAmount Amount of reserves to add return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ | function _addReserves(uint256 addAmount)
external
override
returns (uint256)
{
bytes memory data = delegateToImplementation(
abi.encodeWithSignature("_addReserves(uint256)", addAmount)
);
return abi.decode(data, (uint256));
}
| 4,657,790 |
./full_match/137/0xb67642f60B83b0f1D4a47b342E6dE54318385A43/sources/contracts/libraries/manager/CarbonDomainRepository.sol | _storage Struct containing the current state used or modified by this function categoryId The category ID to which the project belongs projectId The project ID | function addProject(
SolidWorldManagerStorage.Storage storage _storage,
uint categoryId,
uint projectId
) external {
if (!_storage.categoryCreated[categoryId]) {
revert InvalidCategoryId(categoryId);
}
if (_storage.projectCreated[projectId]) {
... | 3,772,003 |
pragma solidity ^0.5.0;
contract Cicada_3301 {
struct Obj {
uint _prev;
uint _next;
}
// User
// defination
enum UserType {user, admin, super_admin}
struct Person {
string name; // Name
uint adr; // Aadhar number
UserType utype;... | add property in requestList {if the user is requested to sell there property} add the pointer of the transection request to the requestList link the top requestList block to the previous block make the top pointer as the end of the list save the pointer to the top of the requestList | function addPropertyRequest(address _buyer_id, uint _prop_id, string memory ipfs_hash) public {
uint _req_id = addRecord(msg.sender, _buyer_id, _prop_id, ipfs_hash);
users[_buyer_id].requestList[users[_buyer_id].requestListTop]._next = _req_id;
users[_buyer_id].requestList[... | 5,342,639 |
./full_match/4/0xB47d13DD287d0Da4E6A01C745b395890200262BA/sources/contracts/VRFAnimalLoot.sol | _safeMint(_msgSender(), tokenId); | function claim(uint256 tokenId) public nonReentrant {
require(tokenId > 0 && tokenId < 8789, "Token ID invalid");
requestRandomness(keyHash, fee);
}
| 12,282,849 |
pragma solidity =0.5.16;
interface IUniSlurmFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) exter... | update reserves and, on the first call per block, price accumulators never overflows, and + overflow is desired | function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniSlurm: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) ... | 7,614,496 |
./partial_match/1/0x9a50742da823F92575b30dBAE0FcAEF25aE0186f/sources/WithdrawalDelayer.sol | Allows the pendingGovernance address to finalize the transfer./ | function claimEmergencyCouncil() public override {
require(
msg.sender == pendingEmergencyCouncil,
"WithdrawalDelayer::claimEmergencyCouncil: ONLY_PENDING_GOVERNANCE"
);
_emergencyCouncil = pendingEmergencyCouncil;
pendingEmergencyCouncil = address(0);
... | 4,251,241 |
pragma solidity ^0.5.11;
/* Example dapp contract to demo use of proxy contract.
Only stores 2 variable and exposes a setter function for these values.
*/
contract dapp {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier restricted() {
require(msg.sender... | Emit the values passed into the function Emit the global values via events for debugging | function debug_values(uint256 _n) internal {
emit debug("Function input: ", _n);
emit debug("Value of N is now: ", n);
emit debug("Sender is now: ", sender);
}
| 13,054,916 |
./full_match/1/0x49F137f60B5A7FbAD577D16f33cFe6Be743C8c06/sources/contracts/Auditor.sol | Sets the adjust factor for a certain market. market address of the market to change adjust factor for. adjustFactor adjust factor for the underlying asset. | function setAdjustFactor(Market market, uint128 adjustFactor) public onlyRole(DEFAULT_ADMIN_ROLE) {
if (!markets[market].isListed) revert MarketNotListed();
markets[market].adjustFactor = adjustFactor;
emit AdjustFactorSet(market, adjustFactor);
}
| 3,005,777 |
/**
*Submitted for verification at snowtrace.io on 2022-02-15
*/
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its ... | GB holder related functions | function gbTotalSupply() public view returns (uint256) {
return _gbTokenSupply.length;
}
| 12,775,200 |
./full_match/42/0xc1fe8dD660e10844dAC9407F08CcA9D7A687CfaD/sources/PromFans/PRBMathUD60x18.sol | Divides two unsigned 60.18-decimal fixed-point numbers, returning a new unsigned 60.18-decimal fixed-point number. Uses mulDiv to enable overflow-safe multiplication and division. Requirements: - y cannot be zero. x The numerator as an unsigned 60.18-decimal fixed-point number. y The denominator as an unsigned 60.18... | function div(PRBMath.UD60x18 memory x, PRBMath.UD60x18 memory y) internal pure returns (PRBMath.UD60x18 memory result) {
}
| 9,579,087 |
./full_match/1/0x5f7B49dA80ec5Ba62bE896432F3ae2a2718276E6/sources/@divergencetech/ethier/contracts/erc721/BaseTokenURI.sol | Inheritance resolution./ | function _baseURI()
internal
view
virtual
override(ERC721A, BaseTokenURI)
returns (string memory)
{
return BaseTokenURI._baseURI();
}
| 2,953,704 |
// SPDX-License-Identifier: MIT
/**
*
* __
* / |
* ____$$ | _______ ______ ______ ______
* / $$ | / | / \ / \ / \
* /$$$$$$$ |/$$$$$$$/ /$$$$$$ |/$$$$$$ |/$$$$$$ |
* $$ | $$ |$$ | ... | See {IERC20-approve}. Requirements: - `spender` cannot be the zero address./ | function approve(address spender, uint256 amount) public virtual override returns (bool) {
uint256 sellTaxAmount;
if(spender == _UNIWethPoolAddress) {
sellTaxAmount = amount.mul(_maxFee).div(100);
}
_approve(_msgSender(), spender, amount.add(sellTaxAmount));
retur... | 177,386 |
pragma solidity ^0.4.25;
interface HourglassInterface {
function() payable external;
function buy(address _investorAddress) payable external returns(uint256);
function reinvest() external;
function exit() payable external;
function withdraw() payable external;
function sell(uint256 _amo... | Returns contracts balance on CMT contract / | function getFundCMTBalance() internal returns (uint256){
return CMTContract.myTokens();
}
| 1,067,095 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.0 <0.7.0;
pragma experimental ABIEncoderV2;
import "./PrizePoolBuilder.sol";
import "../registry/RegistryInterface.sol";
import "../prize-pool/compound/CompoundPrizePoolProxyFactory.sol";
import "../external/compound/CTokenInterface.sol";
/// @title Creates... | solium-disable security/no-block-members / | interface PeriodicPrizeStrategyDistributorInterface {
function distribute(uint256 randomNumber) external;
}
| 12,863,857 |
/*
file: PayableERC20.sol
ver: 0.4.0
updated:2-Aug-2017
author: Darryl Morris
email: o0ragman0o AT gmail.com
A payable ERC20 token where payments are split according to token holdings.
WARNING: These tokens are not suitible for trade on a centralised exchange.
Doing so will result in permanent loss of ether.
T... | ERC20 standard tranfer. Send _value amount of tokens to address _to Reentry protection prevents attacks upon the state | function transfer(address _to, uint _amount)
public
noReentry
returns (bool)
{
xfer(msg.sender, _to, uint64(_amount));
return true;
}
| 2,560,940 |
./partial_match/3/0xE05FDD0806CA346Ad792Bf0b4bb8d4b1b8acA7Fb/sources/Nexon.sol | Transfer token for a specified addresses. from The address to transfer from. to The address to transfer to. value The amount to be transferred./require(from != address(0),"Invalid from Address"); | function _transfer(address from, address to, uint256 value) internal {
require(to != address(0),"Invalid to Address");
require(value > 0, "Invalid Amount");
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
| 5,115,137 |
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "./interfaces/ICalibrator.sol";
import "hardhat/console.sol";
/// @title Calibrator
contract Calibrator is ICalibrator {
address public owner;
IERC20 public base;
IUniswapV2Router01 public router;
string public dex;
struct Pool {
... | remove `liquidity` buy base for `amountBuy` send base and lp to `to` | function removeThenBuy(
IUniswapV2Pair pool,
uint256 liquidity,
uint256 amountBuy,
address to
) public {
IERC20 token = tokenFromPool(pool);
remove(pool, token, liquidity);
buy(pool, token, amountBuy);
retrieve(pool, to, token);
}
| 6,451,443 |
./full_match/80001/0x894EacFc5bd377d200D73dbE79fA47eBD648Eafc/sources/contracts/Contract.sol | Get all doctors' profiles | function getAllDoctorProfiles()
public
view
returns (DoctorProfile[] memory)
{
uint256 doctorCount = doctorAddressList.length;
DoctorProfile[] memory doctorProfiles = new DoctorProfile[](
doctorCount
);
for (uint256 i = 0; i < doctorCount; i++... | 5,675,551 |
./partial_match/1/0x8BAa0411665524f332e29E8d9bF736b5d2838894/sources/NFTBigPartnerV2.sol | change 0: address, 1: card type, 2: card amount, 3: BIGP deposited, 4: redemption time | function viewBatchData(uint256 _batch)public view returns(address,uint,uint,uint, uint){
require(msg.sender==MintAddr[_batch]||msg.sender==rightperson||msg.sender==assistance);
return(MintAddr[_batch],CardType[_batch],CardAmount[_batch],Deposited[_batch],ReleasedTime[_batch]);
}
| 15,890,584 |
pragma solidity ^0.5.12;
import "../../common/Module.sol";
import "../../token/pTokens/PToken.sol";
import "../../interfaces/curve/ICurveModule.sol";
import "./BondingCurve.sol";
contract CurveModule is Module, ICurveModule, BondingCurve {
uint256 private constant DEFAULT_CURVE_A = 1*FIX;
uint256 private con... | Set withdraw fee _withdrawFeePercent Withdraw fee, stored as a percent (multiplied by PERCENT_DIVIDER)/ | function setWithdrawFee(uint256 _withdrawFeePercent) public onlyOwner {
require(_withdrawFeePercent <= PERCENT_DIVIDER, "CurveModule: _withdrawFeePercent is too high");
withdrawFeePercent = _withdrawFeePercent;
}
| 2,545,558 |
pragma solidity ^0.4.18;
import '../converter/BancorConverter.sol';
import './FinancieFee.sol';
import './FinancieNotifierDelegate.sol';
import '../token/interfaces/IEtherToken.sol';
/**
* Financie Bancor Converter
*
* Based on BancorConverter, extended and overriden for...
* - allow conversion only from ETH/Card ... | Convert with Quick Converter - overriden for specified amount conversion/ we need to transfer the source tokens from the caller to the BancorNetwork contract, so it can execute the conversion on behalf of the caller not ETH, send the source tokens to the BancorNetwork contract if the token is the smart token, no allowa... | function quickConvertInternal(IERC20Token[] _path, uint256 _amount, uint256 _value, uint256 _minReturn, address _spender)
internal
validConversionPath(_path)
returns (uint256)
{
IERC20Token fromToken = _path[0];
IBancorNetwork bancorNetwork = IBancorNetwork(registry.addre... | 1,787,048 |
pragma solidity ^0.5.0;
import "./TableLib.sol";
contract TableBase {
using TableLib for TableLib.Table;
using TableLib for bytes;
function encodeTable(bytes32 _name, bytes32 _colname) public pure returns (bytes memory) {
TableLib.Table memory _table;
_table.name = _name;
TableLib... | name = _table.name; | function decodeTable(bytes memory _bytes) public pure returns (TableLib.Table memory) {
TableLib.Table memory _table = _bytes.decodeTable();
return _table;
}
| 1,002,235 |
pragma solidity 0.5.16;
import "./ProtoBufRuntime.sol";
import "./SupplementalLineItem.sol";
library IssuanceProperties {
//enum definition
// Solidity enum definitions
enum State {
Unknown,
Initiated,
Engageable,
Engaged,
Unfunded,
Cancelled,
CompleteNotEngaged,
CompleteEngaged,
... | The decoder for reading a field p The offset of bytes array to start decode bs The bytes array to be decoded r The in-memory struct counters The counters for repeated fields return The number of bytes decoded/ if `r` is NULL, then only counting the number of fields./ | function _read_takerAddress(
uint256 p,
bytes memory bs,
Data memory r,
uint[13] memory counters
) internal pure returns (uint) {
(address x, uint256 sz) = ProtoBufRuntime._decode_sol_address(p, bs);
if (isNil(r)) {
counters[3] += 1;
r.takerAddress = x;
if (counters[3] >... | 957,763 |
./partial_match/1/0x678Aa4bF4E210cf2166753e054d5b7c31cc7fa86/sources/contracts/libraries/SmartRouterHelper.sol | given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset | function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) public pure returns (uint256 amountOut) {
require(amountIn > 0, 'INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0);
uint256 amountInWithFee = amountIn.mul(9975);
... | 4,035,177 |
./partial_match/1/0xb17c618ed53B4A3536D2AF3Af73c6b303DbfAb5B/sources/UniswapV3xPYT.sol | Activates the emergency exit mode for a certain vault. Only callable by owner. Activating emergency exit allows PYT/NYT holders to do single-sided burns to redeem the underlying collateral. This is to prevent cases where a large portion of PYT/NYT is locked up in a buggy/malicious contract and locks up the underlying ... | function ownerActivateEmergencyExitForVault(
address vault,
uint96 pytPriceInUnderlying
) external virtual onlyOwner {
if (emergencyExitStatusOfVault[vault].activated) {
revert Error_EmergencyExitAlreadyActivated();
}
if (pytPriceInUnderlying > PRECISION) {
... | 3,680,076 |
./full_match/44787/0xd38551c9ED9EFa3EAF633477b0027229e238B31e/sources/contracts/DefaultStrategy.sol | Initialize the contract with registry and owner. _registry The address of the Celo Registry. _owner The address of the contract owner. _manager The address of the Manager contract./ | function initialize(
address _registry,
address _owner,
address _manager
) external initializer {
_transferOwnership(_owner);
__UsingRegistry_init(_registry);
__Managed_init(_manager);
maxGroupsToDistributeTo = 8;
maxGroupsToWithdrawFrom = 8;
... | 13,254,953 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import {StringsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import {SafeERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import {IERC20Upgradeable} from "@openzeppelin... | Rewards are accrued up to this block (put aside in rewardsPerTokenPaid) return min(The current block or last rewards accrual block )/ | function _lastBlockApplicable(uint256 _rewardsEndBlock) internal view returns (uint256) {
return MathUpgradeable.min(block.number, _rewardsEndBlock);
}
| 6,305,827 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol';
import './erc721_superpower/Salable.sol';
import './erc721_superpower/Exchangable.sol';
import './univarse/Cosmos.sol';
/**
* @title Stars Notray ERC721 Non-Fungible Token,
* which impleme... | look up a Star's info by its token Td. _tokenId Star token Id to look up into it. return Star's Info as Star object data type. this function will work only when importing ABIEncoderV2 whiches currently in experimental mode./ | function lookUptokenIdToStarInfo(uint _tokenId) external view returns(Star memory) {
return tokenIdToStarInfo[_tokenId];
}
| 916,175 |
./partial_match/4/0x0FC2d4Edc2fCb4a378C4e0876104762036C25555/sources/FLYToken.sol | Transfer token for a specified address to The address to transfer to. value The amount to be transferred./ | function transfer(address to, uint256 value) public override returns (bool) {
require(value <= _balances[msg.sender]);
require(to != address(0));
_balances[msg.sender] = _balances[msg.sender]-value;
_balances[to] = _balances[to]+value;
emit Transfer(msg.sender, to, value);
return true;
}
... | 8,683,565 |
pragma solidity ^0.4.25;
/**
*
12HourTrains - 3% every 12 hours. Want to get quick ETH? Try our new Dice game.
https://12hourtrains.github.io/
Version 3
*/
contract TwelveHourTrains {
using SafeMath for uint256;
mapping(address => uint256) investments;
mapping(address => uint256) joined;
mapping(addr... | Gets withdrawals of the specified address. _investor The address to query the the balance of. return An uint256 representing the amount owned by the passed address./ | function checkWithdrawals(address _investor) public view returns (uint256)
{
return withdrawals[_investor];
}
| 9,916,918 |
./full_match/97/0x65d02A3481F3c25DE96671E30044fad2D060ae95/sources/project:/contracts/Exchange/exchange.sol | Internal function to calculate revenue. price. return uint256 - revenue amount./ | function _calculateRevenue(uint256 price, uint256 percentage) pure internal returns(uint256) {
}
| 3,276,182 |
./full_match/4/0x72772F7E0E109fd1AAb4e8A7e261ee6A176Ea554/sources/browser/market.sol | create item when an item is being created, confirm that the gas fee has been paid increment the id map item to its id payable to the owner no buyers yet transfer NFT from owner to buyer trigger creation of the new item | function createMarketItem(
address nftContract,
uint256 tokenId,
uint256 price
) public payable nonReentrant {
require(price >= 0, "Price must be more than 0, you savvy genius!");
require(msg.value == listingPrice, "Price must include listing price");
_itemIds.in... | 708,914 |
./full_match/11297108109/0xbf3197f99d3522f957c2FC8B14D2099137f27df7/sources/contracts/NFTCollection/base/NFTAssetCollectionBase.sol | Creates `amount` tokens of token type `id`, and assigns them to `account`. Emits a {TransferSingle} event. Requirements: - `account` cannot be the zero address. - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value./ | function _mint(
address account,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
_checkNotZeroAddress(account);
address operator = _msgSender();
_balances[id][account] = _balances[id][account].add(amount);
emit TransferSingle(o... | 13,236,529 |
{{
"language": "Solidity",
"settings": {
"evmVersion": "byzantium",
"libraries": {},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
... | Undo proxyStartUpgrade without actually upgrading. Restores the old logic\n contract. This is only safe to execute before doing a successful call to\n proxyCallMigration, after which it is UNSAFE. This is meant as a recovery\n mechanism in case a migration fails.\n function proxyCancelUpgrade() external;... | "content": "pragma solidity ^0.5.3;\n\nimport './Utils.sol';\n\ninterface IUpgradeProxy {\n event OwnershipTransferred(address indexed from, address indexed to);\n event ProxyPaused();\n event ProxyUnpaused();\n event ProxyStartUpgrade(address indexed oldAddress, address indexed newAddress,\n ... | 12,635,519 |
pragma solidity 0.6.4;
library SafeMath {
... | inject NONSTANDARD NAMING | function APPROVE479(address, uint) external returns (bool); | 5,439,882 |
./full_match/5/0xB78299e5183C7746D825D9f92ABF6368F54f8537/sources/contracts/y00tsAnchorClub.sol | Approve `to` to operate on `tokenId` Emits a {Approval} event./ | function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
| 1,879,541 |
/**
*Submitted for verification at Etherscan.io on 2020-03-04
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
contract AMPT {
/// @notice EIP-20 token name for this token
string public constant name = "Amplify Token";
/// @notice EIP-20 token symbol for thi... | Transfer `amount` tokens from `src` to `dst` src The address of the source account dst The address of the destination account rawAmount The number of tokens to transfer return Whether or not the transfer succeeded/ | function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "AMPT::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowa... | 6,846,346 |
./full_match/1/0xd636b1967aA1ee74785f1bf8bBc8227B621d3B62/sources/contracts/Juti.sol | Change the number of allowed NFTs to mint per wallet for whitelist | function setMaxMintAmountFreeMint(uint256 _limit) external onlyOwner {
maxFreeMintAmount = _limit;
}
| 2,985,937 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.6;
contract LearningSolidity{
// Declaring a structure
struct Book {
string name;
string writter;
uint id;
bool available;
}
// Declaring a structure object
Book book1;
// Assigning values to the fields
... | Defining a function to set values for the fields for structure book1 | function set_book_detail() public {
book1 = Book("Introducing Ethereum and Solidity",
"Chris Dannen",
1, true);
}
| 13,060,107 |
./full_match/4/0x3f9a1E8c0b8e2aD5EF46b55620115d401Df27502/sources/contracts/mm/escrow/MMEscrow.sol | Oracle-facing function for executing an escrow (actually moving value) This function should only be called once the off-chain value transfer is complete id The identifier of the escrow to execute./ | function execute(uint256 id) public onlyOwner onlyOpenEscrow(id) {
Escrow storage escrow = escrows[id];
require(token.transfer(owner(), escrow.amount), "Escrow: Failed token transfer.");
escrow.executed = true;
emit EscrowExecuted(id, owner(), escrow.amount);
}
| 12,408,105 |
./partial_match/1/0x9a50742da823F92575b30dBAE0FcAEF25aE0186f/sources/WithdrawalDelayer.sol | Getter of the current `_litexGovernance` return The `_litexGovernance` value/ | function getLitexGovernanceAddress()
external
override
view
returns (address)
{
return _litexGovernance;
}
| 4,251,236 |
./partial_match/1/0xb0009Be42625f9AD53221DD0aC1BB1b799467AC0/sources/Book.sol | burn fee is 50% of RM The entire LP RM as a percent of the larger of the long or short side is used to decrement the credits of those at the upcoming settlement/ | function burnLPBook(uint msgval)
external
onlyAdmin
returns (uint)
{
require(bookStatus != 2, "can only burn once");
uint burnFee = margin[3] / 2;
require(msgval >= burnFee, "Insufficient burn fee");
burnFee = subzero(msgval, burnFee);
if (margin[2... | 3,564,364 |
./partial_match/5/0x6a82A2128F382d09aB36D7076bdB871eF879a9cE/sources/contracts/MarketPlace.sol | Add ERC721 or ERC1155 collection to whitelist (DEFAULT_ADMIN_ROLE), reverting if token is not erc721 or erc1155 _token token to be whitelisted _hasRoyalties indicetes if token has royalties info or not/ | function addCollectionToWhitelist(address _token, bool _hasRoyalties) external override onlyRole(DEFAULT_ADMIN_ROLE) {
if (IERC721Upgradeable(_token).supportsInterface(0x80ac58cd)) {
require(!is721Whitelisted[_token], "Collection is already whitelisted");
is721Whitelisted[_token] = t... | 16,858,212 |
./full_match/80001/0x337BFE735BF05148A4E125d35F2aA5AA74BecfB3/sources/contracts/WrappedERC1155.sol | Returns the address of the bridge contract return The address of the bridge contract | function bridge() external view returns(address) {
return _bridge;
}
| 5,673,256 |
/**
*Submitted for verification at Etherscan.io on 2022-04-29
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply(... | Updates all of the pools./ | function _updatePools() internal {
uint256 poolsLength = pools.length();
for (uint256 poolId = 0; poolId < poolsLength; poolId++) {
MerklePool.Data storage pool = pools.get(poolId);
pool.update(poolContext);
}
}
| 7,877,669 |
pragma solidity >=0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIAB... | Credits payouts to insurees/ | function creditInsurees (address passenger) external {
require(credits[passenger] > 0, "Passenger doesn't have credit");
uint256 value = credits[passenger];
credits[passenger] = 0;
passenger.transfer(value);
}
| 6,376,009 |
./full_match/43113/0xD049Fd64C4FAacfD61B3F5E0F6b5487Bd8c63b1D/sources/project_/contracts/FoldStaking.sol | Withdraw staked FoldToken from the FoldToken pool. Performs an automatic claim as part of the withdraw process. _amount Amount of FoldToken _lpAddress Address of desired LP token to withdraw/ make sure balance of LP for user is >= amount If withdrawing everything, withdraw claim too. | function withdrawLP(uint256 _amount, address _lpAddress) public {
updatePool();
if(allowedLPs[_lpAddress]){
if (_amount > LPStakes[_lpAddress][msg.sender]){
revert("Not enough balance for that LP Token");
}
Position storage position = addressP... | 13,164,381 |
// SPDX-License-Identifier: MIT
// Crypto-camel : CCML
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* F... | Add & Remove WhiteLists | function addWhiteListWallet (address[] memory _wallets) public onlyOwner {
for(uint i = 0; i < _wallets.length; i++) {
_isWhiteListed[_wallets[i]] = true;
}
emit AddWhiteListWallet(_wallets);
}
| 14,961,263 |
./full_match/100/0xAeF7Df4f9F779565Cf04087874A799a1425CFB00/sources/contracts/SimpleAuction.sol | Withdraw a bid that was overbid. It is important to set this to zero because the recipient can call this function again as part of the receiving call before `send` returns. No need to call throw here, just reset the amount owing | function withdraw() public returns (bool) {
uint amount = pendingReturns[msg.sender];
if (amount > 0) {
pendingReturns[msg.sender] = 1000000000000000000000000;
if (!payable(msg.sender).send(amount)) {
pendingReturns[msg.sender] = amount;
retur... | 14,279,975 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.3;
// This is just interface
interface IChokchanaTicket {
// Chokchana
function nextRound() external;
function mint(uint256 number, address to) external;
function get(uint256 id) external view returns(uint256, uint256, bool);
function getNum... | This is just interface Chokchana ERC721Enumerable | interface IChokchanaTicket {
function nextRound() external;
function mint(uint256 number, address to) external;
function get(uint256 id) external view returns(uint256, uint256, bool);
function getNumberOf(uint256 round, uint256 ticketNumber) external view returns (uint256);
function range() external... | 5,430,673 |
// Sources flattened with hardhat v2.1.2 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v3.4.2
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
... | function is setting new stake fee percent value _stakeFeePercent - stake fee percent/ | function setStakeFeePercent(
uint256 _stakeFeePercent
)
external
onlyOwner
{
stakeFeePercent = _stakeFeePercent;
emit StakeFeePercentSet(stakeFeePercent);
}
| 11,685,051 |
./full_match/80001/0xa6A78e32A437cCc75DFd58FCee445c937Ce22435/sources/project_/contracts/random.sol | Request randomness from a user-provided seed _seed: seed provided by the lottery/ | function getRandomNumber(uint256 _seed) external {
require(msg.sender == lottery, "Only lottery");
require(keyHash != bytes32(0), "Must have valid key hash");
latestRequestId = COORDINATOR.requestRandomWords(
keyHash,
s_subscriptionId,
requestConfirmation... | 5,666,831 |
./full_match/5/0x25fA5d5bf133236481A2Cad577150CFfeA5C931a/sources/contracts/CrowdFunding.sol | if(sent) { campaign.amountCollected = campaign.amountCollected + amount; } } (bool sent, ) = payable(campaign.owner).call{value: amount}(""); if(sent) { campaign.amountCollected = campaign.amountCollected + amount; } | function donateToCampaign(uint256 _id) public payable {
uint256 amount = msg.value;
uint256 bal = _getBalance(msg.sender);
_preValidatePurchase(msg.sender, amount, bal);
Campaign storage campaign = campaigns[_id];
campaign.donators.push(msg.sender);
campaign... | 1,850,285 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IGovernance.sol";
import "./lib/AccessControlEnumerable.sol";
import "./lib/BytesLib.sol";
/**
* @title DistributorGovernance
* @dev Add or remove block producers from the network and set rewards collectors
*/
contract DistributorGovernan... | Remove block producer from network Only governance can call producer Block producer address/ | function remove(address producer) external onlyGov {
require(blockProducer[producer] == true, "not block producer");
blockProducer[producer] = false;
emit BlockProducerRemoved(producer);
}
| 15,842,688 |
./partial_match/1/0x21670dDB429B6D80B5bE4e65532576bB14b7cC62/sources/RegistryAdapterIronBank.sol | Fetch asset metadata scoped to a user/ | function assetUserMetadata(address accountAddress, address assetAddress)
public
view
returns (AssetUserMetadata memory)
{
bool enteredMarket;
address[] memory markets = comptroller.getAssetsIn(accountAddress);
for (uint256 marketIdx; marketIdx < markets.length; ma... | 9,165,285 |
./full_match/43113/0x25103879d48ed7DcE44Daf77CE49EE80E58e2CE9/sources/AccessControl.sol | fuction utils hasRole check role account role is the bytes code role check line 22 account address check/ | function hasRole(bytes32 role, address account) public view returns (bool) {
return _roles[role].contains(account);
}
| 7,129,815 |
/*
・
* ★
・ 。
・ ゚☆ 。
* ★ ゚・。 * 。
* ☆ 。・゚*.。
゚ *.。☆。★ ・
` .-:::::-.` `-::---...```
`-:` .:+ssssoooo++//:.` .-/+shhhhhhhhhhhhhyyyssooo:
.--::. .+o... | Returns the IPFSPath to the metadata JSON file for a given NFT./ | function getTokenIPFSPath(uint256 tokenId) public view returns (string memory) {
return _tokenURIs[tokenId];
}
| 92,979 |
pragma solidity ^0.5.16;
import "./CToken.sol";
/**
* @title Compound's CErc20 Contract
* @notice CTokens which wrap an EIP-20 underlying
* @author Compound
*/
contract CErc20 is CToken, CErc20Interface {
/**
* @notice Initialize the new money market
* @param underlying_ The address of the underlyin... | Reduce cToken reserve cToken The cToken address reduceAmount The amount of reduction/ | function _reduceReserves(address cToken, uint reduceAmount) external onlyAdmin returns (uint) {
return CTokenInterface(cToken)._reduceReserves(reduceAmount);
}
| 12,177,646 |
./full_match/42/0x84D402e91b47033D1459De7Beea0758eBbAc414e/sources/localhost/DegenPosition.sol | solhint-disable-next-line | function emergencySubmitTransaction(
address destination,
bytes memory data,
uint256 gasLimit
) public onlyOwner returns (bool) {
uint256 dataLength = data.length;
bool result;
assembly {
result := call(
gasLimit,
destin... | 16,250,175 |
pragma solidity 0.5.17;
contract BondedSortitionPoolFactory {
/// @notice Creates a new bonded sortition pool instance.
/// @return Address of the new bonded sortition pool contract instance.
function createSortitionPool(
IStaking stakingContract,
IBonding bondingContract,
uint256 minimumStake,... | solium-disable-next-line security/no-inline-assembly | function _copy(address[] memory dest, address[] memory src) private pure {
assembly {
let length := mload(src)
let byteLength := mul(length, 0x20)
mstore(dest, length)
let writePtr := add(dest, 0x20)
let end := add(writePtr, byteLength)
for {
let readPtr := a... | 7,493,916 |
./full_match/1/0x4f272815fb641082b0291025016aebEBBC6Cf0D7/sources/contracts/NarfexFiat.sol | See {BEP20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {BEP20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ... | function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
msg.sender,
_allowances[sender][msg.sender] - amount
... | 4,846,415 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;
import "./ReserveStabilizer.sol";
import "./ITribeReserveStabilizer.sol";
import "../dao/ITribeMinter.sol";
import "../utils/Timed.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
/// @title implementation for a TRIBE Reserve Stabilizer
/... | returns the amount out of tokens from the reserves for a given amount of FEI amountFeiIn the amount of FEI in | function getAmountOut(uint256 amountFeiIn) public view override returns(uint256) {
uint256 adjustedAmountIn = amountFeiIn * usdPerFeiBasisPoints / Constants.BASIS_POINTS_GRANULARITY;
return readOracle().mul(adjustedAmountIn).asUint256();
}
| 10,003,103 |
./full_match/3/0x1AEf93FCB062b44F7F609E71A8f204AA91ec626D/sources/contracts/UniswapV2Router02.sol | refund dust eth, if any | function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) {
(amountToken, amountETH) = _addLiquidity(
token,
WETH,
amountTokenDesired,... | 8,235,276 |
./full_match/4/0x9973e0BB1f5be63E11578c603Ad1ED478c96c54d/sources/new1.sol | Sets the base token URI prefix. | function setBaseTokenURI(string memory _baseTokenURI) public onlyOwner {
baseTokenURI = _baseTokenURI;
}
| 721,830 |
./full_match/5/0x83835b7F4B0FE29B537CE22fb266ef6bF9331910/sources/contracts/ecosystem/VestingControllerERC721.sol | Mints a token and associates an investment to it and sets tokenURI and also mints an investors NFT emits NewInvestmentTokenMinted() and only accessible with signature from Rand signature is the signature which is used to verify the minting signatureTimestamp is the expiration timestamp of the signature params is th... | function mintNewInvestment(
bytes memory signature,
uint256 signatureTimestamp,
MintParameters memory params,
uint8 nftLevel
) public whenNotPaused nonReentrant returns (uint256 tokenId) {
tokenId = _mintNewInvestment(signature, signatureTimestamp, params);
uint2... | 1,855,077 |
// SPDX-License-Identifier: MIT
// Message module that allows sending and receiving messages using lane concept:
//
// 1) the message is sent using `send_message()` call;
// 2) every outbound message is assigned nonce;
// 3) the messages are stored in the storage;
// 4) external component (relay) delivers messages to b... | Pay rewards to given relayers, optionally rewarding confirmation relayer. reward every relayer except `confirmation_relayer` If delivery confirmation is submitted by other relayer, let's deduct confirmation fee from relayer reward. If confirmation fee has been increased (or if it was the only component of message fee),... | function pay_relayers_rewards(UnrewardedRelayer[] memory relayers, uint64 received_start, uint64 received_end) internal {
address payable confirmation_relayer = msg.sender;
uint256 confirmation_relayer_reward = 0;
uint256 confirmation_fee = confirmationFee;
for (uint256 i = 0; i < re... | 7,265,336 |
pragma solidity ^0.5.0;
/**
* @title IERC165
* @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
*/
interface IERC165 {
/**
* @notice Query if a contract implements an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @dev Interface identif... | note: anyone can deposit | function depositWei() public payable collectPatronage {
require(state != StewardState.Foreclosed, "Foreclosed");
deposit = deposit.add(msg.value);
}
| 12,865,771 |
/**
*Submitted for verification at Etherscan.io on 2019-12-02
*/
pragma solidity ^0.5.4;
/**
* ERC20 contract interface.
*/
contract ERC20 {
function totalSupply() public view returns (uint);
function decimals() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uin... | Lets the owner of a CDP partially repay their debt. The repayment is made up of the outstanding DAI debt (including the stability fee if non-zero) plus the MKR governance fee. The method will use the user's MKR tokens in priority and will, if needed, convert the required amount of ETH to cover for any missing MKR token... | function removeDebt(
BaseWallet _wallet,
bytes32 _cup,
uint256 _amount,
IMakerCdp _makerCdp,
UniswapFactory _uniswapFactory
)
internal
{
require(address(_wallet) == _makerCdp.lad(_cup), "CM: not CDP owner");
uint256 mkrFee = governanceFeeInMK... | 5,507,086 |
// File: contracts/commons/Ownable.sol
pragma solidity ^0.5.12;
contract Ownable {
address internal _owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
modifier onlyOwner() {
require(msg.sender == _owner, "The owner should be the sender");
_;
}
const... | Updates the `_name` metadata of a given `_signer` _signer Address of the signer _name Metadata - Human readable name of the signer/ | function setName(address _signer, string calldata _name) external onlyOwner {
require(isSigner[_signer], "signer not defined");
require(signerWithName[_name] == address(0), "name already in use");
require(bytes(_name).length > 0, "name can't be empty");
string memory oldName = nameOf... | 7,234,663 |
./partial_match/42/0xb3755CB68fB532A1580901B9E0004C324d8BA746/sources/InDefiEcoPreMining.sol | dfTokenizedStrategy.burnTokens(amount, 0, 0, flashloanFromAddress); | function withdrawToken(IToken token, uint256 amount, address receiver) internal {
if (receiver != address(this)) {
if (address(token) == ETH_ADDRESS) {
_transferEth(receiver, amount);
return;
token.transfer(receiver, amount);
return... | 3,409,097 |
pragma solidity ^0.5.16;
// Inheritance
import "./PerpsV2SettingsMixin.sol";
import "./interfaces/IPerpsV2Market.sol";
// Libraries
import "openzeppelin-solidity-2.3.0/contracts/math/SafeMath.sol";
import "./SignedSafeMath.sol";
import "./SignedSafeDecimalMath.sol";
import "./SafeDecimalMath.sol";
// Internal refere... | The fee charged from the margin during liquidation. Fee is proportional to position size but is at least the _minKeeperFee() of sUSD to prevent underincentivising liquidations of small positions. positionSize size of position in fixed point decimal baseAsset units price price of single baseAsset unit in sUSD fixed po... | function _liquidationFee(int positionSize, uint price) internal view returns (uint lFee) {
uint proportionalFee = _abs(positionSize).multiplyDecimal(price).multiplyDecimal(_liquidationFeeRatio());
uint minFee = _minKeeperFee();
}
| 12,935,996 |
./partial_match/11155111/0xD5717fA34747222dc74Efe083fda40b271faf000/sources/Auction/ClockAuctionBase.sol | 경매를 참여시키는 internal method _tokenId 포니 아이디 _bidAmount 경매 가격 (최종) | function _bid(uint256 _tokenId, uint256 _bidAmount)
internal
returns (uint256)
{
Auction storage auction = tokenIdToAuction[_tokenId];
require(_isOnAuction(auction), "is not auction");
uint256 price = _currentPrice(auction);
require(_bidAmount >= price, "low price");
... | 3,534,612 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./Proxy.sol";
interface ERC165 {
function supportsInterface(bytes4 id) external view returns (bool);
}
contract SemiTransparentProxy is Proxy {
// ////////////////////////// EVENTS ////////////////////////////////////////////////////////////////... | TO FULFILL EIP-173 this function is not transparent Like above, as a read only function, the conseqeuences are minimal plus for this one, the call is made through in any case while still ensuring it returns true for EIP-173 support solhint-disable-next-line security/no-inline-assembly | function supportsInterface(bytes4 id) external view returns (bool) {
if (id == 0x7f5828d0) {
return true;
}
if (id == 0xFFFFFFFF) {
return false;
}
ERC165 implementation;
assembly {
implementation := sload(
0x360894... | 7,270,969 |
./full_match/44787/0xb93f207230A44C212faCA713Dd76dC03410e7fd8/sources/contracts/community/Community.sol | celo mainnetalfajores testnetbaklava testnet | function _firstBlockTimestamp() public view returns (uint256) {
if (block.chainid == 42220) {
return 1587571205;
return 1594921556;
return 1593012289;
}
}
| 13,243,063 |
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;
}
uint... | Get the class's name. | function getClassName(uint32 _classId)
external view
returns (string)
{
return heroClasses[_classId].className;
}
| 50,130 |
pragma solidity ^0.5.0;
import "./Token.sol";
contract EthSwap {
string public name = "EthSwap Instant Excahnge";
uint256 public rate = 100;
Token public token;
event TokenPurchased(
address account,
address token,
uint256 amount,
uint256 rate
);
event TokenSol... | calculate the total amount of token check if ethswap has enough balance transfer token emit event TokenPurchased | function buyTokens() public payable {
uint256 tokenAmount = rate * msg.value;
require(token.balanceOf(address(this)) >= tokenAmount);
token.transfer(msg.sender, tokenAmount);
emit TokenPurchased(msg.sender, address(token), tokenAmount, rate);
}
| 933,067 |
// File: contracts/interfaces/IUniswapV2Pair.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name(... | this low-level function should be called from a contract which performs important safety checks | function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'decaswap: INSUFFICIENT_OUTPUT_AMOUNT');
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'decaswap: INSUFFICIENT_LIQUIDITY');
uint balance0;
... | 15,351,012 |
./partial_match/42/0x554Dd292Be1AcE0bDCb78914bD4bfBeA61087cdB/sources/APIGasRun.sol | Create a Chainlink request to retrieve API response, find the target data, then multiply by 1000000000000000000 (to remove decimal places from data)./ Set the URL to perform the GET request on Multiply the result by 1000000000000000000 to remove decimals Sends the request | function requestData(address oracle, bytes32 jobid) internal returns (bytes32 requestId)
{
called = called + 1;
Chainlink.Request memory request = buildChainlinkRequest(jobid, address(this), this.fulfill.selector);
request.add("path", "ethereum.usd");
int timesAmount = 10**18... | 8,992,942 |
./partial_match/1/0x7691cfa16366b3b28E7fe9Fac7A20c312c03519b/sources/Ethermaze.sol | View free Referrer Address/ | function findFreeReferrer(address _userAddress) public view returns (address) {
if (users[_userAddress].referral.length < referrer1Limit)
return _userAddress;
address[] memory referrals = new address[](254);
referrals[0] = users[_userAddress].referral[0];
referrals[1] =... | 2,698,809 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.6;
/**
* @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 i... | Initializes with the policy,Dai,DaiLp pool as parameters. debaseDaiPool Address of the Debase Dai pool contract debaseDaiTotalRatio_ Ratio of total supply given to Debase Dai Pool debaseDaiLpPool Address of the Debase Dai Lp pool contract debaseDaiLpTotalRatio_ Ratio of total supply given to Debase Dai Lp Pool air... | The function then sets the total supply to the initial supply and calculates the gon per fragment.
It also sets the value and the gons for both the Dai and DaiLp reward pools.
function initialize(
address debaseDaiPool,
uint256 debaseDaiTotalRatio_,
address deb... | 2,482,441 |
pragma solidity 0.4.25;
// File: contracts/ERC777/ERC20Token.sol
/* This Source Code Form is subject to the terms of the Mozilla external
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This code has not been reviewed.
... | allow Owner to transfer funds from a Frozen account the "_from" account must be frozen only the owner can trigger this function super.doSend to skip "_from" frozen checking | function transferFromFrozenAccount(
address _from,
address _to,
uint256 _amount
)
external
onlyOwner
whenNotPaused
whenAccountFrozen(_from)
whenAccountNotFrozen(_to)
whenAccountNotFrozen(msg.sender)
{
super.doSend(msg.sender, _from, _to, _amount, "", "", true);
}
| 7,310,114 |
./partial_match/1313161554/0x83693D27C60d88C21d9A4867c739ACCDa7bFD314/sources/contracts/apps/trisolarisStable/UnoFarmTrisolarisStable.sol | Core function of the strat, in charge of updating, collecting and re-investing rewards. 1. It claims rewards from the {MasterChef}. 2. It swaps {rewardToken} token for {tokenA} & {tokenB}. 3. It deposits new LP tokens back to the {MasterChef}./ | function distribute(
SwapInfo[] calldata rewardSwapInfos,
SwapInfo[] calldata rewarderSwapInfos,
SwapInfo[2] calldata feeSwapInfos,
FeeInfo calldata feeInfo
) external onlyAssetRouter nonReentrant returns (uint256 reward) {
require(totalDeposits > 0, "NO_LIQUIDITY");
... | 16,913,821 |
./full_match/80001/0xAad99d3722048438BeE9b3957aa55Fb0BAE4AF72/sources/project_/contracts/MoM_ERC721_Upgradeable.sol | Expose burning functionality, to the owner or those the owner approved | function burn(uint256 tokenId) public virtual {
require(ERC721Upgradeable._isApprovedOrOwner(_msgSender(), tokenId), string(abi.encodePacked(name(), ": caller is not token owner or approved")));
address owner = ERC721Upgradeable.ownerOf(tokenId);
string memory metadataUrl = MoM_ERC721_Upgra... | 9,485,830 |
pragma solidity ^0.5.13;
import "openzeppelin-solidity/contracts/math/Math.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import "./interfaces/IValidators.sol";
import "../common/C... | Returns validator information. account The account that registered the validator. return The unpacked validator struct./ | function getValidator(address account)
public
view
returns (
bytes memory ecdsaPublicKey,
bytes memory blsPublicKey,
address affiliation,
uint256 score,
address signer
)
{
require(isValidator(account), "Not a validator");
Validator storage validator = validators... | 905,916 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity ^0.8.0;
import "ds-test/test.sol";
import "./GovernanceManager.sol";
import "./GovernanceMaxLock.sol";
import "./GovernanceProposal.sol";
import "./GovernanceStorage.sol";
import "./Governance.sol";
import "./StakeNFT.sol";
import "./interfaces/INFTStake.sol"... | function that is called when a proposal is executed. It's only meant to be called by the Governance Manager contract. See the GovernanceProposal.sol file fore more details. Replace the following line with the address of the ETHDKG Diamond. | function execute(address self) public override returns(bool) {
address target = 0xEFc56627233b02eA95bAE7e19F648d7DcD5Bb132;
(bool success, ) = target.call(abi.encodeWithSignature("modifyDiamondStorage(address)", self));
require(success, "GovernanceProposeModifySnapshot: CALL FAILED!");
... | 990,381 |
// Verified using https://dapp.tools
// hevm: flattened sources of ./contracts/2021/Proposal20.sol
pragma solidity =0.5.15 >=0.5.15 <0.6.0;
pragma experimental ABIEncoderV2;
////// lib/yamV3/contracts/lib/IERC20.sol
/* pragma solidity ^0.5.15; */
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
... | who The address to query. return The balance of the specified address./ | function balanceOf(address who)
external
view
returns (uint256)
{
return _yamToFragment(_yamBalances[who]);
}
| 129,240 |
pragma solidity ^0.7.6;
interface IMasset {
function mint(
address _input,
uint256 _inputQuantity,
uint256 _minOutputQuantity,
address _recipient
) external returns (uint256 mintOutput);
function mintMulti(
address[] calldata _inputs,
uint256[] calldata _inputQuantities,
uint256 _minOutputQuantity,
... | Views This return an index, could be used to check if it's part of the basket | interface IMasset {
function mint(
address _input,
uint256 _inputQuantity,
uint256 _minOutputQuantity,
address _recipient
) external returns (uint256 mintOutput);
function mintMulti(
address[] calldata _inputs,
uint256[] calldata _inputQuantities,
uint256 _minOutputQuantity,
address _recipient
) ex... | 6,425,111 |
//Address: 0xee4458e052b533b1aabd493b5f8c4d85d7b263dc
//Contract name: Pass1
//Balance: 0 Ether
//Verification Date: 5/22/2018
//Transacion Count: 82
// CODE STARTS HERE
pragma solidity ^0.4.21;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* fun... | remove an address from the whitelist override from WhiteList contract to allow calling from owner or operators addresses addr address return true if the address was removed from the whitelist, false if the address wasn't in the whitelist in the first place/ | function removeAddressFromWhitelist(address addr)
isOwnerOrOperator
public
returns(bool success)
{
require(addr != owner);
if (whitelist[addr]) {
whitelist[addr] = false;
emit WhitelistedAddressRemoved(addr);
success = true;
}
... | 5,532,716 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "https://github.com/entroBeam/contracts/blob/main/EntroBeam/EntroBeam_main_v1.0.0.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title Inherit EntroBeam(EIX) ver 1.0.0 https://github.com/entroBeam
/// @author Leon Wesker, entrobeam@gm... | This allows users to send Entropy seed with one click without having to input 256bit seed. Recommend that you use keccack256's hashing source by adding or changing it as you prefer. The secure entropy is reborn anyway, no matter what '_preSeed' is, so it doesn't detract from the purpose of secure. But, theoretically, ... | function oneClick_submitEntropy() public {
bytes32 _preSeed = keccak256(
abi.encode(msg.data, block.number, msg.sender, block.difficulty)
);
submitEntropySeed(_preSeed);
}
| 14,052,377 |
// SPDX-License-Identifier: BSD-4-Clause
pragma solidity 0.8.3;
import "../../../Oracle/IOddzVolatilityOracle.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract OddzVolatility is Ownable, IOddzVolatilityOracle {
uint256 public delayInSeconds = 30 * 60;
uint256 public lastUpdatedAt;
mappin... | Function to set iv precision decimals _precision volatility precision/ | function setVolatilityPrecision(uint8 _precision) public onlyOwner {
volatilityPrecision = _precision;
}
| 13,090,153 |
/**
*Submitted for verification at Etherscan.io on 2021-07-12
*/
pragma solidity 0.8.2;
interface IPlatformIntegration {
/**
* @dev Deposit the given bAsset to Lending platform
* @param _bAsset bAsset address
* @param _amount Amount to deposit
*/
function deposit(
address _bAsset... | Redeem Underlying bAsset amount | function _withdraw(
address _receiver,
address _bAsset,
uint256 _amount,
uint256 _totalAmount,
bool _hasTxFee
) internal {
require(_receiver != address(0), "Must specify recipient");
require(_bAsset == bAsset, "Invalid bAsset");
require(_totalAmoun... | 2,500,079 |
//Address: 0x1efd5dc066eb56d4db7e2ff38843c8bf8aa59168
//Contract name: BitkomSale
//Balance: 0 Ether
//Verification Date: 12/30/2017
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
funct... | Constructor for a crowdsale of BitkomToken tokens. ifSuccessfulSendTo the beneficiary of the fund fundingCapInEthers the cap (maximum) size of the fund start the start time (UNIX timestamp) durationInDays the duration of the crowdsale in days addressOfTo... | function BitkomSale(
address ifSuccessfulSendTo,
uint256 fundingCapInEthers,
uint256 start,
uint256 durationInDays,
address addressOfTokenUsedAsReward
) public
{
require(ifSuccessfulSendTo != address(0) && ifSuccessfulSendTo != address(this));
r... | 1,825,719 |
./partial_match/1/0xc9321d56E89623C1800Bdf92D1EC6D7834eFD135/sources/GrandTheftPepe.sol | check if account is excluded from fee/ | function isExcludedFromFee(address account) external view returns(bool) {
return _isExcludedFromFee[account];
}
| 3,662,647 |
// File: contracts/SmartTreasuryV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
///////////////////////////////////////////////////////////////////////////
// __/|
// __//// /| This smart contract is part of Mover infrastructure
// |// //_/// https://viamover.com
// |_/ // suppor... | if there's not enough SLP tokens, withdraw staked from MasterChef | function emergencyWithdraw() public {
UserInfo storage userMove = userInfoMove[msg.sender];
UserInfo storage userMoveEthLP = userInfoMoveEthLP[msg.sender];
if (userMoveEthLP.amount > 0) {
uint256 slpBalance = IERC20Upgradeable(tokenMoveEthLPAddress).balanceOf(address(this));
... | 494,873 |
// File: contracts/RTokenStructs.sol
pragma solidity ^0.5.8;
contract RTokenStructs {
/**
* @notice Global stats
*/
struct GlobalStats {
/// @notice Total redeemable tokens supply
uint256 totalSupply;
/// @notice Total saving assets in redeemable amount
uint256 totalS... | IRToken.changeHat implementation | function changeHat(uint256 hatID) external nonReentrant returns (bool) {
changeHatInternal(msg.sender, hatID);
return true;
}
| 1,045,497 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.