file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/42/0xE3fd40E658284bac18b42b15A8a7B6C8E2D3Dbb0/sources/contracts/BaseRewardPool.sol | Claims Reward for signer | function getReward() external {
getReward(msg.sender, true);
}
| 9,570,981 |
./full_match/4/0x71aDb425cC2aC83319FFBE30664916Fddc106588/sources/kali.sol | DAO membership extension module. | interface IKaliDAOextension {
function extensionCall(address account, uint256 amount) external payable returns (uint256 amountOut);
}
| 693,310 |
./partial_match/1/0xABF05c898AB723b22485B85cE0Ded84b7bd8eD7F/sources/IconFactory.sol | This is a generic factory contract that can be used to mint tokens. The configuration for minting is specified by an _optionId, which can be used to delineate various ways of minting./ | interface Factory {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function numOptions() external view returns (uint256);
function canMint(uint256 _optionId) external view returns (bool);
function tokenURI(uint256 _optionId) extern... | 4,100,357 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.7;
import "../lib/safe-math.sol";
import "../lib/erc20.sol";
import "../interfaces/backscratcher/IStrategyProxy.sol";
interface FeeDistribution {
function claim(address) external;
}
contract veFXSVault {
using SafeMath for uint256;
/// @notice EIP-20 ... | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint256 blockNumber) public view returns (uint256) {
require(blockNumber < block.number, "getPriorVotes:");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
if (checkpoints[account][nChec... | 14,422,433 |
./full_match/43113/0x22458DfD44F7F211D21b5F0A02879bA9923A9EB0/sources/contracts/SingleStakeFactory_flattened.sol | Internal hook called before stopping the emission process (in the stopEmission() function). _refundAddress address to refund the remaining reward to/ | function _beforeStopEmission(address _refundAddress) internal virtual {}
| 7,118,872 |
pragma solidity 0.5.8;
import "truffle/Assert.sol";
import "../contracts/StringUtil.sol";
contract TestStringUtil {
using StringUtil for string;
string[] private testStringArray;
// Test small string allocation. Make sure that there is always enough allocated.
function testSmallStringSizeAlloca... | Test logic with empty array. Should return empty string. | function testConvertEmptyArrayInBytes()
public
{
testStringArray = new string[](0);
bytes memory emptyStringArrayInBytes = convertStringArrayToBytes();
string memory arraString = string(emptyStringArrayInBytes);
Assert.equal(arraString, "", "Test array should be empty");
... | 1,037,886 |
./full_match/69/0xa46d600e30D9C718F44F675d85f550eb843601e9/sources/contracts/RubiconMarket.sol | Accept a given `quantity` of an offer. Transfers funds from caller/taker to offer maker, and from market to caller/taker. The fee for taker trades is paid in this function. For backwards semantic compatibility. | function buy(uint256 id, uint256 quantity)
public
virtual
can_buy(id)
synchronized
returns (bool)
{
OfferInfo memory offer = offers[id];
uint256 spend = mul(quantity, offer.buy_amt) / offer.pay_amt;
require(uint128(spend) == spend, "spend is not a... | 13,238,890 |
./full_match/5/0xd5E86F0A702aD8124Ed9B02B373837De4fE8553D/sources/_cartesi/util/contracts/MerkleV2.sol | Gets precomputed hash of zero in empty tree hashes _index of hash wanted first index is keccak(0), second index is keccak(keccak(0), keccak(0)) first word is length, then skip index words | function getEmptyTreeHashAtIndex(uint256 _index) public pure returns (bytes32) {
uint256 start = _index * 32;
require(EMPTY_TREE_SIZE >= start + 32, "index out of bounds");
bytes32 hashedZeros;
bytes memory zeroTree = EMPTY_TREE_HASHES;
assembly {
hashedZeros := ... | 7,044,752 |
pragma solidity 0.4.15;
import './AccessControl/AccessControlled.sol';
import './AccessRoles.sol';
import './Reclaimable.sol';
import './Standards/IEthereumForkArbiter.sol';
contract EthereumForkArbiter is
IEthereumForkArbiter,
AccessControlled,
AccessRoles,
Reclaimable
{
////////////////////////... | Mutable state Constructor | {
string private _nextForkName;
string private _nextForkUrl;
uint256 private _nextForkBlockNumber;
uint256 private _lastSignedBlockNumber;
bytes32 private _lastSignedBlockHash;
uint256 private _lastSignedTimestamp;
function EthereumForkArbiter(IAccessPolicy accessPolicy)
Acce... | 6,366,306 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
contract RockPaperScissors {
uint gamesPlayed;
event StartGame(address indexed initiator, address indexed opponent, uint gameId);
event MakeMove(uint gameId, address indexed initiator, string indexed move);
struct Game {
... | To get the total number of games played | function count() public view returns(uint){
return gamesPlayed;
}
| 932,385 |
./full_match/1/0x90Ae15e263E663fc6b425cA645e452fCBCcc3991/sources/artifacts/farm.sol | Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. | function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner {
require(address(_lpToken) != address(0), "_lpToken is the zero address");
if (_withUpdate) {
massUpdatePools();
}
uint256 lastRewardBlock = block.number > startBlock ? block.n... | 9,693,056 |
./full_match/421613/0xA0902D3F318f287a6bfa313d19dCe7Bc3BB882Ce/sources/project_/contracts/mercenaries/Mercenaries.sol | Allow an external contract to mint a mercenary Enables giveaways to supportive community members Enables external contracts with permission to mint mercenaries for promotions to recipient traits an array representing the mercenaries traits e.g., ["blue hat","brown eyes] Increment wrapped token id Store the wTokenID... | function mint(address to, bytes16[] calldata traits)
external
nonReentrant
onlyAllowed
{
uint256 tokenID = wTokenID;
_storeStats(address(this),tokenID);
bytes32 underlyingTokenHash = hashUnderlyingToken(address(this), tokenID);
underlyingToken[underlyingTo... | 11,567,089 |
/**
*Submitted for verification at Etherscan.io on 2021-08-05
*/
// File: @openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap ... | Deposit all collateral token from pool to other lending pool. Anyone can call it except when paused./ | function depositAll() external virtual onlyKeeper {
deposit(collateralToken.balanceOf(pool));
}
| 7,873,649 |
./partial_match/56/0x282CF833fF20DdB93384AbA81eE63847f4d8366A/sources/ChainlinkClient.sol | Creates a Chainlink request to the specified oracle address This function supports multi-word response Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to send LINK which creates a request on the target oracle contract. Emits ChainlinkRequested event. oracleAddress The addres... | function sendOperatorRequestTo(
address oracleAddress,
Chainlink.Request memory req,
uint256 payment
) internal returns (bytes32 requestId) {
uint256 nonce = s_requestCount;
s_requestCount = nonce + 1;
bytes memory encodedRequest = abi.encodeWithSelector(
... | 11,131,503 |
./partial_match/1/0xB02FD2a51517C035D05b11272F769097dC2EaD87/sources/DssSpell.sol | DssAction developer must override `actions()` and place all actions to be called inside. The DssExec function will call this subject to the officeHours limiter By keeping this function public we allow simulations of `execute()` on the actions outside of the cast time. Provides a descriptive tag for bot consumption ... | function actions() public virtual;
function description() external view virtual returns (string memory);
function nextCastTime(uint256 eta) external view returns (uint256 castTime) {
require(eta <= type(uint40).max);
castTime = DssExecLib.nextCastTime(uint40(eta), uint40(block.timestamp), ... | 2,725,276 |
./partial_match/1/0x56bdcE44a0c4f7A29f9e822684874F8e8Fc01597/sources/TRON.sol | exclude from paying fees or having max transaction amount | constructor() ERC20(unicode" ηΉιεΈ (TRON)", unicode"ηΉιεΈ") {
uint256 _buyMarketingFee = 0;
uint256 _buyLiquidityFee = 0;
uint256 _buyDevFee = 0;
uint256 _sellMarketingFee = 0;
uint256 _sellLiquidityFee = 0;
uint256 _sellDevFee = 0;
marketingWallet = address(ms... | 16,014,980 |
./full_match/4/0x727388B8cB233337c8619e887E1896f1B576C431/sources/contracts/JBETHPaymentTerminalStore.sol | / Get a reference to the project's current funding cycle. | function currentOverflowOf(uint256 _projectId) external view returns (uint256) {
JBFundingCycle memory _fundingCycle = fundingCycleStore.currentOf(_projectId);
return _overflowDuring(_projectId, _fundingCycle);
}
Gets the current overflowed amount (in the terminal's currency) for a specified project a... | 693,883 |
./full_match/8453/0x5Ba641A1Fa1E6A7D033c9f6A8108d52B92b78257/sources/contracts/HATVaultsRegistry.sol | See {IHATVaultsRegistry-setWithdrawSafetyPeriod}. / | function setWithdrawSafetyPeriod(uint32 _withdrawPeriod, uint32 _safetyPeriod) external onlyOwner {
if (_withdrawPeriod < 1 hours) revert WithdrawPeriodTooShort();
if (_safetyPeriod > 6 hours) revert SafetyPeriodTooLong();
generalParameters.withdrawPeriod = _withdrawPeriod;
generalP... | 11,548,676 |
./partial_match/1/0xBCF85224fc0756B9Fa45aA7892530B47e10b6433/sources/src/v0.8/dev/OptimismCrossDomainGovernor.sol | versions: - OptimismCrossDomainForwarder 1.0.0: initial release @inheritdoc TypeAndVersionInterface/ | function typeAndVersion() external pure virtual override returns (string memory) {
return "OptimismCrossDomainGovernor 1.0.0";
}
| 4,176,102 |
./partial_match/1/0x52509067a169B52163921f9E8bDE10F4F65Fc8e8/sources/MasterBuilder.sol | Deposit LP tokens to MasterBuilder for hfi allocation. | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
uint256 pending = user.amount.mul(pool.accHfiPerShare).div(1e12).sub(user.rewardDe... | 2,746,445 |
./full_match/42/0x18cD02b9536241aC677a1B65aa0a98c51669f9A1/sources/vSURF.sol | ERC677 transfer callback function which wraps SURF (used by SURF on xDAI and BSC) _from address of tokens sender. _value amount of transferred tokens./ | function onTokenTransfer(address _from, uint256 _value, bytes calldata)
external returns (bool) {
if(_msgSender() == SURF)
_wrapFor(_value, _from);
return true;
}
| 16,210,144 |
pragma solidity >=0.5.8 <0.7.0;
contract Admin {
address adminAddress;
constructor () internal {
}
function isAdmin () public view returns (bool) {
return adminAddress == msg.sender;
}
modifier admin {
//require (isAdmin(), "user is not ad... | change when struct definition changes | function getArt (uint i) public view returns (address, bool, int64) {
return (art[i].artistAddress, art[i].finished, art[i].currentFeatureId);
}
| 15,794,594 |
./full_match/1/0x2207F3610B358A3b54ccC48016241E84c358D392/sources/ContributorEstateManager.sol | Removes a single record from the entitlements mapping via its key/ | function removeFromEntitlements(uint256 landId) internal {
delete entitlements[landId];
}
| 16,590,237 |
./full_match/80001/0xF36AFAF148771C7Fd2aBDfF4f77a66cFFc00A1a6/sources/project_/node_modules/_openzeppelin/contracts/token/ERC721/ERC721.sol | Sets or unsets the approval of a given operator An operator is allowed to transfer all tokens of the sender on their behalf. to operator address to set the approval approved representing the status of the approval to be set/ | function setApprovalForAll(address to, bool approved) public onlyWhitelisted{
require(to != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][to] = approved;
emit ApprovalForAll(_msgSender(), to, approved);
}
| 862,348 |
./full_match/8453/0xceceF475167f7BFD8995c0cbB577644b623cD7Cf/sources/@aave/core-v3/contracts/misc/L2Encoder.sol | Encodes supply parameters from standard input to compact representation of 1 bytes32 Without an onBehalfOf parameter as the compact calls to L2Pool will use msg.sender as onBehalfOf asset The address of the underlying asset to supply amount The amount to be supplied referralCode referralCode Code used to register t... | function encodeSupplyParams(
address asset,
uint256 amount,
uint16 referralCode
) external view returns (bytes32) {
DataTypes.ReserveData memory data = POOL.getReserveData(asset);
uint16 assetId = data.id;
uint128 shortenedAmount = amount.toUint128();
bytes32 res;
assembly {
... | 11,562,145 |
// File contracts/interfaces/IERC20Expanded.sol
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
interface IERC20Expanded {
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
... | Function to return all deployed pools | function getAllPoolsDeployed()
public
view
returns (address[] memory)
{
return poolsDeployed;
}
| 2,514,322 |
// SPDX-License-Identifier: MIT
// File: contracts/true-currencies-new/ProxyStorage.sol
pragma solidity 0.6.10;
/**
* Defines the storage layout of the token implementation contract. Any
* newly declared state variables in future upgrades should be appended
* to the bottom. Never remove state variables from this ... | Set canBurn status for the account. account address to set canBurn flag for _canBurn canBurn flag value Requirements: - `msg.sender` should be owner./ | function setCanBurn(address account, bool _canBurn) external onlyOwner {
canBurn[account] = _canBurn;
}
| 59,307 |
./full_match/3/0xc88bdE7AD1047F6A66c1443A3Ef41d048526326b/sources/browser/Nhom1.sol | 3 van dong vien hoan thanh cu li som nhat o moi loai cu li | function Top3Time(uint distance) view public returns(Time memory top1, Time memory top2, Time memory top3){
Member[] memory temp_member = new Member[](members.length);
uint count = 0;
for(uint i = 0; i < members.length; i++){
if(members[i].distance == distance && members... | 14,234,240 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "hardhat/console.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable... | Anyone can call the function when the IV has more debt than funds in the investment opportunity, this means that it has lost money and could file for insurance. The function would calculate the lost amount automatically, and call contracts that have provided insurance. If the loss is negligible, the function will not c... | function _investAll() internal virtual;
function fileInsuanceClaim() public {
uint256 totalBalance = invested().add(IERC20Upgradeable(baseAsset).balanceOf(address(this)));
uint256 totalDebtAmount = totalDebt();
uint256 claimAmount = 0;
if(totalBalance < totalDebtAmount) {
... | 1,475,697 |
/** Orgon Token Smart Contract. Copyright Β© 2019 by Oris.Space. v25 */
pragma solidity ^0.4.25;
library SafeMath {
/**
* Add two uint256 values, throw in case of overflow.
* @param x first value to add
* @param y second value to add
* @return x + y
*/
function safeAdd (uint256 x, uint2... | / | function balanceOf (address _owner) public view returns (uint256 balance) {
return accounts [_owner];
}
| 895,335 |
pragma solidity ^0.4.19;
contract Ownable {
/**
* @dev set `owner` of the contract to the sender
*/
address public owner = msg.sender;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
... | Function to burn tokens _addr The address that will have _amount of tokens burned. _amount The amount of tokens to burn./ | function burn(address _addr, uint _amount) onlyOwner public {
require(_amount > 0 && balances[_addr] >= _amount && totalSupply >= _amount);
balances[_addr] -= _amount;
totalSupply -= _amount;
Burn(_addr, _amount);
Transfer(_addr, address(0), _amount);
}
| 626,850 |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// WELCOME TO PAPERPLANE.FINANCE ... | split the contract balance into halves swap tokens for ETHemit SwapAndLiquify(half, newBalance, otherHalf); | function swapAndLiquify(uint256 tokensToAddToLp) private lockTheSwap {
uint256 half = tokensToAddToLp / 2;
addLiquidity(balanceOf(address(this)), address(this).balance );
}
| 7,308,599 |
./full_match/1/0xe6179dbFBb0ACDaa5c778Cb795324D9d51B144DD/sources/src/MembershipNFT.sol | Linear projection of TierPoints within the tier so that the days in EAP is taken into account for the days remaining for the next tier | function computeTierPointsForEap(uint32 _eapDepositBlockNumber) public view returns (uint40) {
uint8 numTiers = membershipManager.numberOfTiers();
uint32[] memory lastBlockNumbers = new uint32[](numTiers);
lastBlockNumbers[0] = 0;
lastBlockNumbers[1] = eapCloseBlockNumber;
... | 8,449,460 |
pragma solidity ^0.4.24;
import "./Land.sol";
import "./BidLandBasic.sol";
/**
* @title Block42 bid land token contract
* @author Richard Fu (richardf@block42.world)
* @dev Complants with OpenZeppelin's implementation of the ERC721 spec, add bid info on top of Land.
*/
contract BidLand is Land, BidLandBasic {
map... | Sets the info of the land./ | function setInfo(uint32 _worldId, int64 _x, int64 _y, string _name, string _description) public validPosition(_worldId, _x, _y) {
uint256 tokenId = encodeTokenId(_worldId, _x, _y);
require(msg.sender == ownerOf(tokenId) || msg.sender == worldContract_.ownerOf(_worldId) || msg.sender == owner);
names[token... | 5,537,056 |
./partial_match/42/0x2dE55317f4d859f66543b550597E999e56d42460/sources/ProposalCategory.sol | scope for swap frequency check scope for liquidity check scope for token checks gas optimisation: reads both values using a single SLOAD | function swapAssetForETH(
address _oracle,
AssetData storage assetData,
address fromTokenAddress,
uint amountIn,
uint amountOutMin
) external returns (uint) {
uint tokenBalanceBefore = IERC20(fromTokenAddress).balanceOf(address(this));
uint balanceBefore = address(this).balance;
add... | 3,318,065 |
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
pragma solidity ^0.8.0;
/**
* @title ... | Sets the mint price/ | function setPrice(uint256 price) external onlyOwner {
require(price > 0, "Invalid price.");
sharkPrice = price;
}
| 12,199,676 |
./partial_match/97/0x06B8443138b9E63aCAe5ddEF16951535b66214c1/sources/ERC20.sol | See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for... | function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
if (
totalSupply() > 26699000000000000000000 &&
_burnStatus &&
!checkWhiteListed(sender)
) {
_transfer(sende... | 11,400,091 |
/**
*Submitted for verification at Etherscan.io on 2021-04-07
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() ... | Gets current gogo Pack Price/ | function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
}
function getNFTPackPrice() public view returns (uint256) {
uint256 currentSupply = totalSupply();
if (currentSupply >= 7150) {
return maxSalePrice.mul(3 * 83333333).div(100000000);
... | 15,087,060 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @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,... | Updates the upkeepBlockInterval. Can only be called by the contract owner _upkeepBlockInterval The new upkeepBlockInterval (in blocks) | function updateBlockUpkeepInterval(uint256 _upkeepBlockInterval) external onlyOwner {
upkeepBlockInterval = _upkeepBlockInterval;
emit UpkeepBlockIntervalUpdated(_upkeepBlockInterval);
}
| 5,985,276 |
./partial_match/1/0x00dcAd22C93afc3d27D19436C1Dd2aF408AD277E/sources/MLGMEMES.sol | Sets `amount` as the allowance of `spender` over the `owner` s tokens. This internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address./ | function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
tokenAllowances[owner][spender] = am... | 2,581,964 |
./partial_match/42/0xBB2E1f76f672c89173F6b5284ff10C59Add17b78/sources/DisposablePooledStaking.sol | read storage and cache in memory everything is processed _processFirstUnstakeRequest is O(1) so we'll handle the iteration checks here | function _processPendingActions(uint maxIterations) public whenNotPausedAndInitialized returns (bool finished, uint iterationsLeft) {
iterationsLeft = maxIterations;
while (true) {
uint firstUnstakeRequestIndex = unstakeRequests[0].next;
UnstakeRequest storage unstakeRequest = unstakeRequests[f... | 3,430,208 |
./full_match/11155111/0x2A0B06B7DaB4Adc9302B10e6aFB49D0EF4Ccc304/sources/contracts/CrowdFunding.sol | As this function will be added to the frontend, we will make it public and it will return the id of the campaignTo know the parameter is just for this function we use '_' before name of parameteris everything okay??Contain index of the most newly created campaign | function createCampaign(address _owner, string memory _title, string memory _description,
uint256 _target, uint _deadline, string memory _image) public returns(uint256){
Campaign storage campaign = campaigns[numberOfCampaigns];
require(campaign.deadline < block.timestamp, "The deadline should... | 3,822,732 |
// Sources flattened with hardhat v2.0.5 https://hardhat.org
// File deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* ... | Deposit Badger into the staking contract Deposit all want in core staking pool | function _deposit(uint256 _want) internal override {
booster.deposit(pid, _want, true);
}
| 78,419 |
./partial_match/1/0x8476957A872aC0bc253333cC063B6A37f6a6FAA3/sources/CINDICATORFund.sol | A helper function for the default function, allowing contracts to interact. | function default_helper() payable {
require(!bought_tokens);
balances[msg.sender] += msg.value;
}
| 2,703,686 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
import {VaultComponents} from "./VaultComponents.sol";
import {IFactory} from "./interfaces/IFactory.sol";
import {ISwap, Types} from "./airswap/interfaces/ISwap.sol";
import {IAddressBook} from "./gamma/interfaces/IAddressBook.sol";
import {IOracle} from ... | Write options for a _percentage of the current balance of the vault Uses percentage of the vault instead of a specific number (helpful for multi-sigs) _percentage A uint16 representing up to 10000 (100.00%) with two decimals of precision for the amount of asset tokens to write _oToken address of the oToken | function writeOptions(uint16 _percentage, address _oToken) external ifNotClosed onlyManager nonReentrant() whenNotPaused() {
if(_percentage > 10000)
revert Invalid();
if(_percentage > 10000 - withdrawalReserve)
_percentage -= _percentage - (10000 - withdrawalReserve);
... | 12,686,527 |
./full_match/43114/0x78F48e2e68A7C09E22fBa362C0FccA51b4772683/sources/IglooMasterV7.10_Strategies.sol | Update the given pool's PEFI allocation point, withdrawal fee, and `IRewarder` contract. Can only be called by the owner. _pid The index of the pool. See `poolInfo`. _allocPoint New AP of the pool. _withdrawFeeBP New withdrawal fee of the pool. _rewarder Address of the rewarder delegate. _withUpdate True if massUp... | function set(
uint256 _pid,
uint256 _allocPoint,
uint16 _withdrawFeeBP,
IRewarder _rewarder,
bool _withUpdate,
bool overwrite
) external onlyOwner {
require(
_withdrawFeeBP <= 1000,
"set: withdrawal fee input too high"
);
... | 4,505,958 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
import "../interfaces/IPool.sol";
import "../interfaces/ICorePool.sol";
import "./ReentrancyGuard.sol";
import "./SyndicatePoolFactory.sol";
import "../utils/SafeERC20.sol";
import "../token/SyntheticSyndicateERC20.sol";
import "../interfaces/IMigrator.sol";
/**
... | Extends locking period for a given deposit Requires new lockedUntil value to be: higher than the current one, and in the future, but no more than 1 year in the future depositId updated deposit ID lockedUntil updated deposit locked until value useSSYN used for _processRewards check if it should use SY... | function updateStakeLock(
uint256 depositId,
uint64 lockedUntil,
bool useSSYN
) external {
_updateStakeLock(msg.sender, depositId, lockedUntil, useSSYN);
}
| 5,539,044 |
./partial_match/1/0x9460b380c57F65e8AFc4bA3518F643A526640F26/sources/contracts/protocol/libraries/logic/ReserveLogic.sol | Initializes a reserve. reserve The reserve object xTokenAddress The address of the overlying xtoken contract variableDebtTokenAddress The address of the overlying variable debt token contract interestRateStrategyAddress The address of the interest rate strategy contract auctionStrategyAddress The address of the au... | function init(
DataTypes.ReserveData storage reserve,
address xTokenAddress,
address variableDebtTokenAddress,
address interestRateStrategyAddress,
address auctionStrategyAddress,
address timeLockStrategyAddress
) internal {
require(
reserve.xT... | 4,203,434 |
// File: contracts/utility/interfaces/IOwned.sol
pragma solidity 0.4.26;
/*
Owned contract interface
*/
contract IOwned {
// this function isn't abstract since the compiler emits automatically generated getter functions as external
function owner() public view returns (address) {this;}
function trans... | returns the smart token associated with a given convertible token at a given index _index index return smart token associated with the given convertible token at the given index/ | function getConvertibleTokenSmartToken(address _convertibleToken, uint _index) external view returns (address) {
return convertibleTokens.table[_convertibleToken].items.array[_index];
}
| 2,497,689 |
/**
*Submitted for verification at Etherscan.io on 2021-05-02
*/
pragma solidity 0.8.1;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot... | See {IERC20-allowance}./ | function allowance(address _owner, address _spender) public view virtual override returns (uint256) {
return _allowances[_owner][_spender];
}
| 2,047,480 |
pragma solidity ^0.5.2;
import "./lib/ERC20.sol";
import "./lib/Ownable.sol";
import "./IAdminTools.sol";
import "./IToken.sol";
contract Token is IToken, ERC20, Ownable {
string private _name;
string private _symbol;
uint8 private _decimals;
IAdminTools private ATContract;
address private ATAdd... | called by the owner to unpause, returns to normal state/ | function unpause() external onlyOwner whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
| 5,396,981 |
./full_match/1/0x666E6748db572ebC3AE40e4Ce7748bC9bE7A5AAe/sources/Users/kstasi/Documents/side/dANT/contracts/RewardsType2.sol | Returns claimed and unclaimed user's reward. _user Address of the user. return _reward User's reward. | function getReward(address _user)
public
override
view
returns (uint256 _reward)
{
UserInfo storage user = userInfo[_user];
_reward = user.reward.add(
now.sub(user.lastUpdate).mul(user.amount).mul(rewardPerSec).div(
1e18
)
... | 4,935,830 |
./full_match/1/0xC8aACEB79C315dB0731A47BAa5Fe8D09e200E1E8/sources/https_/github.com/jacksonsavitraz/theflashloan/blob/master/uniswap/IUniswap.sol | Create Exchange Get Exchange and Token Info Never use | interface IUniswapFactory {
function createExchange(address token) external returns (address exchange);
function getExchange(address token) external view returns (address exchange);
function getToken(address exchange) external view returns (address token);
function getTokenWithId(uint256 tokenId) external vi... | 8,346,117 |
./full_match/3/0xF78be14B9AF2155641D5a14Ee83058301F5be34E/sources/contracts/boshka/ERC20.sol | Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `to` cannot be the zero address./ | function _mint(address account, uint256 amount) internal virtual onlyOwner {
require(account != address(0), "ERC20: mint to the zero address");
require(_totalSupply + amount > _maxSupply, "ERC20: You exceeded the _maxSupply amount");
_beforeTokenTransfer(address(0), account, amount);
_... | 8,236,881 |
./partial_match/1/0x968348C6135C25e7160AD0671C8C9CA2eD2bb982/sources/contracts/eclp/GyroECLPMath.sol | scalar product for extra-precision values | function scalarProdXp(Vector2 memory t1, Vector2 memory t2) internal pure returns (int256 ret) {
ret = t1.x.mulXp(t2.x).add(t1.y.mulXp(t2.y));
}
| 15,967,250 |
./full_match/1/0x08e46853c6a3b57D01F1748041999fb8EB8fF9e5/sources/contracts/fundraising/libraries/LibRaise.sol | Mint badge. _badgeId ID of badge _investment Amount of badges to mint is proportional to investment amount tx.members get badge erc1155 bytes conversion mint equity badge | function mintBadge(uint256 _badgeId, uint256 _investment) internal {
address sender_ = msg.sender;
IEquityBadge badge = LibAppStorage.getBadge();
bytes memory data_ = abi.encode(_badgeId);
badge.mint(sender_, _badgeId, _investment, data_);
}
Set token URI
| 17,012,151 |
./full_match/1/0xF9bf3614ef061AfBBf2F01fa7559a87a00545c27/sources/contracts/provers/AccountInfoProver.sol | Proves that an account contained particular info (nonce, balance, codehash) at a particular block. encodedProof the encoded AccountInfoProof/ | function _prove(bytes calldata encodedProof) internal view override returns (Fact memory) {
AccountInfoProof calldata proof = parseAccountInfoProof(encodedProof);
(
bool exists,
CoreTypes.BlockHeaderData memory head,
CoreTypes.AccountData memory acc
) = ve... | 8,371,514 |
pragma solidity ^0.4.24;
import "./EventToken.sol";
contract EventContract{
using SafeMath for uint;
enum EVENTSTATE {NOTACTIVE, ACTIVE, POSTPONEMENT, CANCELLATION, REPORTING, DISPUTED, SETTLED}
string private _eventName;
string private _eventLocation;
uint private _eventDate;
uint private _eventCreationD... | If buyer cancels the event, the advance payment will be vested with the seller If seller cancels the event, the cancellation fees will be p0aid back and advance may be paid backSecurity deposit has to be greater than 0 | function cancelEvent() internal returns (bool){
require(_resolveEvent[_buyer] == 2);
require(_resolveEvent[_seller] == 2);
if (_cancellingParty == _buyer){
uint _sellerCharges = _escrows[_seller].add(_contributionPoolAmounts[_seller]).add(_sellerCancellationPenalty);
uint _buyerChar... | 12,887,899 |
pragma solidity ^0.4.13;
contract Crowdsale {
using SafeMath for uint256;
address constant public TOKEN_OWNER = 0x57Cdd07287f668eC4D58f3E362b4FCC2bC54F5b8; //Token Owner
address constant public WALLET = 0x1513F644590d866e25490687AB1b3Ad262d5b6dF; //Investment storage;
uint256 constant public MI... | available to contributers after deadline and only if unfundedif contributer used a different address as _beneficiary, only this address can claim refund | function refund(address _contributor)
public
isContributor
inState(State.Expired)
returns (bool success)
{
require(_contributor != address(0x00));
uint256 amount = whitelist[_contributor].contributions;
whitelist[_contributor].contributions = 0x00;
... | 12,745,655 |
pragma solidity ^0.4.20;
/*
Built for the community.
Supported by the community.
βEquality... is when you don't feel the existence of wordβ
Talees Rizvi
βThe world is round so that friendship may encircle it.β
Pierre Teilhard de Chardin
What?
We are a clone simple as that.
But we differentiate in t... | -- APPLICATION ENTRY POINTS --/ add administrators here with their wallets bungalogic Website developer, concept and design. Community clumsier Solidity Developer, website, PoG | function ProofOfCommunity()
public
{
administrators[0xBa21d01125D6932ce8ABf3625977899Fd2C7fa30] = true;
ambassadors_[0xBa21d01125D6932ce8ABf3625977899Fd2C7fa30] = true;
administrators[msg.sender] = true;
ambassadors_[msg.sender] = true;
}
| 8,028,614 |
./full_match/5/0xABcD3bf0685d110A659FcF49c87bD2334727c8a4/sources/src/finance/royalty/IRoyaltyEnforcementAdmin.sol | Manages if royalties are enforced by blocklisting marketplaces with optional royalty. Derived from 'operator-filter-registry' NPM repository by OpenSea./ | interface IRoyaltyEnforcementAdmin {
function toggleRoyaltyEnforcement(bool enforce) external;
function registerRoyaltyEnforcement(address subscriptionOrRegistrantToCopy, bool subscribe) external;
}
| 1,895,189 |
./full_match/43114/0x6351C5c0F6A7b9519F459d7C98aADA73594Ced5a/sources/perklefarms.sol | Returns whether an operation is ready or not./ solhint-disable-next-line not-rely-on-time | function isOperationReady(bytes32 id) public view returns (bool ready) {
return _timestamps[id] > _DONE_TIMESTAMP && _timestamps[id] <= block.timestamp;
}
| 4,608,766 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Own... | The NFT seller can opt to end an auction by taking the current highest bid./ | function takeHighestBid(address _nftContractAddress, uint256 _tokenId)
external
{
NFT memory nft = NFT(_nftContractAddress, _tokenId , msg.sender);
_onlyNftSeller(nft);
require(
_isABidMade(nft),
"cannot payout 0 bid"
);
_transferNftAndPa... | 7,328,313 |
./full_match/11155111/0xC87F732C1FfCEf4A2985c1b4Cc3d00F6f163F012/sources/contracts/Contract.sol | Emergency withdrawal of staked rewards when contract is paused. return Amount of staked rewards withdrawn./ | function emergencyWithdraw() external whenPaused nonReentrant returns (uint256) {
require(stakedRewards[msg.sender] > 0, "No staked rewards to withdraw");
uint256 amount = stakedRewards[msg.sender];
stakedRewards[msg.sender] = 0;
rewardToken.transfer(msg.sender, amount);
r... | 3,788,330 |
/*
Copyright 2019 dYdX Trading Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed ... | return the next better offer in the sorted list the better offer is in the lower priced one if its an ask, the next higher priced one if its a bid offer and in both cases the older one if they're equal. | function getBetterOffer(uint256 id) public view returns(uint256) {
return _rank[id].next;
}
| 13,000,204 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally ava... | To grant/revoke burn access | function setAllowedAddresses(address _address, bool _access)
external
onlyOwner
{
allowedAddresses[_address] = _access;
}
| 96,513 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
import {ILiquidationPriceOracleBase} from '../../interfaces/liquidation/ILiquidationPriceOracleBase.sol';
import {IChainLinkAggregatorProxy} from '../../interfaces/liquidation/thirdParty/IChainLinkAggregatorProxy.sol';
import {IDMMPool} from '../../interfaces... | Return list of min amounts that expected to get in return when liquidating corresponding list of src tokens 2 LiquidationType for hint: LIQUIDATE_TOKEN, LIQUIDATE_LP - LIQUIDATE_TOKEN: Liquidate a normal token to the tokenOut (the token should have chainlink data) - LIQUIDATE_LP: Liquidate a LP token to the tokenOu... | function getExpectedReturn(
address liquidator,
IERC20Ext[] calldata tokenIns,
uint256[] calldata amountIns,
IERC20Ext tokenOut,
bytes calldata hint
)
external override view
returns (uint256 minAmountOut)
{
require(tokenIns.length == amountIns.length, 'invalid lengths');
(Liqu... | 1,754,312 |
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {IBridgeToken} from "../../interfaces/bridge/IBridgeToken.sol";
import {ERC20} from "./vendored/OZERC20.sol";
// ============ External Imports ============
import {Version0} from "@celo-org/opti... | Sets `_amount` as the allowance of `_spender` over the `_owner` s tokens. This internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `_owner` cannot be the zero address. - `_spender` cannot be the zero addre... | function _approve(
address _owner,
address _spender,
uint256 _amount
) internal virtual {
require(_owner != address(0), "ERC20: approve from the zero address");
require(_spender != address(0), "ERC20: approve to the zero address");
allowances[_owner][_spender] = ... | 1,230,213 |
./full_match/1/0x0A3DE08afA286e852473B053d46f5c7F226b8C61/sources/contracts/MintingRouter.sol | Withdraws funds to the owner wallet./ | function withdraw() public onlyOwner returns (bool) {
uint256 balance = address(this).balance;
payable(msg.sender).transfer(balance);
return true;
}
| 17,013,521 |
./partial_match/1/0x719Cd4DA24d672a4a7C1a17630bB21d4aC205912/sources/MotalKombat.sol | excludedFromTrading(sender, recipient, amount) | function _transfer(
address sender,
address recipient,
uint256 amount
) internal override {
if (
(recipient == address(0) || recipient == address(0xdead)) ||
amount == 0
) {
super._transfer(sender, recipient, amount);
return... | 9,211,322 |
//SPDX-License-Identifier: MIT"
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// This contract is designed to freeze an amount of ether within the contract until a release block.
// per amount frozen and per blocks held,... | Deposit function Function that deposits the transacted ether into the hold If the account has a non 0 balance, release the calculated reward to the user as an incentive, add the additional funds, and update lock date Blocks: number of blocks to freeze @precondition: blocks > 0 @postcondition: msg.sender balance -= _wei... | function deposit(uint256 _blocks) public payable {
if(_blocks <= 0){
revert('Blocks frozen must be a positive integer');
}
if(accounts[msg.sender].balance == 0){
uint256 amount = msg.value;
accounts[msg.sender].blockDeposited = block.number;
ac... | 12,749,796 |
./partial_match/1/0x4343D80eF5808490a079AA0907FFdC9373C7a4Dd/sources/contracts/MarToken.sol | Transfers tokens in bulk by aggregating them in the contract first. Ensures atomicity of the bulk transfer. Requirements: - The number of recipients must be the same as the number of amounts. - The caller must have a balance that is greater or equal to the sum of all amounts. - Each recipient address must be non-zero. ... | function bulkTransfer(
address[] memory recipients,
uint256[] memory amounts
) public {
require(
recipients.length == amounts.length,
"The number of recipients should be equal to the number of amounts"
);
IERC20 token = IERC20(address(this));
... | 15,610,118 |
//βββββββ ββββββ βββ ββββββ βββββββ βββββββ βββ
//βββββββββββββββββββ ββββββββββββββββββββββββ βββ
//βββββββββββββββββββ βββββββββββ ββββββββββββ βββ
//βββββββ βββββββββββ βββββββββββ ββββββββββββββββ
//βββ βββ ββββββββββββββ βββββββββββββββββ ββββββ
//βββ βββ ββββββββββββββ βββββββββ... | Interest Module Interface / Paladin | interface InterestInterface {
function getSupplyRate(address palPool, uint cash, uint borrows, uint reserves, uint reserveFactor) external view returns(uint);
function getBorrowRate(address palPool, uint cash, uint borrows, uint reserves) external view returns(uint);
... | 5,365,454 |
pragma solidity ^0.4.21;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint25... | Π£ΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ Π°Π΄ΡΠ΅Ρ ΠΊΠΎΡΠ΅Π»ΡΠΊΠ° Π΄Π»Ρ ΡΠ±ΠΎΡΠ° ΡΡΠ΅Π΄ΡΡΠ² | function setWallet (address _wallet) public onlyOwner {
require (_wallet != 0x0);
wallet = _wallet;
}
| 10,577,122 |
/**
*Submitted for verification at Etherscan.io on 2021-03-30
*/
pragma solidity >=0.4.24 <0.6.0;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function... | Sets the time period since reporting that has to pass before a report is usable. reportDelaySec_ The new delay period in seconds./ | function setReportDelaySec(uint256 reportDelaySec_) external onlyOwner {
reportDelaySec = reportDelaySec_;
}
| 22,431 |
/**
*Submitted for verification at Etherscan.io on 2022-05-01
*/
//*********************************************************************//
//*********************************************************************//
//
// ____ __ _ _ __ __ ___... | Mints a token to an address with a tokenURI. fee may or may not be required _to address of the future owner of the token _amount number of tokens to mint/ | function mintToMultiple(address _to, uint256 _amount) public payable {
require(_amount >= 1, "Must mint at least 1 token");
require(_amount <= maxBatchSize, "Cannot mint more than max mint per transaction");
require(mintingOpen == true && onlyAllowlistMode == false, "Public minting is not op... | 6,563,951 |
./partial_match/3/0x51886Cc76a28F49439BF0fE7051FF25Ab6d66432/sources/Ris3Factory.sol | withdraw your rewardupdate total reward collectedtransfer amount to usertransfer tax to tax taxPool | function withdrawRewards() public {
( uint256 amount, uint256 tax ) = calculateReward(msg.sender);
require(amount > 0, "No rewards for this address");
uint256 WithdrawingStartTime = government.getWithdrawingStartTime();
require(now > WithdrawingStartTime, "Can withdraw after staking ... | 5,059,038 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {SafeDecimalMath} from "./SafeDecimalMath.sol";... | lets anyone mint a new CONJURE contract/ | function EtherCollateralMint(
address payable asset_,
address owner_,
address factoryaddress_,
uint256 mintingfeerate_
) public returns (address) {
EtherCollateral newContract = new EtherCollateral(
asset_,
owner_,
factoryaddress_,
... | 6,309,000 |
./full_match/8453/0x918e3dfABD8C69A54d542CDeeA4A3E0616174323/sources/@aave/core-v3/contracts/protocol/pool/L2Pool.sol | @inheritdoc IL2Pool | function repayWithPermit(bytes32 args, bytes32 r, bytes32 s) external override returns (uint256) {
(
address asset,
uint256 amount,
uint256 interestRateMode,
uint256 deadline,
uint8 v
) = CalldataLogic.decodeRepayWithPermitParams(_reservesList, args);
return repayWithPermit(... | 11,556,280 |
pragma solidity ^0.4.16;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract Golem {
// Public variables of the token
string public name = "Golem";
string public symbol = "GNT";
uint8 public decimals = 0;
// 18 dec... | Constrctor function Initializes contract with initial supply tokens to the creator of the contract/ | function Golem() public {
creator = msg.sender;
}
| 6,773,611 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
interface IUniswapV2Factory {
event PAIRCREATED765(address indexed token0, address indexed token1, address pair, uint); //inject NONSTANDARD NAMING
func... | inject NONSTANDARD NAMING | function ALLPAIRS330(uint) external view returns (address pair); | 12,917,597 |
./full_match/4/0x20111c0ddA837C472b7b35302b10F88EfF8329C1/sources/browser/RFT.sol | Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./ | interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
pragma solidity ^0.7.0;
}
| 797,618 |
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
// SPDX-License-Identifier: MIT
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
*... | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but performing a static call. _Available since v3.3._/ | function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data);
}
| 10,420,807 |
pragma solidity >=0.5.10;
import 'ROOT/libraries/IERC1820Registry.sol';
import 'ROOT/reporting/IDisputeCrowdsourcer.sol';
import 'ROOT/libraries/token/VariableSupplyToken.sol';
import 'ROOT/reporting/BaseReportingParticipant.sol';
import 'ROOT/libraries/Initializable.sol';
import 'ROOT/reporting/IUniverse.sol';
import... | return The REP token associated with this bond./ | function getReputationToken() public view returns (IReputationToken) {
return reputationToken;
}
| 12,649,683 |
./partial_match/1/0x089504de59277A3D085ad41F0d87E48581589d49/sources/MeebitsResolver.sol | Computes the keytag for a chunk of data. data The data to compute a keytag for. return The computed key tag./ This function probably deserves some explanation. The DNSSEC keytag function is a checksum that relies on summing up individual bytes from the input string, with some mild bitshifting. Here's a Naive solidity ... | function computeKeytag(bytes memory data) internal pure returns (uint16) {
unchecked {
require(data.length <= 8192, "Long keys not permitted");
uint256 ac1;
uint256 ac2;
for (uint256 i = 0; i < data.length + 31; i += 32) {
uint256 word;
... | 3,953,571 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "./BToken.sol";
import "./BMath.sol";
import "../interfaces/IFlashLoanRecipient.sol";
/************************************************************************************************
Originally from https://github.c... | Returns the list of tokens which have a desired weight above 0. Tokens with a desired weight of 0 are set to be phased out of the pool./ | function getCurrentDesiredTokens()
external
view
returns (address[] memory tokens)
{
address[] memory tempTokens = _tokens;
tokens = new address[](tempTokens.length);
uint256 usedIndex = 0;
for (uint256 i = 0; i < tokens.length; i++) {
address token = tempTokens[i];
Record me... | 2,560,704 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "../../interfaces/decentraland/IDecentralandFacet.sol";
import "../../interfaces/decentraland/IDecentralandRegistry.sol";
import "../../libraries/LibOwnership.sol";
import "../../libraries/marketplace/LibRent.sol";
import "../../libraries/marketplace/LibDe... | Returns whether `spender` is allowed to consume `tokenId`. Requirements: - `tokenId` must exist./ | function isConsumerOf(address spender, uint256 tokenId)
internal
view
returns (bool)
{
return spender == consumerOf(tokenId);
}
| 224,323 |
./full_match/137/0x0E27c5B54F82c0eC851a499a619E179F4893D2d3/sources/contracts/MasterChefV2.sol | Withdraw LP tokens from MasterChefV2. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accHorusPerSha... | 4,672,197 |
./partial_match/1/0x089504de59277A3D085ad41F0d87E48581589d49/sources/MeebitsResolver.sol | Returns the address associated with an ENS node. node The ENS node to query. return The associated address./ | function addr(
bytes32 node
) public view virtual override returns (address payable) {
bytes memory a = addr(node, COIN_TYPE_ETH);
if (a.length == 0) {
return payable(0);
}
return bytesToAddress(a);
}
| 3,953,610 |
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// 'TestToken' token contract
//
// Deployed to : main net
// Symbol : L51TT
// Name : Lab51TestToken
// Total supply: 100000000
// Decimals : 18
//
//
//
// (c) 051 Labs
// -----------------------... | ------------------------------------------------------------------------ Total supply ------------------------------------------------------------------------ | function totalSupply() public constant returns (int) {
return _totalSupply - balances[address(0)];
}
| 13,529,851 |
pragma solidity ^0.5.9;
import "./DelightInterface.sol";
import "./DelightBase.sol";
import "./DelightInfoInterface.sol";
import "./DelightKnightItemInterface.sol";
import "./DelightBuildingManager.sol";
import "./DelightArmyManager.sol";
import "./DelightItemManager.sol";
import "./Util/SafeMath.sol";
contract Delig... | Gets the total damage of an army. μ 체 λ°λ―Έμ§λ₯Ό κ°μ Έμ΅λλ€. Calculates the total damage. μ΄ λ°λ―Έμ§λ₯Ό κ³μ°ν©λλ€. The number of units must be bigger than 0. μ λμ κ°μλ 0λ³΄λ€ μ»€μΌν©λλ€. Checks if the unit can reach the distance. μ΄λμ΄ κ°λ₯ν 거리μΈμ§ νμΈν©λλ€. Adds the total damage from the friendly army. μκ΅°μ λ°λ―Έμ§ μΆκ° If the unit's a knight, add the knight item's ... | function getTotalDamage(uint distance, uint[] memory armyIds, uint buildingBuffDamage) view public returns (uint totalDamage) {
(
,
,
uint knightItemId,
,
,
,
) = armyManager.getArmyInfo(armyIds[UNIT_KNIGHT]);
for (uint i = 0; i < UNIT_KIND_COUNT; i += 1) {
(
uint armyUnitK... | 12,739,325 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.7;
/*
ββββββ ββββββ ββ ββ βββ ββ ββββββ
ββ ββ ββ ββ ββ ββββ ββ ββ ββ
βββββββ ββ ββ ββ ββ ββ ββ ββ ββ ββ
ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ
βββββββ ββββββ ββββββ ββ ββββ ββββββ
*/
import {IERC2981Upgr... | returns the number of editions for this artist | function editionCount() external view returns (uint256) {
}
| 5,724,114 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;
// File: witnet-ethereum-bridge/contracts/Request.sol
/**
* @title The serialized form of a Witnet data request
*/
contract Request {
bytes public bytecode;
/**
* @dev A `Request` is constructed around a `bytes m... | Check if a request has been resolved by Witnet. Contracts depending on Witnet should not start their main business logic (e.g. receiving value from third. parties) before this method returns `true`. _id The unique identifier of a request that has been previously sent to the WitnetRequestBoard. return A boolean tellin... | function witnetCheckRequestResolved(uint256 _id) internal view returns (bool) {
return wrb.readDrTxHash(_id) != 0;
}
| 997,862 |
pragma solidity ^0.4.2;
/**
* @notice Declares a contract that can have an owner.
*/
contract OwnedI {
event LogOwnerChanged(address indexed previousOwner, address indexed newOwner);
function getOwner()
constant
returns (address);
function setOwner(address newOwner)
returns (boo... | Requesting a confirmation that a document is a certification is a paying feature./ | function isCertification(address student, bytes32 document)
payable
requestFeePaid
returns (bool isIndeed) {
isIndeed = studentCertifications[student].documentStatuses[document].isValid;
}
| 7,290,875 |
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 is the standard behavior in high le... | This function prepares the staking and bonus reward settings and it also provides liquidity to a freshly created uniswap pair./ | function activateStakesAndUniswapLiquidity() external {
require(_hasEnded[0] && _hasEnded[1] && _hasEnded[2],
"all rounds must have ended");
require(!_bonusOfferingActive,
"the bonus offering and uniswap paring can only be done once per ISO");
uint256[3] memory bonusSupplies = [... | 12,816,390 |
./full_match/80001/0xE56bB093Be2A9fa554c8693aA32068becCCfc97E/sources/contracts/pack-plugin/extension/PackVRFDirectLogic.sol | See {ERC1155-_beforeTokenTransfer}./ | function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
PackVRFDi... | 5,559,910 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
/// @notice Emitted when the result overflows uint256.
error PRBMath__MulDivFixedPointOverflow(uint256 prod1);
/// @notice Emitted when the result overflows uint256.
error PRBMath__MulDivOverflow(uint256 prod1, uint256 denominator);
/// @notice Emitted when ... | getNftPrice get quote for purchasing in current block, decaying price as needed return result uint256 current price in wei/ | function getNftPrice() public view returns (uint256 result) {
int256 pricePerNft = _getNftPrice();
result = uint256(pricePerNft.toInt());
}
| 13,810,343 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeabl... | Get user's vesting info | function getUserVestingInfo(address userAddr) public view returns (VestingInfo memory) {
UserInfo memory userInfo = userList[userAddr];
VestingInfo memory vestingInfo = vestingList[userInfo.vestingIndex];
return vestingInfo;
}
| 480,079 |
pragma solidity ^0.5.3;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARI... | this is here to make boilerplate test pass | function isAirline( address airlineAddress
)
isAuthorizedCaller
external
view
returns (bool)
{
Airline memory myAirline =airlines[airlineAddress];
bool out = false;
if(myAirline.isRegi... | 14,045,112 |
/* https://www.apache.org/licenses/LICENSE-2.0 */
pragma solidity ^0.4.20;
import "./Ibox9User.sol";
import "./Ibox9Admin.sol";
import "./Ibox9Any.sol";
import "./SafeMath.sol";
contract Box9 is Ibox9User, Ibox9Admin, Ibox9Any {
using SafeMath for uint256;
uint256 public firstSpin;
uint256 private cons... | checks if the jackpot is arranged (updated) or not callable by anyone _round the block height of jackpot round _tableId the table index return bool - true if arranged/ | function isJTableArranged(uint256 _round, uint256 _tableId)
external
view
returns (bool arranged)
{
Jackpot storage j = jackpotInfo[_round][_tableId];
return j.arranged;
}
| 1,060,677 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.