file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0x31047E7B7639bE5B3FE35FedE64E016D07c20b93/sources/FEIIMasterChef.sol | https:github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Factory.sol | interface IUniswapV2Factory {
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) external view returns (address pair);
... | 2,858,070 |
pragma solidity ^0.5.0;
contract MultiSig {
/*
*Constant determining the maximum number of wallet owners.
*/
uint constant public MAX_OWNER_COUNT = 3;
/*
* Events
*/
event Submission(uint indexed transactionId);
event Confirmation(address indexed sender, uint indexed transactionId);... | Adds a new transaction to the transaction mapping, if transaction does not exist yet. destination Transaction target address. value Transaction ether value. data Transaction data payload. return Returns transaction ID. | function addTransaction(address destination, uint value, bytes memory data)
internal
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data... | 15,803,275 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
import "./PodPut.sol";
import "../interfaces/IWETH.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "../lib/Conversion.sol";
/**
* @title WPodPut
* @author Pods Finance
*
* @notice Represents a tokenized Put option series for ETH. Inter... | Locks strike asset and write option tokens. The issued amount ratio is 1:1, i.e., 1 option token for 1 underlying token. It presumes the caller has already called IERC20.approve() on the strike token contract to move caller funds. This function is meant to be called by strike token holders wanting to write option toke... | function mint(uint256 amountOfOptions, address owner) external override tradeWindow {
require(amountOfOptions > 0, "PodPut: you can not mint zero options");
uint256 amountToTransfer = _strikeToTransfer(amountOfOptions);
_mintOptions(amountOfOptions, amountToTransfer, owner);
IERC20... | 527,938 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/proxy/Clones.sol";
import "../vaults/DAOVault.sol";
/// @title Contract to create standard vault
contract DAOVaultFactory is Ownable {
DAOVault[] public vaults;
address ... | Set network fee in percentage Details for network fee percentage can view at deposit() function above _networkFeePercentage An array of integer, view additional info below Requirements: - Only owner of this contract can call this function - Each of the element in the array must less than 3000 (30%)/ | function setNetworkFeePercentage(uint256[] calldata _networkFeePercentage)
external
onlyOwner
{
require(
_networkFeePercentage[0] < 3000 &&
_networkFeePercentage[1] < 3000 &&
_networkFeePercentage[2] < 3000,
"Network fee percentage ... | 1,537,991 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that ... | Returns the number of vesting schedules managed by this contract. return the number of vesting schedules/ | function getVestingSchedulesCount() public view virtual returns (uint256) {
return vestingSchedulesIds.length;
}
| 260,630 |
pragma solidity ^0.4.21;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the ... | Function to check reserved amount of tokens for address. _buyer Address of buyer of the tokens. return The uint256 specifing the amount of tokens which are held in reserve for this address./ | function collectedEtherFrom(address _buyer) public view returns (uint256) {
return reserved[_buyer].collectedEther;
}
| 1,065,258 |
./full_match/43113/0x2DD99fc069CFd7fcAC30f33D52D795A257B24520/sources/tortuga.sol | this method is responsible for taking all fee, if takeFee is true | function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
_transferToExcluded(sen... | 7,122,640 |
./full_match/80001/0x403430749eaDb5ab6177847Bbcdfe1f66A202B26/sources/project_/contracts/polygon/UniV3Automan.sol | Find current amount of the two tokens in the liquidity position. | function getLiquidityAmounts(
uint256 positionId
) internal view returns (uint128, uint256, uint256) {
(
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
,
... | 5,698,127 |
./partial_match/42/0xFFab53b419d6a99d69AEf25b895F6281469135DA/sources/ContractB.sol | withdraw released multiplier balance. ---------------------------------------- amount --> the amount to be withdrawn. ------------------------------------------- returns whether successfully withdrawn or not./ | function withdraw(uint256 amount) external returns (bool) {
require(amount > 0, "amount must be larger than zero");
require(getMultiplierBalance(msg.sender) >= amount, "must have a sufficient balance");
require(checkForReleasedBalance(now, msg.sender), "balance must be rele... | 3,321,103 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
/**
* @title Contract for setting abilities.
* @dev For optimization purposes the abilities are represented as a bitfield. Maximum number of
* abilities is therefore 256. This is an example(for simplicity is made for max 8 abilities) of how
* this works.
* 0... | Check if an address has a specific ability. Throws if checking for 0. _target Address for which we want to check if it has a specific abilities. _abilities Number representing bitfield of abilities we are checking./ | function isAble(
address _target,
uint256 _abilities
)
external
view
returns (bool)
{
require(_abilities > 0, INVALID_INPUT);
return (addressToAbility[_target] & _abilities) == _abilities;
}
| 7,290,612 |
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | start the program. | function start() public {
require(msg.sender == owner);
require(depositStartTime == 0);
depositStartTime = now;
depositStopTime = depositStartTime + DEPOSIT_PERIOD;
Started(depositStartTime);
}
| 15,133,758 |
./full_match/421611/0x0D75D46640ED2A50CbC0B59122C029edFddaB651/sources/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/ERC721min.sol | See {IERC721-balanceOf}./ | function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return owner == _owner ? 1 : 0;
}
| 13,221,597 |
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath`... | Override supportsInterface - See {IERC165-supportsInterface} | function supportsInterface(bytes4 _interfaceId)
public
view
virtual
override(ERC721)
returns (bool)
{
return super.supportsInterface(_interfaceId);
}
| 5,958,841 |
./full_match/5/0x8339b06c37d488d51aB838f6C758D61ddb1F1C6c/sources/contracts/facets/DiamondLoupeFacet.sol | This implements ERC-165. | function supportsInterface(
bytes4 _interfaceId
) external view override returns (bool) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
return ds.supportedInterfaces[_interfaceId];
}
| 1,954,766 |
./full_match/100/0x12C887Bd45aC9BA38403D67621669FD751DAA612/sources/contracts/incentives/DistributionManager.sol | Configure the assets for a specific emission assetsConfigInput The array of each asset configuration/ | function _configureAssets(DistributionTypes.AssetConfigInput[] memory assetsConfigInput)
internal
{
for (uint256 i = 0; i < assetsConfigInput.length; i++) {
AssetData storage assetConfig = assets[assetsConfigInput[i].underlyingAsset];
_updateAssetStateInternal(
assetsConfigInput[i].unde... | 14,272,540 |
./full_match/5/0xc706708558BD603c34563568477F80eeba8Dd15f/sources/src/IAuthorizeMints.sol | IAuthorizeMints molecule.to a flexible interface to gate token mint calls on another contract, built for IP-NFTs | interface IAuthorizeMints {
function authorizeMint(address minter, address to, bytes memory data) external view returns (bool);
function authorizeReservation(address reserver) external view returns (bool);
function redeem(bytes memory data) external;
pragma solidity ^0.8.17;
}
| 1,922,718 |
pragma solidity ^0.4.23;
import "./ERC735.sol";
/**
* @title Self sovereign Identity
* @author Ricardo Guilherme Schmidt (Status Research & Development GmbH)
*/
contract ClaimableIdentity is ERC735 {
mapping (bytes32 => Claim) claims; //used for quering by other contracts
mapping (uint256 => bytes32[]) c... | Get claims list by defined topic _topic topic to select return array of claimhashes/ | function getClaimIdsByTopic(uint256 _topic)
public
view
returns(bytes32[] claimHash)
{
return claimsByType[_topic];
}
| 1,001,556 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "@openzeppelin/contracts-upgradeable/GSN/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721MetadataUpgradeable.sol";
import "@openzepp... | Allows anyone to transfer all given tokens in a Loot Box to the associated ERC721 owner. A Loot Box contract will be counterfactually created, tokens transferred to the ERC721 owner, then destroyed. erc721 The address of the ERC721 tokenId The ERC721 token id erc20s An array of ERC20 tokens whose entire balance sho... | function plunder(
address erc721,
uint256 tokenId,
IERC20Upgradeable[] calldata erc20s,
LootBox.WithdrawERC721[] calldata erc721s,
LootBox.WithdrawERC1155[] calldata erc1155s
) external {
address payable owner = payable(IERC721Upgradeable(erc721).ownerOf(tokenId));
LootBox lootBox = _cre... | 1,694,947 |
./full_match/8453/0x0c9034b92351cF8f067379a1fFA4fa35f5AF9dCC/sources/lib/optimism/packages/contracts-bedrock/src/libraries/rlp/RLPWriter.sol | Encode the first byte and then the `len` in binary form if `length` is more than 55. _len The length of the string or the payload. _offset 128 if item is string, 192 if item is list. return out_ RLP encoded bytes. | function _writeLength(uint256 _len, uint256 _offset) private pure returns (bytes memory out_) {
if (_len < 56) {
out_ = new bytes(1);
out_[0] = bytes1(uint8(_len) + uint8(_offset));
uint256 lenLen;
uint256 i = 1;
while (_len / i != 0) {
... | 11,538,372 |
./partial_match/1/0xCbBfC2Ce0c227fB40295954Caf01B7345EDb1248/sources/CryptojoyTokenSeller.sol | Divides two numbers and returns the remainder (unsigned integer modulo), reverts when dividing by zero./ | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0,"");
return a % b;
}
| 3,582,292 |
./full_match/80001/0xE4fcb71B67B63Fd2f500cfeb01b5bE661be9a334/sources/_thirdweb-dev/contracts/extension/Staking1155.sol | Set rewards per unit of time. Interpreted as x rewards per second/per day/etc based on time-unit. Only admin/authorized-account can call it. _tokenId ERC1155 token Id. _rewardsPerUnitTime New rewards per unit time./ | function setRewardsPerUnitTime(uint256 _tokenId, uint256 _rewardsPerUnitTime) external virtual {
if (!_canSetStakeConditions()) {
revert("Not authorized");
}
uint256 _nextConditionId = nextConditionId[_tokenId];
StakingCondition memory condition = _nextConditionId == 0
... | 842,098 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/cont... | Redeems autoBTCv2+ to BTCB. _amount Amount of autoTCBv2+ to redeem./ | function redeemAutoBTCV2Plus(uint256 _amount) public {
require(_amount > 0, "zero amount");
IERC20Upgradeable(AUTO_BTC_V2_PLUS).safeTransferFrom(msg.sender, address(this), _amount);
ISinglePlus(AUTO_BTC_V2_PLUS).redeem(_amount);
uint256 _autoBtcV2 = IERC20Upgradeable(AUTO_BTC_V2).b... | 5,536,497 |
./partial_match/3/0x178b33308d98D4FF91a4d06972E616335CB2895A/sources/Nexon.sol | Function to set Referral amount referralAmount Amount rewarded per referral/ | function setReferralAmount(uint256 referralAmount) public onlyOwner returns(bool){
require(referralAmount > 0, "Invalid Amount");
_referralAmount = referralAmount;
return true;
}
| 5,082,001 |
pragma solidity 0.5.17;
import "./TreasuryBase.sol";
/**
* @author Quant Network
* @title This contract holds a specific treasury's information
*/
contract Treasury is TreasuryBase {
// The addresses variables in the speed bump
bytes constant private speedBumpAddresses1 = '1.speedBump.addresses';
... | Reads the time the speedBump was created at index - the speed bump to read return - the creation time/ | function speedBumpTimeCreated(uint8 index) public view returns (uint256){
return uint256Storage[keccak256(abi.encodePacked(speedBumpTimeCreated1,index))];
}
| 12,557,733 |
pragma solidity ^0.5.16;
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// Inher... | Views function withdrawableETH(uint256 amount) external view returns (uint256); Mutative | interface IGasMining {
function rewardPerToken() external view returns (uint256);
function earned(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
function totalFundETH() external view returns (uint256);
function balanceOf(address accoun... | 5,380,791 |
/**
*Submitted for verification at Etherscan.io on 2022-03-18
*/
/**
ApePredator
max buy?
1% of token supply
max wallet?
4% at launch
Buy and sell tax?
Buys - 13%
Sells - 13%
What's the tokenomics?
⁃ 5% marketing
⁃ 3% liquidity
⁃ 5% buyback
Tg: https://t.me/apepredatorETH
Website: https://apepredator.com/
... | approve token transfer to cover all possible scenarios add the liquidity | function addLiquidity(uint256 tokenAmount, uint256 ETHAmount) private {
_approve(address(this), address(router), tokenAmount);
address(this),
tokenAmount,
owner(),
block.timestamp
);
router.addLiquidityETH{value: ETHAmount}(
}
| 10,848,332 |
pragma solidity 0.6.10;
pragma experimental ABIEncoderV2;
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a... | solhint-disable-next-line no-empty-blocks | function tokensReceived(
address operator,
address from,
address to,
uint256 amount,
bytes calldata userData,
bytes calldata operatorData
)
external override
allow("SkaleToken")
{
}
| 7,363,775 |
pragma solidity ^0.5.16;
import "../interfaces/IBlockRewardHbbft.sol";
import "../interfaces/IStakingHbbft.sol";
import "../interfaces/IValidatorSetHbbft.sol";
import "../upgradeability/UpgradeableOwned.sol";
import "../libs/SafeMath.sol";
/// @dev Implements staking and withdrawal logic.
contract StakingHbbftBase i... | Removes a specified pool from the `pools` array (a list of active pools which can be retrieved by the `getPools` getter). Called by the `ValidatorSetHbbft._removeMaliciousValidator` internal function, and the `ValidatorSetHbbft.handleFailedKeyGeneration` function when a pool must be removed by the algorithm. _stakingA... | function removePool(address _stakingAddress)
external
onlyValidatorSetContract {
_removePool(_stakingAddress);
}
| 927,100 |
./full_match/4/0x4324c28E44D3e5afC1B6AB93aBF7ABebDE570600/sources/contracts/templates/NFTCollection.sol | Validate a runtime configuration change Can't set royalties to more than 100% If metadata is updatable, we don't have any other limitations If it isn't, has we can't allow the flag to change anymore We also can't allow base URI to change | function _validateRuntimeConfig(RuntimeConfig calldata config)
internal
view
{
require(config.royaltiesBps <= ROYALTIES_BASIS, "Royalties too high");
if (_runtimeConfig.metadataUpdatable) return;
require(
_runtimeConfig.metadataUpdatable == config.metadataUp... | 12,409,353 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "./library/AddressResolverUpgradeable.sol";
import "./library/SafeDecimalMath.sol";
import "./interfac... | Record vesting entry for claiming address and amount DOWS already minted to rewardEscrow balance | function _payRewards(address account, uint256 dowsAmount)
internal
notFeeAddress(account)
{
require(account != address(0), "Account can't be 0");
require(account != address(this), "Can't send rewards to fee pool");
require(account != address(synthesizer()), "Can't send re... | 12,644,038 |
pragma solidity ^0.5.0;
contract AssemblyReturnGetter {
bytes public someStorage;
constructor(bytes memory _someParameter) public {
someStorage = _someParameter;
}
function update(bytes memory _someParameter) public returns (bytes memory) {
bytes memory temp = someStorage;
someStorage = _somePara... | this getter uses inline assembly to return a NON-ABI-encoded byte array, so it's easier to work with on the recieving end (assembly). | function get() public view returns (bytes32) {
bytes32 valToReturn;
for (uint i = 0; i < someStorage.length; i++) {
valToReturn |= bytes32(someStorage[i] & 0xFF) >> (i * 8);
}
return valToReturn;
}
| 5,450,609 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol';
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.... | borrow WETH, unwraps to ETH and send both the ETH and DebtTokens to msg.sender, via `approveDelegation` and onBehalf argument in `LendingPool.borrow`. lendingPool address of the targeted underlying lending pool amount the amount of ETH to borrow interesRateMode the interest rate mode referralCode integrators are as... | function borrowETH(
address lendingPool,
uint256 amount,
uint256 interesRateMode,
uint16 referralCode
) external override {
ILendingPool(lendingPool).borrow(
address(WETH),
amount,
interesRateMode,
referralCode,
msg.sender
);
WETH.withdraw(amount);
_safe... | 68,475 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
interface CErc20 {
function UNDERLYING470() external view returns (address); //inject NONSTANDARD NAMING
}
interface ERC20 {
function BALANCEOF407(... | inject NONSTANDARD NAMING | function GETTOKENCONFIGBYSYMBOL273(string memory symbol) public view returns (TokenConfig memory) { | 12,566,003 |
./partial_match/1/0x19eeB727d0dE9c798a5Be60c0D5f6dC59B24aEF0/sources/ArbitrageMainnet.sol | Internal function to withdraw WETH from the DutchX, convert it to Ether and keep it in contract amount The amount of WETH to withdraw and convert. | function _withdrawEther(uint amount) internal {
address weth = dutchXProxy.ethToken();
dutchXProxy.withdraw(weth, amount);
ITokenMinimal(weth).withdraw(amount);
}
| 10,999,252 |
./full_match/62320/0x4B621443c1c749ef5252e8AEE158A52B5eCe304A/sources/lib/mento-core/contracts/StableToken.sol | Decrease the allowance of another user. spender The address which is being approved to spend StableToken. value The decrement of the amount of StableToken approved to the spender. return True if the transaction succeeds./ | function decreaseAllowance(address spender, uint256 value) external updateInflationFactor returns (bool) {
uint256 oldValue = allowed[msg.sender][spender];
uint256 newValue = oldValue.sub(value);
allowed[msg.sender][spender] = newValue;
emit Approval(msg.sender, spender, newValue);
return true;
... | 3,224,901 |
./full_match/1/0x980C680a90631c8Ea49fA37B47AbC3154219EC1a/sources/contracts/EthenaMinting.sol | transfer supported asset to array of custody addresses per defined ratio cannot mint using unsupported asset or native ETH even if it is supported for redemptions | function _transferCollateral(
uint256 amount,
address asset,
address benefactor,
address[] calldata addresses,
uint256[] calldata ratios
) internal {
if (!_supportedAssets.contains(asset) || asset == NATIVE_TOKEN) revert UnsupportedAsset();
IERC20 token = IERC20(asset);
uint256 total... | 17,057,168 |
// SPDX-License-Identifier: Apache License, Version 2.0
pragma solidity 0.6.10;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract ZeroExExchangeProxyMock {
// Originally I also wanted to test Custom error handling,
// but refrained from doing so, since the necessary upgrade o... | Method mocking the UniswapFeature of the zeroEx setup in tests Returns the `minBuyAmount` of target token to the caller, which needs to be deposited into this contract beforehand Original Implementation: https:github.com/0xProject/protocol/blob/development/contracts/zero-ex/contracts/src/features/UniswapFeature.solL99 | function sellToUniswap(
IERC20[] calldata tokens,
uint256 sellAmount,
uint256 minBuyAmount,
)
external
payable
returns (uint256 buyAmount)
{
require(tokens.length > 1, "UniswapFeature/InvalidTokensLength");
IERC20 sellToken = tokens[0];
... | 6,349,699 |
./partial_match/1/0x7e321AF42c7e4C9DEa7E6FFC14862cBee1980C29/sources/contracts/core/Twav/Twav.sol | returns the TWAV of the last 4 blocks return _twav TWAV of the last 4 blocks | function _getTwav() internal view returns(uint256 _twav){
if (twavObservations[TWAV_BLOCK_NUMBERS - 1].cumulativeValuation != 0) {
uint8 _index = ((twavObservationsIndex + TWAV_BLOCK_NUMBERS) - 1) % TWAV_BLOCK_NUMBERS;
TwavObservation memory _twavObservationCurrent = twavObservations... | 2,877,463 |
./full_match/1/0xfD2cCc920d498db30FBE9c13D5705aE2C72670F9/sources/contracts/savings/Savings.sol | Updates the maximum rate settable | function setMaxRate(uint256 newMaxRate) external onlyGovernor {
maxRate = newMaxRate;
emit MaxRateUpdated(newMaxRate);
}
| 8,497,529 |
// SPDX-License-Identifier: GPL-3.0-only
/**
ASpace Apes (ASA) is an exclusive collection of 5,050 NFTs that govern the Aspace decentralized social network, provide travel perks & real-life rewards,
and produce $AETH for holders in the Aspace Ecosystem.
Created by the Aspace Development Team. Welcome to th... | OnlyOwner functions / | function reveal() public onlyOwner() {
revealed = true;
}
| 6,862,979 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@ubeswap/governance/contracts/interfaces/IHasVotes.sol";
import "./RomulusInterfaces.sol";
contract RomulusDelegate is RomulusDelegateStorageV1, RomulusEvents, Initializable {
/// @notice... | Admin function for setting the voting delay newVotingDelay new voting delay, in blocks/ | function _setVotingDelay(uint256 newVotingDelay) external adminOnly {
require(
newVotingDelay >= MIN_VOTING_DELAY && newVotingDelay <= MAX_VOTING_DELAY,
"Romulus::_setVotingDelay: invalid voting delay"
);
uint256 oldVotingDelay = votingDelay;
votingDelay = newVotingDelay;
emit VotingD... | 911,130 |
pragma solidity 0.6.12;
//----------------------------------------------------------------------------------
// I n s t a n t
//
// .:mmm. .:mmm:. .ii. .:SSSSSSSSSSSSS. .oOOOOOOOOOOOo.
// .mMM'':Mm. .:MM'':Mm:. .II: :SSs.......... .oOO'''''''''''OOo.
// .:Mm' ':Mm.... | Get the total number of escrows in the factory. return Escrow count./ | function numberOfTokens() external view returns (uint256) {
return escrows.length;
}
| 5,537,838 |
pragma solidity >= 0.6.2 < 0.7.0;
import "./Owned.sol";
//代币的控制合约
contract Controlled is Owned {
//账户集合
mapping(address =>uint256) public balanceOf;
//持币地址 list
mapping(uint256 =>address) public addrList;
//addrlist 大小
uint256 addrListLength = 1;
//address 是否是否存在list里 true=in,false=not in
... | 设置社区管理vip用户 ,true代表是vip | function setCommunityLeaders(address _addr, bool _enable) public onlyOwner returns(bool success) {
communityLeaders[_addr] = _enable;
return true;
}
| 12,978,227 |
./full_match/1/0x7b913e5a2F4CC0625c88615ef532a8d5690B8C96/sources/contracts/EmblemVault.sol | A distinct URI (RFC 3986) for a given NFT. _tokenId Id for which we want uri. return URI of _tokenId./ | function tokenPayload(
uint256 _tokenId
)
external
view
validNFToken(_tokenId)
returns (string memory)
{
return idToPayload[_tokenId];
}
| 2,920,055 |
./partial_match/137/0x52f9f4760691754CF80AeAba91992787Dc43ac8b/sources/DeFatToken.sol | ------------------------------------------------------------------------ Total supply ------------------------------------------------------------------------ | function totalSupply() public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
| 3,511,359 |
./full_match/80001/0xe78D2f06d7Ad0cDC884D7DDB65e4BCEdbD212298/sources/_solidstate/contracts/token/ERC20/base/ERC20Base.sol | @inheritdoc IERC20/ | function totalSupply() external view returns (uint256) {
return _totalSupply();
}
| 9,525,846 |
./partial_match/1/0xC94BEd0F0bbCd0fb12b98c829B63a892F4d57976/sources/CryptoFish.sol | Standard Withdraw function for the owner to pull the contract | function withdraw() external onlyOwner {
uint256 sendAmount = address(this).balance;
address PT1 = payable(0xB55f2682aF328743FaFedeaa2252AF4BdCD749fD);
address PT2 = payable(0x8d4dAbA34C92E581F928fCA40e018382f7A0282a);
address TRNT = payable(0xb3a05B0feCC927e32ab448415C7D0EF... | 9,273,620 |
pragma solidity ^0.4.22;
// File: contracts/ERC223/ERC223_receiving_contract.sol
/**
* @title Contract that will work with ERC223 tokens.
*/
contract ERC223ReceivingContract {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender ... | finalization task, called when owner calls finalize()/ | function finalization() internal {
require(isMinimumGoalReached());
SafeGuardsToken(token).mint(w_futureDevelopment, tokensSold.mul(20).div(43));
SafeGuardsToken(token).mint(w_Reserv, tokensSold.mul(20).div(43));
SafeGuardsToken(token).mint(w_Founders, tokensSold.mul(7).div(43));
... | 7,316,945 |
./full_match/5/0x32e28ac9F548A845C2E62EFA4F32ee6ecB257F4D/sources/contracts/smart-wallet/dynamic/TWDynamicAccount.sol | See {IERC165-supportsInterface}. | function supportsInterface(bytes4 interfaceId) public view virtual override(TWAccount, BaseRouter) returns (bool) {
return
interfaceId == type(IBaseRouter).interfaceId ||
interfaceId == type(IRouter).interfaceId ||
interfaceId == type(IERC1155Receiver).interfaceId ||
... | 7,085,677 |
./partial_match/1/0xE1C110E1B1b4A1deD0cAf3E42BfBdbB7b5d7cE1C/sources/Elk.sol | Creates `amount` new tokens for `to`. See {ERC20-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./ | function mint(address to, uint256 amount) public virtual {
require(hasRole(MINTER_ROLE, _msgSender()), "Elk: must have minter role to mint");
_mint(to, amount);
}
| 4,073,350 |
./full_match/5/0x59C9CEE1B88D80ad04630400175E02d1B170ccC2/sources/contracts/ERC721SignOnly.sol | Returns whether operator restriction can be set in the given execution context. | function _canSetOperatorRestriction()
internal
virtual
override
returns (bool)
{
return msg.sender == owner();
}
| 1,886,267 |
./full_match/3/0x199B3D43f2f1F363087f0F66c64f5B406A3dDf2c/sources/browser/Habit.sol | Withdraw burned wei/ | function withdraw() public isOwner {
uint amount = burned;
burned = 0;
msg.sender.transfer(amount);
}
| 14,193,636 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "../erc20/IERC20.sol";
import "../anchor/ISynth.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Acc... | This function is what other Synth pools will call to burn Gr | function pool_burn_from(address b_address, uint256 b_amount) external onlyPools {
if(trackingVotes){
trackVotes(b_address, address(this), uint96(b_amount));
uint32 srcRepNum = numCheckpoints[address(this)];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[address(this)][src... | 15,824,163 |
/* ===============================================
* Flattened with Solidifier by Coinage
*
* https://solidifier.coina.ge
* ===============================================
*/
/*
-----------------------------------------------------------------
FILE INFORMATION
--------------------------------------------------------... | Set the Synth contract that the issuance controller uses to issue Synths. _synth The new synth contract target/ | function setSynth(Synth _synth)
external
onlyOwner
{
synth = _synth;
emit SynthUpdated(_synth);
}
| 6,351,570 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
interface Entropy {
function returnValue() external view returns(bytes32);
function ... | save gas here if you need to change up the pool often without need of growing it | function replaceModule(bytes calldata code, address target) external {
removeModule(target);
deployModule(code);
}
| 5,384,445 |
./partial_match/42/0x7C402b08a6ab7D9e4787C68ab90c323A4F629Fe0/sources/RewardDecayAggregator.sol | setup aggregator contract (RewardDecayAggregator) which allow to claim FL tokens from hirisk & lowrisk contracts in one tx/ | function setupAggregator(address _aggregator) public {
require(deployer == msg.sender);
require(_aggregator != address(0));
aggregator = _aggregator;
}
| 8,962,536 |
./full_match/1/0x46C1BFAe04c19aA6b114A0FC3Ef78d19C9256763/sources/contracts/LiquidityBootstrapAuction.sol | Calculate claimable LP amount based on deposited token amount recipient Wallet address to calculate for return Claimable LP amount/ | function claimableLPAmount(address recipient) public view returns (uint256) {
if (currentTime() < lpTokenReleaseTime()) {
return 0;
}
uint256 claimableLPTokensForUSDC = (lpTokenAmount * depositedUSDC[recipient]) / (2 * totalDepositedUSDC);
uint256 total = claimableLPToken... | 8,290,327 |
./full_match/1/0x2fC246149B4B8d7bcEF6188A10AF1791380227f1/sources/src/Estate/EstateBaseToken.sol | Optimized version where the whole list is in memory transfer all lands from a burnt estate sender previous owner of the burnt estate estateId estate id to address that will receive the lands | function transferAllFromDestroyedEstate(
address sender,
uint256 estateId,
address to
) public {
require(to != address(0), "DESTINATION_ZERO_ADDRESS");
require(to != address(this), "DESTINATION_ESTATE_CONTRACT");
_check_withdrawal_authorized(sender, estateId);
... | 8,434,839 |
// SPDX-License-Identifier: MIT
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in ... | 1e6 1e6 Rate is in 1e6 | function viewRawAmountLPRatio(
uint256 _baseWeight,
uint256 _quoteWeight,
address _addr,
int128 _amount
) external view override returns (uint256 amount_) {
uint256 _xsgdBal = xsgd.balanceOf(_addr);
if (_xsgdBal <= 0) return 0;
_xsgdBal = _xsgdBal.mul(1e... | 10,049,912 |
./partial_match/1/0x21debd25F3eac765582a703a134afEA1BEbE80e6/sources/CivVaultGetter.sol | Get Withdraw Pending Users Length on a given pool _pid Pool Id return users Current Withdraw Pending Users Length in a given pool | function getWithdrawUsers(uint256 _pid) external view returns(uint256) {
(,VaultInfo memory vaultInfo)=civVault.getPoolInfo(_pid);
return vaultInfo.curWithdrawUser;
}
| 15,933,763 |
/**
*Submitted for verification at Etherscan.io on 2021-09-22
*/
// Sources flattened with hardhat v2.4.1 https://hardhat.org
// File contracts/solidity/eligibility/UniqueEligibility.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract UniqueEligibility {
mapping(uint256 => uint256) eligibleBi... | Save the cached word. Cache the new one. | function _setUniqueEligibilities(
uint256[] memory tokenIds,
bool _isEligible
) internal virtual {
uint256 cachedWord = eligibleBitMap[0];
uint256 cachedIndex = 0;
for (uint256 i = 0; i < tokenIds.length; i++) {
uint256 tokenId = tokenIds[i];
uint2... | 8,009,370 |
./partial_match/1/0x3a23F943181408EAC424116Af7b7790c94Cb97a5/sources/src/bridges/optimism/l1/NativeOptimism.sol | function to handle native balance bridging to receipent via NativeOptimism-Bridge This method is payable because the caller is doing token transfer and briding operation receiverAddress address of receiver of bridged tokens customBridgeAddress OptimismBridge that Performs the logic for deposits by informing the L2 D... | function bridgeNativeTo(
address receiverAddress,
address customBridgeAddress,
uint32 l2Gas,
uint256 amount,
bytes32 metadata,
bytes calldata data
) external payable {
receiverAddress,
l2Gas,
data
);
emit Socket... | 11,003,320 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./GatewayToken.sol";
import "./interfaces/IGatewayToken.sol";
import "./interfaces/IGatewayTokenController.sol";
/**
* @dev Gateway Token Controller contract is responsible for managing I... | Checks if specified `user` blacklisted completely. If user blacklisted gateway token clients not able to verify identity, and gatekeepers have to burn tokens owned by blacklisted users. user Address to check./ | function isBlacklisted(address user) public view override returns (bool) {
return _isBlacklisted[user];
}
| 6,457,190 |
./full_match/10/0x1D43Ec3C76786C3eF4f486044c6e4EeCC77a5cA4/sources/contracts/LzApp.sol | --------------------------- VIEW FUNCTION ---------------------------------------- | function isTrustedRemote(
uint16 _srcChainId,
bytes calldata _srcAddress
) external view returns (bool) {
bytes memory trustedSource = trustedRemoteLookup[_srcChainId];
return keccak256(trustedSource) == keccak256(_srcAddress);
}
| 3,778,046 |
./partial_match/1/0xe35aC90D3BD1009977c989F3eb0c0d3E9F171817/sources/contracts/core/DaoRegistry.sol | memberAddr The member address to look up return The delegate key address for memberAddr at the second last checkpoint number/ | function getPreviousDelegateKey(address memberAddr)
external
view
returns (address)
{
uint32 nCheckpoints = _numCheckpoints[memberAddr];
return
nCheckpoints > 1
? _checkpoints[memberAddr][nCheckpoints - 2].delegateKey
: memberAd... | 15,956,535 |
pragma solidity ^0.5.6;
/// @title ERC223Receiver ensures we are ERC223 compatible
/// @author Christopher Scott
contract ERC223Receiver {
bytes4 public constant ERC223_ID = 0xc0ee0b8a;
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
/// @notice tokenFallback is called from an ERC223... | tokenFallback is called from an ERC223 compatible contract _from the address from which the token was sent _value the amount of tokens sent _data the data sent with the transaction | function tokenFallback(address _from, uint _value, bytes memory _data) public pure {
_from;
_value;
_data;
}
| 12,646,504 |
./full_match/137/0x43011BDDD86C6e0C120dD1D3686073d15ed8b5A9/sources/contracts/Flashloan.sol | Note: Realize your own logic using the token from flashLoan pool.Return funds | function _flashLoanCallBack(address sender, uint256, uint256, bytes calldata data) internal {
(address flashLoanPool, address loanToken, uint256 loanAmount) = abi.decode(data, (address, address, uint256));
require(sender == address(this) && msg.sender == flashLoanPool, "HANDLE_FLASH_NENIED"... | 3,751,218 |
./full_match/84531/0x6fd6944DaA5714e156Baa48ae877e4bF97AAc86a/sources/project_/contracts/interfaces/IExecutionPermissions.sol | Describe public storage getter functions See {IExecutionPermissions} | interface IExecutionPermissions_Variables {
function permissions(
address ref,
bytes4 target,
address caller
) external view returns (bool);
function registered(address ref) external view returns (bool);
function owner() external view returns (address);
function nominated_... | 14,293,448 |
// SPDX-License-Identifier: BUSL-1.1
// For further clarification please see https://license.premia.legal
pragma solidity ^0.8.0;
import {ERC165} from "@solidstate/contracts/introspection/ERC165.sol";
import {ERC1155Enumerable} from "@solidstate/contracts/token/ERC1155/enumerable/ERC1155Enumerable.sol";
import {IERC2... | query total minted supply of given token id token id to query return token supply/ | function _totalSupply(uint256 id) internal view virtual returns (uint256) {
return ERC1155EnumerableStorage.layout().totalSupply[id];
}
| 596,920 |
./full_match/80001/0xFF36c08C58f4a931ef7a457c001470d0B8847125/sources/contracts/IPV2.sol | `SignatureMint1155` is an ERC 1155 contract. It lets anyone mint NFTs by producing a mint request and a signature (produced by an account with MINTER_ROLE, signing the mint request)./ | interface IMintableERC1155 {
event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri, uint256 quantityMinted);
function mintTo(
address to,
uint256 tokenId,
string calldata uri,
uint256 amount
) external;
}
| 5,552,076 |
./full_match/3/0xcd8b28F7ED4f291bC69435dE1c8bcC39877F96F0/sources/home/jenja/NFT_ERC-721/contracts/STBU_Token.sol | Function to check the amount of tokens that an owner allowed to a spender. _owner address The address which owns the funds. _spender address The address which will spend the funds. return A uint256 specifying the amount of tokens still available for the spender./ | function allowance(address _owner, address _spender) public override view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
| 8,268,696 |
/*
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░█████░░░░░░░░█████░░░░░░░███░░░░░█████░░░░░██░░░░░░░░█████░░░░░░░█████░░░░░
░░░██░░░░░███░░███░░░░░██░░░██░░░░░███░░░░░██░░░░░███░░███░░░░░██░░░██░░░░░███░░
░░░░░███░░░░░██░░░░░███░░░░░░░█████░░░░░░░░░░█████░░░░░░░░██░░░░░█... | Gets the TokenURI for a specified OKPC given params tokenId The tokenId of the OKPC | function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
uint256 artId = _okpc.activeArtForOKPC(tokenId);
bool useOffChainRenderer = _okpc.useOffchainMetadata(tokenId);
uint256 clockSpeed = _okpc.clockSpeed(tokenId);
uint256 artCollected = _okpc.artCountForOK... | 11,795,958 |
./full_match/3/0xFD3D4F48739851FA271731A28f2f4E8f98EC21B0/sources/contracts/Voxibuddies.sol | Reserved for people who helped this project and giveaways | function reserveGiveaway(uint256 numChubbies) public onlyOwner {
uint currentSupply = totalSupply();
require(totalSupply().add(numChubbies) <= 30, "Exceeded giveaway supply");
require(hasSaleStarted == false, "Sale has already started");
uint256 index;
for (index = 0; index <... | 8,202,537 |
pragma ton-solidity >= 0.45.0;
pragma AbiHeader expire;
pragma AbiHeader pubkey;
pragma AbiHeader time;
import "./DEXConnector.sol";
import "./interfaces/IRootTokenContract.sol";
import "./interfaces/ITONTokenWallet.sol";
import "./interfaces/ITokensReceivedCallback.sol";
import "./interfaces/IDEXConnector.sol";
impor... | Function to provide liquidity to DEXpair. | function processLiquidity(address pairAddr, uint128 qtyA, uint128 qtyB) public view checkOwnerAndAccept returns (bool processLiquidityStatus) {
processLiquidityStatus = false;
if (isReadyToProvide(pairAddr)) {
Pair cp = pairs[pairAddr];
address connectorA = rootConnector[cp.rootA];
address c... | 13,128,132 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./interfaces/IMinterDetailed.sol";
contract MinterGuard is Ownable {
using SafeMath for uint256;
IMinterDetailed public minter;
uint256 publ... | Set Bonus period on Minter. This can't be used after lockup period. _bonusMultiplier New bonusMultiplier _bonusEndBlock The block that this bonus will be ended _bonusLockRatio The numerator of the lockup ratio | function setBonus(uint256 _bonusMultiplier, uint256 _bonusEndBlock, uint256 _bonusLockRatio) external onlyOwner {
minter.setBonus(_bonusMultiplier, _bonusEndBlock, _bonusLockRatio);
emit SetBonus(_bonusMultiplier, _bonusEndBlock, _bonusLockRatio);
}
| 6,407,323 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppeli... | Sets up the distribution parameters for White Rabbit (WRAB) tokens. - We will create fractionalized NFT basket first, which will represent the finished film NFT - Tokens will be stored on platform and distributed to artists and producers as the film progresses - Artist distribution happens when new episodes are uploa... | function startWhiteRabbitShowWithParams(
address tokenAddress,
address artist1Address,
address artist2Address,
uint256 numberOfEpisodes,
uint256 producersAllocationPercentage,
uint256 artistAllocationPercentage,
uint256 teamAllocationPercentage
) external ... | 1,528,206 |
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a ... | Total quantity of above filled as a result of all trade executions, including this one Market orders can express quantity in quote terms, and can be partially filled by multiple limit maker orders necessitating tracking partially filled amounts in quote terms to determine completion All other orders track partially fil... | function updateOrderFilledQuantity(
Structs.Order memory order,
bytes32 orderHash,
Structs.Trade memory trade
) private {
require(!_completedOrderHashes[orderHash], 'Order double filled');
uint64 newFilledQuantityInPips;
if (order.isQuantityInQuote) {
require(
... | 7,513,369 |
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import '@openzeppelin/contracts/interfaces/IERC721.sol';
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./AnonymiceLibrary.sol";
import "./Origi... | Returns the SVG and metadata for a token Id _tokenId The tokenId to return the SVG and metadata for./ | function tokenURI(uint256 _tokenId)
public
view
override
returns (string memory)
{
require(_exists(_tokenId));
string memory tokenHash = _tokenIdToHash(_tokenId);
return
string(
abi.encodePacked(
"data:application/json;base64,",
... | 14,342,354 |
// pragma solidity ^0.4.10;
// Copyright 2017 Zerocoin Electric Coin Company LLC
//
// 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
//
/... | Constructor. Initial supply of tokens are deposited in the account of the creator of the contract. Super constructor for ZSLMerkleTree is invoked here too. left uint256 name string/ Create contract for precompiles and commitment tree | function ZToken(uint256 initialSupply, string tokenName) ZSLMerkleTree(ZTOKEN_TREE_DEPTH) {
balanceOf[msg.sender] = initialSupply;
totalSupply = initialSupply;
name = tokenName;
address_zsl = new ZSLPrecompile();
zsl = ZSLPrecompile(address_zsl);
}
| 5,396,581 |
./full_match/80001/0xF8256Df6Fb926f3E33c6318133BfE3a68DC234fE/sources/contract/Miracle-Staking/module/Miralce-Stake-Core.sol | A function to get the total unclaimed rewards across all staking players. return _totalUnClaim The total amount of unclaimed rewards./ | function _getTotalUnClaim() internal view returns (uint256 _totalUnClaim) {
address[] memory _stakePlayers = StakePlayers;
for(uint256 i = 0; i < _stakePlayers.length; i++)
{
address _player = _stakePlayers[i];
_totalUnClaim = _totalUnClaim + _calculateToTalReward(... | 5,553,562 |
./partial_match/1/0xEbc165ACfedDf96a32C3aCaf01585647fA3239d0/sources/RenovaAvatar.sol | @inheritdoc IRenovaAvatarBase | function setCustomBaseURI(
string memory customBaseURI
) external override onlyOwner {
_customBaseURI = customBaseURI;
emit UpdateCustomURI(_customBaseURI);
emit BatchMetadataUpdate(1, type(uint256).max);
}
| 15,741,664 |
./partial_match/1/0x420D08Dad4fcd7896500d5E183D8BA934c919220/sources/EaselyFixedCollection.sol | Hash that the owner or approved alternate signer then sign that buyers use in order to call the {mint} method./ | function hashToSignForMint(uint256 version, uint256 amount, uint256[4] memory pricesAndTimestamps) external view returns (bytes32) {
_checkValidSigner(_msgSender());
require(amount <= transactionMax, "Over transaction limit");
return _hashForMint(version, amount, pricesAndTimestamps);
}... | 2,825,425 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "./IInflateLib.sol";
// Source: https://github.com/adlerjohn/inflate-sol
/// @notice Based on https://github.com/madler/zlib/blob/master/contrib/puff
library InflateLib {
// Maximum bits in a code
uint256 constant MAXBITS = 15;
// Maxi... | Bit accumulator (can use up to 20 bits) Load at least need bits into val Out of input | function bits(State memory s, uint256 need)
private
pure
returns (IInflateLib.ErrorCode, uint256)
{
uint256 val;
val = s.bitbuf;
while (s.bitcnt < need) {
if (s.incnt == s.input.length) {
return (IInflateLib.ErrorCode.ERR_NOT_TERMINATE... | 12,041,395 |
./partial_match/56/0x30E104A187Aa257f92ED497EE73F3b832f6781D1/sources/MainToken.sol | WISH masc to increase entropy | function toKey(address _addr, uint _release) internal pure returns (bytes32 result) {
result = 0x5749534800000000000000000000000000000000000000000000000000000000;
assembly {
result := or(result, mul(_addr, 0x10000000000000000))
result := or(result, and(_release, 0xffffffffffffffff))
}
}
| 11,163,050 |
pragma solidity 0.5.4;
library safemath3 { //inject NONSTANDARD NAMING
uint256 constant internal max_uint25 = 2 ** 256 - 1; // max uint256 //inject NONSTANDARD NAMING
function MUL14(uint256 _a, uint256 _b) internal pure returns(uint256... | inject NONSTANDARD NAMING | function CANCLEEXCHANGEREQUEST83(uint256 _trxSeq) public { | 974,777 |
/**
* Copyright 2017–2018, bZeroX, LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.5.3;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalS... | Note: takerToken is confirmed to be the same in 0x for batch orders calculate required takerFee The 0x TokenTransferProxy already has unlimited transfer allowance for ZRX from this contract (set during deployment of this contract) reset approval to 0 | function _take0xTrade(
address trader,
uint256 sourceTokenAmountToUse,
address[5][] memory orderAddresses0x,
uint256[6][] memory orderValues0x,
bytes memory signature)
internal
returns (uint256 sourceTokenUsedAmount, uint256 destTokenAmount)
{
for... | 5,543,042 |
/*
Copyright (c) 2020 Fuel Labs
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... | setup hash keccak256(start, length) create transaction ID | function selectAndVerifyTransactionLeafData(transactionData) ->
let metadataLength := selectTransactionMetadataLength(transactionData)
assertOrFraud(lte(metadataLength, TransactionLengthMax),
FraudCode_TransactionMetadataLengthOverflow)
t... | 12,672,954 |
./full_match/1/0x7BC926eF3905638EA4B343A722383261e51b9ce6/sources/contracts/proofNonReflectionTokenFactory.sol | enable transfer and allow router to exceed tx limit to remove liquidity disable transfer of token | function cancelToken(address tokenAddress) external {
require(validatedPairs[tokenAddress].owner == msg.sender, "!owner");
require(validatedPairs[tokenAddress].status == false, "validated");
address _pair = validatedPairs[tokenAddress].pair;
address _owner = validatedPairs[tokenAddr... | 2,968,463 |
pragma solidity ^0.4.23;
/*
Standard ERC20 Token.
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
contract ERC20 {
string public name;
string public symbol;
uint8 public decimals = 18;
uint public totalSupply;
mapping (address => uint) public balanceOf;
mapping (address => ma... | Updates creditedPoints, sends all wei to the owner update creditedPoints, store amount, and zero it. | function collectOwedDividends()
public
returns (uint _amount)
{
_updateCreditedPoints(msg.sender);
_amount = creditedPoints[msg.sender] / POINTS_PER_WEI;
creditedPoints[msg.sender] = 0;
dividendsCollected += _amount;
emit CollectedDividends(now, msg.sender... | 2,458,110 |
./full_match/5/0x19Abbd463a98217dA1be425644Ba64D60114C23a/sources/contracts/aboutRarity_0.13.sol | parts[0] = '<svg xmlns="http:www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: white; font-family: serif; font-size: 16px; }</style><style>.footnote { fill: white; font-family: verdana; font-size: 8px; }</style><rect width="100%" height="100%" fill="black" /><text x="25... | function tokenURI(uint256 tokenId) override public view returns (string memory){
string[7] memory parts;
parts[2] = ' />';
parts[4] = '<text x="25" y="50" class="base">';
uint256 rand = random(string(abi.encodePacked(parts[0], toString(tokenId))));
uint256 ran... | 1,929,918 |
pragma solidity ^0.5.0;
import "../../helper/SafeMath.sol";
import "../../helper/Ownable.sol";
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public totalSupply;
function balanceOf(address who) public view... | Gets the balance of the specified address. _owner The address to query the the balance of. return An uint representing the amount owned by the passed address./ | function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
| 2,524,911 |
pragma solidity 0.4.24;
import "./../workers/Worker.sol";
contract WorkerManager {
address public owner;
event CreateWorker(bytes32 indexed _workerName, address indexed _worker);
mapping(bytes32=>Worker) public workers; // client , worker name, worker address
modifier onlyOwner {
require(m... | workers[_workerName].addCaller(msg.sender); | function createWorker(bytes32 _workerName) public onlyOwner returns(address _workerAddress){
workers[_workerName] = new Worker();
workers[_workerName].init(msg.sender, _workerName);
emit CreateWorker(_workerName, workers[_workerName]);
return address(workers[_workerName]);
}
| 12,805,680 |
pragma solidity 0.5.16;
import "@openzeppelin/contracts/ownership/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "../lib/util/Constants.sol";
import "./EscrowBaseInterface.sol... | Withdraw ERC20 token from an account to Instrument Manager. The transfer action is done inside this function. account The account to withdraw ERC20 token. token The ERC20 token to withdraw. amount The amount of ERC20 tokens to withdraw./ | function withdrawTokenByAdmin(
address account,
address token,
uint256 amount
) public onlyOwner {
require(account != address(0x0), "EscrowBase: Account not set");
require(token != address(0x0), "EscrowBase: Token not set");
require(amount > 0, "EscrowBase: Amount... | 12,845,172 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
import {Ownable} from "openzeppelin-solidity/contracts/access/Ownable.sol";
import {StdReferenceBase} from "./IStdReference.sol";
import {IBridge} from "../interfaces/IBridge.sol";
import {Obi} from "../obi/Obi.sol";
cont... | TODO: Check request packet TODO: Check response status | function _process(
IBridge.RequestPacket memory _req,
IBridge.ResponsePacket memory _res
) internal {
Obi.Data memory reqData = Obi.from(_req.params);
Obi.Data memory resData = Obi.from(_res.result);
uint256 symbolLen = uint256(reqData.decodeU32());
uint256 rateLe... | 7,320,654 |
./partial_match/1/0xE583C6ED8222265A4147362540aa7ACc5bc9634a/sources/DMEX_Base.sol | Owner getter function | function getOwner() public returns (address out) {
return owner;
}
| 3,655,453 |
./partial_match/1/0x2e24adD8CcccC5BE6f34CDBCf7e48e8396260Db0/sources/MyAdvancedToken.sol | This generates a public event on the blockchain that will notify clients / transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance. | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _va... | 2,670,495 |
/**
*Submitted for verification at Etherscan.io on 2020-08-26
*/
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
fun... | See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| 10,403,610 |
./partial_match/1/0x9d08CCeD85A68Bf8A19374ED4B5753aE3Be9F74f/sources/contracts/protocol/modules/v1/AaveV3LeverageModule.sol | MANAGER ONLY: Removes this module from the SetToken, via call by the SetToken. Any supplied collateral assets are disabled to be used as collateral on Aave. Aave Settings and manager enabled assets state is deleted. Note: Function will revert is there is any debt remaining on Aave/ Sync Aave and SetToken positions prio... | function removeModule() external override onlyValidAndInitializedSet(ISetToken(msg.sender)) {
ISetToken setToken = ISetToken(msg.sender);
sync(setToken);
address[] memory borrowAssets = enabledAssets[setToken].borrowAssets;
for(uint256 i = 0; i < borrowAssets.length; i++) {
... | 15,718,155 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
pragma experimental ABIEncoderV2;
import "./messenger/IMessenger.sol";
/**
* @title MessengerRegistry
* @dev MessengerRegistry is a contract to register openly distributed Messengers
*/
contract MessengerRegistry {
struct Messenger {
address ownerA... | public function to get the start and end of a period _periodType 1. period type i.e. Hourly, Daily, Weekly, BiWeekly, Monthly, Yearly _periodId 2. period id to get start and end/ | function getPeriodStartAndEnd(PeriodType _periodType, uint256 _periodId)
public
view
returns (uint256 start, uint256 end)
{
start = periodDefinitions[_periodType].starts[_periodId];
end = periodDefinitions[_periodType].ends[_periodId];
}
| 1,570,494 |
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol | Reads the bytes1 at `rdPtr` in returndata. | function readBytes1(
ReturndataPointer rdPtr
) internal pure returns (bytes1 value) {
assembly ("memory-safe") {
returndatacopy(0, rdPtr, _OneWord)
value := mload(0)
}
}
| 8,451,804 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.