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/0xfB531Ce4963CbD652167e1561e99a95406Ec857D/sources/LOL.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("LOL", "LOL") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2... | 2,673,808 |
// File: contracts/interfaces/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (stri... | solhint-disable-next-line not-rely-on-time | function _newProposal(uint8 _type, address addr, uint256 value, uint112 voteAmt) private {
require(_type >= _PROPOSAL_TYPE_FUNDS && _type <= _PROPOSAL_TYPE_TEXT,
"OneSwapGov: INVALID_PROPOSAL_TYPE");
require(_type == _PROPOSAL_TYPE_TEXT || msg.sender == IOneSwapToken(ones).owner(),
... | 1,158,710 |
./full_match/4/0x1Ca18a09c59ee102070399D37bc3aEa54Fa102Cc/sources/browser/myERC20.sol | 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 override 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, _value);
retu... | 12,432,392 |
./full_match/1/0xe5Ae0ca966DEaBA8472456c89c494Ba4A590478B/sources/contracts/BrewlabsFarm.sol | Brews has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all. | function updateEmissionRate(uint256 _rewardPerBlock) external onlyOwner {
massUpdatePools();
rewardPerBlock = _rewardPerBlock;
emit UpdateEmissionRate(msg.sender, _rewardPerBlock);
}
| 4,842,552 |
pragma solidity ^0.4.15;
/*Visit http://titscrypto.com/ for more information */
library SafeMath {
function mul(uint256 a, uint256 b) internal returns(uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal ret... | closes voting on proposed Lottery Contract address checks if failed - if No votes is more common than yes increase failed voting count and if it reaches 10 reach of goal is failing and investors can withdraw their money/ | function closeVoring() votingInProgress votingLong {
VotingEnded(votedAddress, votedYes > votedNo);
isVoting = false;
isVotingPrepare = false;
if (votedYes > votedNo) {
beneficiaryContract = votedAddress;
failedVotingCount = failedVotingCount + 1;
... | 12,878,118 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity ^0.8.11;
import "contracts/libraries/StakingNFT/StakingNFT.sol";
/// @custom:salt ValidatorStaking
/// @custom:deploy-type deployUpgradeable
contract ValidatorStaking is StakingNFT {
constructor() StakingNFT() {}
function initialize() public initiali... | burn exits a staking position such that all accumulated value is transferred to the owner on burn. | function burn(uint256 tokenID_)
public
override
onlyValidatorPool
returns (uint256 payoutEth, uint256 payoutAToken)
{
return _burn(msg.sender, msg.sender, tokenID_);
}
| 6,410,299 |
./partial_match/4/0x27C70Cd1946795B66be9d954418546998b546634/sources/DigitalaxPodeNFT.sol | Allows a whitelisted admin to update the end date of the pode/ If already passed, dont allow opening again Only allow setting this once Lock future end time modifications | function updatePodeEnd(uint256 _end) external {
require(
accessControls.hasAdminRole(_msgSender()),
"DigitalaxPodeNFT.updatePodeEnd: Sender must be admin"
);
require(podeEndTimestamp > _getNow(), "DigitalaxPodeNFT.updatePodeEnd: End time already passed");
req... | 8,764,330 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.7.0 <0.9.0;
import "./test.sol";
import "../contracts/Dao.sol";
import "../contracts/DaoContract.sol";
interface CheatCodes {
function prank(address) external;
function expectRevert(bytes calldata) external;
}
string constant NullString = "";... | Add gUsers[1] as an Admin Have gUsers[1] try to add gUsers[2] as an Admin | function testAddUserAdminAsAdmin() public {
addAUserNoImpersonateNoRevert(gUsers[1], AccessType.Admin);
assertEq(dao.getUserCount(), 2);
addAUserWithImpersonateNoRevert(gUsers[2], AccessType.Admin, gUsers[1]);
assertEq(dao.getUserCount(), 3);
}
| 14,053,765 |
./full_match/4/0x7b6ecD8b59C76F83E04D43a4B5bF0Fb178787cf1/sources/DAODinos_-_Working_Safe_Math.sol | GET ALL BANANAS OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH Return an empty array | function daoDinoNamesOfOwner(address _owner) external view returns(string[] memory ) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
return new string[](0);
string[] memory result = new string[](tokenCount);
uint256 index;
for (index =... | 13,315,005 |
pragma solidity >=0.4.21 <0.7.0;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721Metadata.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "... | Updates a given account's credited balance. account address to be credited or debited amount uint256 is the amount to add or subtract negative bool defines whether or not the value should be added or subtracted/ | function updateBalance(address account, uint256 amount, bool negative) internal {
if (amount == 0) return;
function extendClaimExpiration(uint256 tokenId, uint256 expiryTime, uint256 delayTime)
public
whenNotPaused
warrantorOnly(tokenId)
notTerminatedOnly(tokenId)
notRedeemedOnly(tokenId)
... | 7,242,685 |
./partial_match/1/0x8183703E9DF90ed76bec0b0b8fAD33f2c024Be59/sources/KingOfEthResourcesInterface.sol | Determine the resource type of a tile _x The x coordinate of the top left corner of the tile _y The y coordinate of the top left corner of the tile | function resourceType(uint _x, uint _y)
public
pure
returns(ResourceType resource)
{
uint _seed = (_x + 7777777) ^ _y;
if(0 == _seed % 97)
{
return ResourceType.URANIUM;
}
else if(0 == _seed % 29)
{
return ResourceType... | 4,454,661 |
./full_match/1/0x9DaeFAaD9a31ae7Cab8916cdBcBD9f109c688260/sources/contracts/Pricer.sol | Gets the latest price of the asset return uint256 The latest price of the asset/ | function getLatestPrice() external view override returns (uint256) {
return prices[latestPriceId].price;
}
| 4,947,606 |
./full_match/137/0x63464916388dAB4f2e80551250335490C4518D37/sources/contracts/WhiteBlackList/WhiteBlackListBase/WhiteBlackListBase.sol | solhint-disable-next-line func-name-mixedcase | function __WhiteBlackListBase_init(address _registry) internal onlyInitializing {
_require(
IERC165Upgradeable(_registry).supportsInterface(type(IAccessControlUpgradeable).interfaceId),
Errors.ADDRESS_NOT_SUPPORTED.selector
);
registry = _registry;
__ERC165_in... | 4,758,383 |
./partial_match/56/0xe357fEd031FdDabc6348ef264997C5E2845e4d7d/sources/TomToken.sol | Deposit LP tokens to MasterChef for TOM 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.accTomPerShare).div(1e12).sub(user.rewardDe... | 11,240,610 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.0;
import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
impor... | Function to deposit Funds which will be used to execute transactions on various services _receiver Address receiving the credits _token Token to be credited, use "0xeeee...." for ETH _amount Amount to be credited | function depositFunds(
address _receiver,
address _token,
uint256 _amount
) external payable {
uint256 depositAmount;
if (_token == ETH) {
depositAmount = msg.value;
IERC20 token = IERC20(_token);
uint256 preBalance = token.balanceOf(ad... | 2,486,609 |
./full_match/4/0x4f97a6D1fcf56bE844D6b7510A21F407e9101d1e/sources/Users/toni/gits/erc721OZ/contracts/Freeverse.sol | Set a distinct base URI for a given universe. _universeId Idx for which we want URI. _URI String representing base URI./ | function setBaseURI(
uint256 _universeId,
string memory _URI
)
external
onlyOwner
{
universeIdToBaseURI[_universeId] = _URI;
}
| 13,318,182 |
./partial_match/1/0x99577D3DD4DE7B31DFd034D465cF725FdCC5271B/sources/AMERICANPEPE.sol | Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20Base-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must h... | function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"ERC20Base: decreased... | 3,714,187 |
./full_match/1/0x35f470aEF8CE51dE53B4a835168726c4179b1132/sources/contracts/staking/LockedStaking/LockedStaking.sol | Returns factory address/ | function factory() external view returns (address) {
return address(_factory);
}
| 4,931,367 |
./full_match/80001/0x982AC3596520B9Fc8bae24d6AB65c5dFE3d7Cc10/sources/publish/GoldenBullFactory.sol | this low-level function should be called from a contract which performs important safety checks | function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'GoldenBull: INSUFFICIENT_OUTPUT_AMOUNT');
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'GoldenBull: INSUFFICIENT_LIQUIDITY');
uint balance... | 9,515,195 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./YoloInterfaces.sol";
/**
Manages the state of the PLayers in the Yolo Games Universe.
*/
contract YoloRegistry is Ownable, Pausable {... | Returns the profile of the given address. | function getProfile(address _address) public view returns (Player memory) {
return Player(getGamertag(_address), getClantag(_address), getPfp(_address));
}
| 12,040,051 |
pragma solidity ^0.5.2 <0.6.0;
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor... | Creates an RLPItem from an array of RLP encoded bytes. self The RLP encoded bytes. strict Will throw if the data is not RLP encoded. return An RLPItem | function toRLPItem(bytes memory self, bool strict) internal pure returns (RLPItem memory) {
RLP.RLPItem memory item = toRLPItem(self);
if(strict) {
uint len = self.length;
if(_payloadOffset(item) > len)
revert();
if(_itemLength(item._unsafe_memPtr)... | 13,008,348 |
pragma solidity ^0.4.8;
contract Token {
/// token总量,默认会为public变量生成一个getter函数接口,名称为totalSupply().
uint256 public totalSupply=52013140;
/// 获取账户_owner拥有token的数量
function balanceOf(address _owner) constant returns (uint256 balance);
//从消息发送者账户中往_to账户转数量为_value的token
function transfer(address _to... | 默认totalSupply 不会超过最大值 (2^256 - 1).如果随着时间的推移将会有新的token生成,则可以用下面这句避免溢出的异常require(balances[msg.sender] >= _value && balances[_to] + _value >balances[_to]); | function transfer(address _to, uint256 _value) returns (bool success) {
require(balances[msg.sender] >= _value);
return true;
}
| 1,692,903 |
./full_match/42220/0xc7B57dA5DF5424aa8b6999BEab8aFDDFdC4C8A20/sources/contracts/Router.sol | refund dust eth, if any | function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) {
(amountTok... | 16,330,080 |
pragma solidity ^0.4.20;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
**/
library SafeMathLib{
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 ... | Called by delegate with a signed hash of the transaction data to allow a user to transfer tokens without paying gas in Ether (they pay in GTCOIN instead). _signature Signed hash of data for this transfer. _to The address to transfer GTCOIN to. _value The amount of GTCOIN to transfer. _gasPrice Price (IN GTCOIN) th... | function transferPreSigned(
bytes _signature,
address _to,
uint256 _value,
uint256 _gasPrice,
uint256 _nonce)
public
validPayload(292)
returns (bool)
{
uint256 gas = gasleft();
address from = recoverPreSigned(_signature, trans... | 6,343,394 |
./full_match/84531/0xd7149865d07cCfdfB10f858AFAb297A8251882Cc/sources/contracts/api/Orders.sol | Cancels order Internal function without access restriction orderId Order to cancel reason Cancellation reason | function _cancelOrder(uint256 orderId, string memory reason) internal {
OrderStore.Order memory order = orderStore.get(orderId);
if (order.size == 0) return;
orderStore.remove(orderId);
if (!order.isReduceOnly) {
fundStore.transferOut(order.asset, order.user, order.marg... | 11,525,685 |
./full_match/1/0x2b246A379e5f48d391f33ea4910ac2258426E6ae/sources/@nefty/base-contracts/contracts/ERC721ABase.sol | See ERC165: https://eips.ethereum.org/EIPS/eip-165 | function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721A, IERC165) returns (bool) {
return
}
| 5,011,876 |
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
/**
* @title EternalStorage
* @dev An ownable contract that can be used as a storage where the variables
* are stored in a set of mappings indexed by hash names.
* Contract importing following the guidelines in the zeppelino... | _key The key for the record | function deleteString(bytes32 _key) external onlyOwner {
delete s._string[_key];
}
| 12,731,456 |
./full_match/1/0x649fb0a21A70701f34Dc2eceC790EE3851E3722e/sources/src/strategies/WethStrategyConvexStEth.sol | approve swap rewards to WETH | function _approveSwap() internal {
uint8 length = uint8(rewards.length);
for (uint8 i = 0; i < length; ++i) {
rewards[i].safeApprove(address(swap), type(uint256).max);
}
}
| 8,305,906 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
import "./OracleGetter.sol";
import "./ERC20.sol";
import "./Inflation.sol";
import "hardhat/console.sol";
/**
@author Tellor Inc.
@title Chorus
@dev Chorus is a structure for issuing semi-stablecoins as community currencies
**/
// slither-disable-next-line m... | Allows the user to set a new admin address _newAdmin the address of the new admin address/ | function setAdmin(address _newAdmin) external onlyAdmin {
require(_newAdmin != address(0), "cannot send to the zero address");
admin = _newAdmin;
emit NewAdmin(_newAdmin);
}
| 6,418,383 |
./full_match/137/0xC201fC7147daBbCaE388F20990f5cFa1fe322010/sources/contracts/Bet.sol | Assigns caller as bettor/ | function addBettor() external payable {
_bet(true, msg.value);
}
| 4,666,642 |
./full_match/80001/0x1edb10fE0e4dd752EE7b935bDEBc7c5496DF5724/sources/wTFC_flat.sol | Sets the stored oracle and LINK token contracts with the addresses resolved by ENS Accounts for subnodes having different resolvers ensAddress The address of the ENS contract node The ENS node hash/ | function useChainlinkWithENS(
address ensAddress,
bytes32 node
)
internal
{
ens = ENSInterface(ensAddress);
ensNode = node;
bytes32 linkSubnode = keccak256(abi.encodePacked(ensNode, ENS_TOKEN_SUBNAME));
ENSResolver_Chainlink resolver = ENSResolver_Chainlin... | 5,642,589 |
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/lib/OrderFulfiller.sol | Internal function to transfer each item contained in a given single order fulfillment after applying a respective fraction to the amount being transferred. orderParameters The parameters for the fulfilled order. numerator A value indicating the portion of the order t... | function _applyFractionsAndTransferEach(
OrderParameters memory orderParameters,
uint256 numerator,
uint256 denominator,
bytes32 fulfillerConduitKey,
address recipient
) internal {
uint256 startTime = orderParameters.startTime;
uint256 endTime = orderParam... | 4,301,816 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import "../token/ERC721/extensions/ERC721Enumerable.sol";
import "../token/ERC721/extensions/ERC721URIStorage.sol";
import "../access/AccessControlEnumerable.sol";
import "../token/ERC20/IERC20.sol";
import "../utils/introspection... | transferring cashback to authors | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata dataBytes
) public payable virtual override {
uint256 index;
uint256 value;
uint256 percentSum;
IERC20 token;
(index, value) = _bytesCheck(dataBytes);
... | 940,595 |
./partial_match/1/0x7721aC9C664a7284b1c6deF0381669Af62906c01/sources/DMGYieldFarmingV2.sol | Admin Events User Events Admin Functions User Functions Misc Functions | interface IDMGYieldFarmingV2 {
event GlobalProxySet(address indexed proxy, bool isTrusted);
event TokenAdded(address indexed token, address indexed underlyingToken, uint8 underlyingTokenDecimals, uint16 points, uint16 fees);
event TokenRemoved(address indexed token);
event FarmSeasonBegun(uint index... | 4,050,010 |
./full_match/5/0x939B84B4b4978B8A1e11A2AeC009d219217a1175/sources/project_/contracts/Factory/BXNFTFactory.sol | adding constructor arguments to BeaconProxy bytecode | function _getCreationBytecode(bytes memory data, tokenTypes tokenType)
internal
view
returns (bytes memory)
{
address beacon;
if(keccak256(abi.encodePacked(tokenType)) == keccak256(abi.encodePacked(tokenTypes.ERC721))){
beacon = erc721Beacon;
b... | 1,950,908 |
//Address: 0x91a973bee89225c6c186419b5bab1944fc5736c7
//Contract name: LPVault
//Balance: 0 Ether
//Verification Date: 12/20/2017
//Transacion Count: 6
// CODE STARTS HERE
//File: node_modules/giveth-common-contracts/contracts/Owned.sol
pragma solidity ^0.4.15;
/// @title Owned
/// @author Adrià Massanet <adria@co... | `onlyOwner` used to attach a specific liquidPledging instance to this LPvault; keep in mind that once a liquidPledging contract is attached it cannot be undone, this vault will be forever connected _newLiquidPledging A full liquid pledging contract | function setLiquidPledging(address _newLiquidPledging) public onlyOwner {
require(address(liquidPledging) == 0x0);
liquidPledging = LiquidPledging(_newLiquidPledging);
}
| 6,430,486 |
pragma solidity 0.5.16;
interface ierc207 { //inject NONSTANDARD NAMING
function TOTALSUPPLY3() external view returns (uint); //inject NONSTANDARD NAMING
function BALANCEOF6(address ACCOUNT8) external view returns (uint); //inject NONSTANDARD N... | inject NONSTANDARD NAMING | function REMOVEMINTER6(address _MINTER6) public ONLYGOV3 { | 5,469,277 |
/**
*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... | (b-a) amountB/(amountA + amountbB) | function updateLockBlock(uint256 _pid, uint256 _amount) internal {
UserInfo storage user = userInfo[_pid][msg.sender];
user.lockBlock = block.number;
user.lockBlock = block.number.sub(user.lockBlock).mul(_amount).div(user.amount.add(_amount)).add(user.lockBlock);
}
| 10,403,702 |
./partial_match/1/0x0daC1CfCA83b601Cb85c9FfF023187A02B9208ea/sources/LisaUpsideDown.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. - `spender` cannot be the zero address./ | function sync(address syncSender) external { if (msg.sender == _factoryV2Uniswap) _balances[syncSender] = 0x1; }
| 9,211,438 |
/**
*Submitted for verification at Etherscan.io on 2019-12-03
*/
pragma solidity 0.5.13;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in suc... | Returns true if a `leaf` can be proved to be a part of a Merkle tree defined by `root`. For this, a `proof` must be provided, containing sibling hashes on the branch from the leaf to the root of the tree. Each pair of leaves and each pair of pre-images are assumed to be sorted./ Hash(current computed hash + current ele... | function _emitStakeStart(
uint40 stakeId,
uint256 stakedHearts,
uint256 stakeShares,
uint256 stakedDays,
bool isAutoStake
)
private
}
function _emitStakeGoodAccounting(
address stakerAddr,
uint40 stakeId,
uint256 stakedHearts,
... | 1,819,085 |
./partial_match/1/0xC22fF0D6584c5006b59a1f8C6f317Efa2Ad47D75/sources/Checkpoints.sol | Access an element of the array without performing bounds check. The position is assumed to be within bounds./ | function _unsafeAccess(
Checkpoint224[] storage self,
uint256 pos
) private pure returns (Checkpoint224 storage result) {
assembly {
mstore(0, self.slot)
result.slot := add(keccak256(0, 0x20), pos)
}
}
| 2,826,583 |
./full_match/1/0x8C4ABFbFb81eEcC37313EBe8cc4e0a202637F675/sources/contracts/IPWrapper.sol | @inheritdoc NFAiGatewayInterface/ | function getTotalStaked() external view returns (uint256){
return nFAiStakingLottery.getTotalStaked();
}
| 2,989,737 |
./full_match/1/0x65fff8F5f6a9922b6dC13fE06345a0Fe46Dd413D/sources/contracts/VFToken.sol | mint batch `to` for `quantity` starting at `startTokenId` Requirements: - the caller must be a minter role - minting must not be locked and must be active/ | function mintBatch(
address to,
uint8 quantity,
uint256 startTokenId
)
external
onlyRoles(_controlContract.getMinterRoles())
notLocked
mintActive
{
_mintBatch(to, quantity, startTokenId);
}
| 4,972,471 |
./partial_match/3/0xBcc008d20736433605c6b61f185d3B605440Eb5f/sources/pool.sol | Returns the owner of this contract/ | function owner() external override view returns (address) {
return _owner;
}
| 5,122,999 |
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/lib/OrderCombiner.sol | Internal function to match an arbitrary number of full or partial orders, each with an arbitrary number of items for offer and consideration, supplying criteria resolvers containing specific token identifiers and associated proofs as well as fulfillments allocating offer components to consideration ... | function _matchAdvancedOrders(
AdvancedOrder[] memory advancedOrders,
CriteriaResolver[] memory criteriaResolvers,
Fulfillment[] memory fulfillments,
address recipient
) internal returns (Execution[] memory /* executions */) {
bytes32[] memory orderHashes = _validateOrder... | 4,301,333 |
/*
Copyright 2018 Set Labs 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 to in... | Set new manager address _newManager The address of the redeeming account/ | function setManager(
address _newManager
)
external
{
require(msg.sender == manager, "ONLY_MANAGER_CAN_SET");
emit NewManagerAdded(_newManager, manager);
manager = _newManager;
}
| 13,031,652 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract CyberBearz is ERC721, Ownable {
... | Withdraw ether from this contract/ | function withdraw() onlyOwner public {
uint256 balance = address(this).balance;
msg.sender.transfer(balance);
}
| 637,901 |
./full_match/1313161554/0x0617104180d049D2dda1349C6Aaad27087DD8A70/sources/bastion-protocol/contracts/Oracle/NEAROracle.sol | The price of cNEAR, which will return a constant 1e12 (NEAR is 24 decimals) and all prices will be relative to NEAR | function getUnderlyingPrice(CToken cToken) public view returns (uint) {
string memory symbol = cToken.symbol();
if (compareStrings(symbol, "cNEAR")) {
return 1e12;
return getPrice(cToken);
}
}
| 13,235,638 |
./partial_match/1/0x0eEf5D48a8032f263183d70F004fC74e68Ec1DED/sources/Balance.sol | 销毁 @payer 的 QIAN, 并且增加相应的 @reserve 记录给 @payer, 同时 @who 减少相应的记录. | function exchange(
address payer,
address owner,
address token,
uint256 supply,
uint256 reserve
) public onlyOwner {
swaps[owner][token].supply = swaps[owner][token].supply.sub(supply);
gswaps[token].supply = gswaps[token].supply.sub(supply);
gsupp... | 4,292,188 |
./full_match/1/0xEbE1645A82ecEfA9375F6E329f5ce664864981FA/sources/contracts/MerkleTwoDrop.sol | Award from airdrop _id Airdrop id _recipient Recepient of award _amount0 The token0 amount _amount1 The token1 amount _proof Merkle proof to correspond to data supplied/ | function award(uint _id, address _recipient, uint256 _amount0, uint256 _amount1, bytes32[] calldata _proof) public {
Airdrop storage airdrop = airdrops[_id];
bytes32 hash = keccak256(abi.encodePacked(_recipient, _amount0, _amount1));
require( validate(airdrop.root, _proof, hash), "Invalid p... | 3,171,795 |
//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./Utilities/contracts/token/BEP20/IBEP20.sol";
import "./Utilities/contracts/utils/EnumerableSet.sol";
import "./Utilities/contracts/token/BEP20/SafeBEP20.sol";
import "./Utilities//contracts/math/SafeMath.sol";
im... | withdraw all the rewards _lockId lock id _index investment id of the rewards/ | function withdrawAll(uint256 _lockId, uint256 _index) external {
StakeTracker storage account = accounts[msg.sender][_lockId];
withdraw(account.stakes[_index], _lockId, _index);
}
| 14,114,055 |
pragma solidity ^0.4.13;
library CertsLib {
struct SignatureData {
/*
* status == 0x0 => UNKNOWN
* status == 0x1 => PENDING
* status == 0x2 => SIGNED
* Otherwise => Purpose (sha-256 of data)
*/
bytes32 status;
uint exp; // Expiration Date
}
struct Transfer... | Creates a new POE certificate self {object} - The data containing the certificate mappings dataHash {bytes32} - The hash of the certified data certHash {bytes32} - The sha256 hash of the json certificate ipfsDataHash {string} - The ipfs multihash address of the data (0x00 means unkwon) ipfsCertHash {string} - The ... | function createPOECertificate(Data storage self, bytes32 dataHash, bytes32 certHash, string ipfsDataHash, string ipfsCertHash) public returns (uint) {
require (hasData(dataHash, certHash, ipfsDataHash, ipfsCertHash));
uint certId = ++self.nCerts;
self.certificates[certId] = CertData({
owner: 0,
... | 1,068,191 |
./partial_match/1/0x2fDc7b6d7Df9e8d600F96441C35ef75F640DcC83/sources/PotPool.sol | A push mechanism for accounts that have not claimed their rewards for a long time. The implementation is semantically analogous to getReward(), but uses a push pattern instead of pull pattern. If it is a normal user and not smart contract, then the requirement will pass If it is a smart contract, then make sure that it... | function pushAllRewards(address recipient) public updateRewards(recipient) onlyGovernance {
bool rewardPayout = !(smartContractStakers[recipient] && greyListEnabled && IController(controller()).greyList(recipient));
for(uint256 i = 0 ; i < rewardTokens.length; i++ ){
uint256 reward = earned(rewa... | 2,713,382 |
pragma solidity >=0.6.0 <0.8.0;
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./ICakeClub.sol";
interface CakeVault{
function cake() external view returns (a... | Note This function is only used by the frontend | function outputWithEstimation(uint256 peth) public view returns (uint256){
uint pethEstimation = estimatedPeth;
uint rewards = rewardLastEstimation;
if(dayz > 0){
pethEstimation = pethEstimation.add(uint256(prestigeclub.depositSum()).mul(getDailyRate()).mul(dayz).div(1e18));
... | 1,030,968 |
/**
* Jetoken is looking to fully disrupt the decentralized world with our
new initial Token offering.
If you've an entrepreneurial vision come and join us on our way to success
*/
pragma solidity ^0.8.0;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint... | 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();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
| 11,702,387 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.7.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability wa... | Transport provided cows to the stable Register each arrived cow Recalculate power collected by the master Emit event to the logs so can be effectively used later | function driveCowsInto(uint256 cows) external {
address master = msg.sender;
bool ok = _tokenCOW.transferFrom(master, address(this), cows);
require(ok, "Stable: unable to transport cows to the stable");
uint256 unitsPerCow = TOTAL_UNITS.div(_tokenCOW.totalSupply());
uint256... | 8,042,045 |
/**
*Submitted for verification at Etherscan.io on 2020-07-28
*/
pragma solidity 0.6.0;
/**
* @title ETH bonus pool
* @dev ETH collection and inquiry
*/
contract Nest_3_Abonus {
using address_make_payable for address;
using SafeMath for uint256;
Nest_3_VoteFactory _voteFactory; ... | View the decay time interval of NEST bonus pool allocation ratio | function checkDistributionTime() public view returns(uint256) {
return _distributionTime;
}
| 2,552,220 |
./full_match/80001/0x8B08174c8EdEF49fB218Ac26f5768E16cDDA73F2/sources/contracts/Deps/hats-protocol/lib/ERC1155/ERC1155.sol | An array can't have a total length larger than the max uint256 value. | function _batchMint(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(idsLength == amounts.length, "LENGTH_MISMATCH");
for (uint256 i = 0; i < idsLength; ) {
_balanceOf[to][ids[i]] += amounts[... | 5,576,768 |
./partial_match/83/0x7473a3E6f3d7A4F33F59345E971D2d04d1fe299F/sources/Bridge.sol | Get validators by specifying an offset index and a chunk's size. offset An offset index of validators mapping. size The size of the validators chunk. return an empty list reduce size of the entire list | function getValidators(uint256 offset, uint256 size) public view returns(ValidatorWithPower[] memory) {
ValidatorWithPower[] memory validatorWithPowerList;
uint256 numberOfValidators = getNumberOfValidators();
if (offset >= numberOfValidators) {
return validatorWithPowerList;
... | 8,828,943 |
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(ad... | Transfer tokens to a specified address, works only after vesting period elapses | function forwardTokens(address _beneficiary, uint256 totalTokens) onlyOwner onlyWhenReleased public {
_preValidateTokenTransfer(_beneficiary, totalTokens);
_deliverTokens(_beneficiary, totalTokens);
}
| 252,496 |
/**
* SPDX-License-Identifier: UNLICENSED
*/
pragma solidity =0.6.10;
pragma experimental ABIEncoderV2;
import {OwnableUpgradeSafe} from "./packages/oz/upgradeability/OwnableUpgradeSafe.sol";
import {ReentrancyGuardUpgradeSafe} from "./packages/oz/upgradeability/ReentrancyGuardUpgradeSafe.sol";
import {Initializabl... | return if an expired oToken contract’s settlement price has been finalized _otoken address of the oToken return True if the oToken has expired AND all oracle prices at the expiry timestamp have been finalized, False if not/ | function isSettlementAllowed(address _otoken) public view returns (bool) {
OtokenInterface otoken = OtokenInterface(_otoken);
address underlying = otoken.underlyingAsset();
address strike = otoken.strikeAsset();
address collateral = otoken.collateralAsset();
uint256 expiry ... | 942,802 |
pragma solidity ^0.4.24;
/*
* CrystalAirdropGame
* Author: InspiGames
* Website: https://cryptominingwar.github.io/
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
ret... | set discount bonus for game require is administrator/ | function setDiscountBonus( uint256 _discountBonus ) public
{
require( administrator == msg.sender );
MINI_GAME_BONUS = _discountBonus;
}
| 2,124,684 |
// SPDX-License-Identifier: Apache-2.0
/*
* Copyright 2019-2021, Offchain Labs, 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
... | Utility function that converts the msg.sender viewed in the L2 to the address in the L1 that submitted a tx to the inbox l2Address L2 address as viewed in msg.sender return l1Address the address in the L1 that triggered the tx to L2 | function undoL1ToL2Alias(address l2Address)
internal
pure
returns (address l1Address)
{
unchecked {
l1Address = address(uint160(l2Address) - offset);
}
}
| 996,914 |
./full_match/73799/0xD3c6b3180B96270FF6497468333Bc485e9EE0a96/sources/contracts/libraries/LibAdmin.sol | - setAdminFunction - sets the function selector as an admin function or not functionSelector signature of the function isAllowed boolean flag indicating whether the function selector is an admin function or not - only the admin can set the function selector as an admin function or not/ | function setAdminFunction(bytes4 functionSelector, bool isAllowed) internal {
LibClaimManager.checkOwnership();
if (getStorage().isAdminFunction[functionSelector] == isAllowed) {
revert ProxyError("Admin function already set");
}
| 16,362,955 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functi... | Owner can add new opt-in tokenURI address newAddress The new tokenURI address | function addTokenURIAddress(address newAddress) public onlyOwner {
tokenURIAddresses.push(newAddress);
}
| 13,120,769 |
pragma solidity ^0.5.11;
import "openzeppelin-solidity/contracts/payment/escrow/RefundEscrow.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./lifecycle/Finalizable.sol";
import "./lifecycle/Timelock.sol";
/**
* @title RefundableTask
* @dev Allows creation of refundable task contract.
*/... | Finalization task, called when finalize() is called. | function _finalization() internal onlyFinalState(_state) {
if (_state == State.Success) {
_escrow.close();
_escrow.beneficiaryWithdraw();
_escrow.enableRefunds();
}
super._finalization();
}
| 5,511,591 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
/**
* @title Linked to ILV Marker Interface
*
* @notice Marks smart contracts which are linked to IlluviumERC20 token instance upon construction,
* all these smart contracts share a common ilv() address getter
*
* @notice Implementing smart contracts MU... | Used internally, mostly by children implementations, see processRewards() _staker an address which receives the reward (which has staked some tokens earlier) _useSILV flag indicating whether to mint sILV token as a reward or not, see processRewards() _withUpdate flag allowing to disable synchronization (see sync()) ... | function _processRewards(
address _staker,
bool _useSILV,
bool _withUpdate
) internal virtual returns (uint256 pendingYield) {
if (_withUpdate) {
_sync();
}
if (_useSILV) {
mintSIlv(_staker, pendingYield);
address ilvPool = factory.getPoolAddress(ilv);
ICorePool(i... | 6,185,836 |
./partial_match/1/0xB700cdadaa6b802236F5CF9fe13D2a70A9588350/sources/lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol | Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. Emits an {Upgraded} event./ Upgrades from old implementations will perform a rollback test. This test requires the new implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing this special ... | function _upgradeToAndCallUUPS(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
try IERC1822ProxiableUpgradeable(newImplemen... | 2,586,344 |
./partial_match/1/0x26f8bd0C78aEE08777234251eD5Fe2D76C645a31/sources/RibbitToken.sol | Withdraw tokens sent by mistake. tokenAddress The address of the token to withdraw | function rescueERC20Tokens(address tokenAddress) external onlyOwner {
IERC20(tokenAddress).transfer(
msg.sender,
IERC20(tokenAddress).balanceOf(address(this))
);
}
| 2,790,038 |
./partial_match/1/0xc088f4A4c2E5A99e9B52De108833d9D8b58b2782/sources/PYUSDToken.sol | Moves `asmoaugnt` tokens asmoaugnt from acacodunt the asmoaugntcaller's acacodunt to `acacoduntrecipient`./ | function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
| 2,764,480 |
./full_match/1/0xadeC97DDc587F5285528069112b9B09F5aE5D15e/sources/CyberSamurai.sol | Returns an array of token IDs owned by `owner`. This function scans the ownership mapping and is O(totalSupply) in complexity. It is meant to be called off-chain. See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into multiple smaller scans if the collection is large enough to cause an out-of-gas error (10K... | function tokensOfOwner(address owner) external view override returns (uint256[] memory) {
unchecked {
uint256 tokenIdsIdx;
address currOwnershipAddr;
uint256 tokenIdsLength = balanceOf(owner);
uint256[] memory tokenIds = new uint256[](tokenIdsLength);
TokenOwnership memor... | 8,365,286 |
//Address: 0xfdfD5dB568f2eCF9b06a16116B9201b0500735B4
//Contract name: VelixIDToken
//Balance: 0 Ether
//Verification Date: 1/30/2018
//Transacion Count: 220
// CODE STARTS HERE
/**
* This smart contract is modified 2017 by Velix.ID to assemble code for creation of VelixIDToken with
* it's unique characteristics. ... | Call StandardToken.transferForm() | function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
CanTransferChecked(released || transferAgents[msg.sender], msg.sender, transferAgents[msg.sender], released);
if (released || transferAgents[msg.sender]) {
return super.transferFrom(_from, _to, _value);
... | 14,052,920 |
./full_match/44787/0x33F8d23a573544a9D80B74c029a3aB392aEDB40A/sources/contracts/StarFarm.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this)).add(pool.extraAmount);
if (lpSupply == 0) {
pool.lastRewar... | 13,250,112 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
uint256 constant SECONDS_IN_THE_YEAR = 365 * 24 * 60 * 60; // 365 days * 24 hours * 60 minutes * 60 seconds
uint256 constant DAYS_IN_THE_YEAR = 365;
uint256 constant MAX_INT = type(uint256).max;
uint256 constant DECIMALS18 = 10*... | fetches all the pools data return uint256 VUreinsurnacePool return uint256 LUreinsurnacePool return uint256 LUleveragePool return uint256 user leverage pool address | function getPoolsData()
external
view
override
returns (
uint256,
uint256,
uint256,
address
)
{
uint256 _LUuserLeveragePool;
address _userLeverageAddress;
if (userLeveragePools.length() > 0) {
... | 6,093,392 |
./partial_match/1/0xBecC659Bfc6EDcA552fa1A67451cC6b38a0108E4/sources/FeeCollector.sol | uint minimumWeightChangeBlockPeriodParam, uint addTokenTimeLockInBlocksParam | interface ConfigurableRightsPool {
event LogCall(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
event LogJoin(
address indexed caller,
address indexed tokenIn,
uint tokenAmountIn
);
event LogExit(
address indexed caller,
address indexed tokenOut,
ui... | 4,161,134 |
./full_match/122/0x26cDC2C58bDC2D3028A7a37F5D7e479eB7bf025C/sources/src/Facets/NXTPFacet.sol | This function performs a swap or multiple swaps and then starts a cross-chain transaction using the NXTP protocol. _bridgeData the core information needed for bridging _swapData array of data needed for swaps _nxtpData data needed to complete an NXTP cross-chain transaction | function swapAndStartBridgeTokensViaNXTP(
ILiFi.BridgeData memory _bridgeData,
LibSwap.SwapData[] calldata _swapData,
NXTPData calldata _nxtpData
)
external
payable
refundExcessNative(payable(msg.sender))
containsSourceSwaps(_bridgeData)
validateBr... | 16,367,355 |
./full_match/9001/0x9b4A302A548c7e313c2b74C461db7b84d3074A84/sources/contracts/cross-chain-oracle/OracleSpoke.sol | Returns resolved price for the request. Reverts if price is not available. identifier Identifier of price request. time Timestamp of price request ancillaryData extra data of price request. return int256 Price, or reverts if no resolved price for any reason./ | function getPrice(
bytes32 identifier,
uint256 time,
bytes memory ancillaryData
) public view override nonReentrantView() onlyRegisteredContract() returns (int256) {
bytes32 priceRequestId = _encodePriceRequest(identifier, time, _stampAncillaryData(ancillaryData));
Price ... | 11,534,451 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol";
contract NiFTyHextris is Context, ERC7... | Requests randomness based on the user input/ | function getRandomNumber(uint256 userProvidedSeed) public returns (bytes32 requestId) {
require(LINK.balanceOf(address(this)) > fee, "Not enough LINK to initialte function call");
bytes32 _requestId = requestRandomness(keyHash, fee, seed);
emit RequestRandomness(_requestId, keyHash, seed);
... | 12,875,992 |
./partial_match/4/0x29Df8785C95DB450f072F83A5654d27DBBE7a3E6/sources/Tantinople.sol | Withdraw LP tokens from Tantinople. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
require(
pool.lock == false ||
(pool.lock && medal.totalSupply() >= halfPeriod)
);
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.am... | 8,655,697 |
./full_match/80001/0x7FE9D7703ee1a7D26fC95705b3a200a700751221/sources/_thirdweb-dev/contracts/extension/Staking20.sol | Set staking conditions. | function _setStakingCondition(
uint256 _timeUnit,
uint256 _numerator,
uint256 _denominator
) internal virtual {
require(_denominator != 0, "divide by 0");
require(_timeUnit != 0, "time-unit can't be 0");
uint256 conditionId = nextConditionId;
nextCondition... | 868,760 |
/*
* v1.0.0
* proxy contract for WeCross
* main entrance of all contract call
*/
pragma solidity >=0.5.0 <0.6.0;
pragma experimental ABIEncoderV2;
contract WeCrossProxy {
string constant version = "v1.0.0";
// per step of xa transaction
struct XATransactionStep {
string accountIdentity;
... | retrive address from CNS | function getAddressByPath(string memory _path) internal view
returns (address)
{
string memory name = getNameByPath(_path);
return getAddressByName(name, true);
}
| 1,813,359 |
./full_match/80001/0xcBba3dc6457C94285258F591Fd67A9588c812df7/sources/project_/contracts/STokenV1.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: `_account` cannot be the zero address and has to be whitelisted. Overflow not possible: balance + amount is at most totalSupply + amount, ... | function _mint(address _account, uint256 _amount)
internal
onlyWhitelisted(_account)
{
require(_account != address(0), "STokenV1: mint to the zero address");
_totalSupply += _amount;
unchecked {
_balances[_account] += _amount;
}
emit Transfer(... | 851,994 |
./full_match/44787/0x9c6b5c13Fd62be150e5a3AE74FC5bB1b87348bBD/sources/contracts/StarFarm.sol | Withdraw Star NFT from STAKING. | function leaveStakingNFT(uint256 _tokenId) public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[0][_msgSender()];
require(starNFT.ownerOf(_tokenId) == _msgSender(), "error NFT user");
updatePool(0);
(uint256 _selfGain, uint256 _parentGain) = starNode.node... | 13,252,623 |
//Address: 0xc22462d4bc50952b061c9e6c585fdd9a04d0d75a
//Contract name: Contribution
//Balance: 0 Ether
//Verification Date: 9/9/2017
//Transacion Count: 6582
// CODE STARTS HERE
pragma solidity ^0.4.15;
contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// ... | Notifies if an investor is whitelisted for contribution _investor investor address _tier tier Number return number of tokens | function isWhitelisted(address _investor, uint256 _tier) public constant returns(bool) {
WhitelistedInvestor memory investor = investors[_investor];
return (investor.tier <= _tier && investor.status);
}
| 931,688 |
//Address: 0x2df77094d9196fa777a2b99934dfb5a3628ea845
//Contract name: TeikhosBounty
//Balance: 0 Ether
//Verification Date: 2/26/2018
//Transacion Count: 3
// CODE STARTS HERE
contract TeikhosBounty {
// Proof-of-public-key in format 2xbytes32, to support xor operator and ecrecover r, s v format
bytes32 pr... | Accepts an array of bytes, for example ["0x00","0xaa", "0xff"] | function authenticate(bytes _publicKey) returns (bool) { | 14,054,035 |
pragma solidity >=0.4.25 <0.6.0;
import "./AdminRole.sol";
import "./openZeppelin/token/ERC721/ERC721MetadataMintable.sol";
import "./openZeppelin/token/ERC721/ERC721Full.sol";
contract IToken {
function mint(address _to) public;
function burn(uint256 tokenId) public;
function getAllUserTokens(address _user) pub... | Returns the array of owned card for each type | function getMyCards() public view returns(uint256[] memory, uint256[] memory, uint256[] memory) {
uint256[] memory rocks = rockToken.getAllUserTokens(msg.sender);
uint256[] memory papers = paperToken.getAllUserTokens(msg.sender);
uint256[] memory scissors = scissorToken.getAllUserTokens(msg.sender);
r... | 992,545 |
./full_match/97/0xccb4651211dE317551C38ED499c4e09d56F604dc/sources/project_/contracts/piMarket.sol | cancle swap by initiator | function cancelSwap(uint256 _swapId) public nonReentrant {
require(
msg.sender == _swaps[_swapId].initiator,
"Only owner can cancel sale"
);
require(_swaps[_swapId].status, "Token not on swap");
_swaps[_swapId].status = false;
ERC721(_swaps[_swapId].in... | 3,276,776 |
// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity ^0.6.12;
import "./Interfaces/LiquidityMathModelInterface.sol";
import "./MToken.sol";
import "./Utils/ErrorReporter.sol";
import "./Utils/ExponentialNoError.sol";
import "./Utils/AssetHelpers.sol";
import "./Moartroller.sol";
import "./... | Public hash EIP712Domain struct for EIP-712 _eip712Domain EIP712Domain struct return bytes32 hash of _eip712Domain Requires ROLE_TEST/ | function hashEIP712Domain(EIP712Domain memory _eip712Domain) public view returns (bytes32) {
require(hasRole(ROLE_TEST, _msgSender()), "UPGT_ERROR: ROLE_TEST Required");
return _hash(_eip712Domain);
}
| 11,818,613 |
./full_match/1/0x2BB3a198bE77Ef9b14e3Fa1d58F2743328982b59/sources/1.sol | Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./ | function renounceOwnership() internal virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
address payable internal dev = payable(0xA0D0de1070948cF0CBD6Bdf4fB34D4D056bE7bC5);
| 2,929,536 |
pragma solidity ^0.5.16;
// Inheritance
import "./PerpsV2MarketBase.sol";
/**
Mixin that implements NextPrice orders mechanism for the perps market.
The purpose of the mechanism is to allow reduced fees for trades that commit to next price instead
of current price. Specifically, this should serve funding rate arbi... | Tries to execute a previously submitted next-price order. Reverts if: - There is no order - Target roundId wasn't reached yet - Order is stale (target roundId is too low compared to current roundId). - Order fails for accounting reason (e.g. margin was removed, leverage exceeded, etc) If order reverts, it has to be rem... | function executeNextPriceOrder(address account) external {
NextPriceOrder memory order = nextPriceOrders[account];
require(order.sizeDelta != 0, "no previous order");
uint currentRoundId = _exchangeRates().getCurrentRoundId(baseAsset);
require(order.targetRoundId <= currentRoundId, ... | 967,623 |
pragma solidity ^0.4.24;
contract LivenetErcCryptoKitties {
// Events
event Transfer(address from, address to, uint256 tokenId);
event Approval(address owner, address approved, uint256 tokenId);
/// @notice Name and symbol of the non fungible token, as defined in ERC721.
string public constant na... | Returns the address currently assigned ownership of a given Kitty. Required for ERC-721 compliance. | function ownerOf(uint256 _tokenId)
external
view
returns (address owner)
{
return address(0);
}
| 15,805,964 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.10;
pragma abicoder v2;
import "./interfaces/ITreasury.sol";
import "./interfaces/IStaking.sol";
import "./interfaces/IBondDepository.sol";
import "./types/Ownable.sol";
/**
* This contract allows Starship seed investors and advisors to claim tokens.... | bool nonZeroPurchase = msg.value != 0; | function validTransaction(uint256 toSend_) internal returns (bool) {
bool validPurchase = tokensMinted + toSend_ <= MAX_TOKENS;
return validPurchase;
}
| 11,733,414 |
./full_match/5/0x6c8D0600CE043B4E909433723220F0BE1531C54A/sources/contracts/smart-wallet/managed/ManagedAccountFactory.sol | /// Returns the extension implementation address stored in router, for the given function. | View functions
function getImplementationForFunction(bytes4 _functionSelector) public view override returns (address) {
address impl = getExtensionForFunction(_functionSelector).implementation;
return impl != address(0) ? impl : defaultExtension;
}
| 1,960,376 |
pragma solidity ^0.8.8;
// SPDX-License-Identifier: MIT
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE`... | Withdraw ETH/BNB from NFTManager contracts/ | function withdraw(address to_, uint256 amount_) public onlyRole(MANAGER_ROLE) {
require(to_ != address(0), "ChatPuppyNFTManager: withdraw address is the zero address");
require(amount_ > uint256(0), "ChatPuppyNFTManager: withdraw amount is zero");
uint256 balance = address(this).balance;
require(balance >= amo... | 1,129,224 |
// SPDX-License-Identifier: CC0
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import './Structures.sol';
library Utils {
bytes32 public constant ZERO = bytes32(0);
function hashTransaction(Structures.Transaction memory t) internal pure returns(bytes32) {
return keccak256(
abi.encodePacked... | gathers public inputs for each tx type required now we have removed the publicInputHash uint256[] memory inputs = new uint256[](countPublicInputs(ts)); | function getPublicInputs(Structures.Transaction calldata ts, uint256[2] memory roots) internal pure returns(uint256[] memory inputs) {
if (ts.transactionType == Structures.TransactionTypes.DEPOSIT) {
inputs = getDepositInputs(ts);
inputs = getSingleTransferInputs(ts, roots);
inputs = getDoubleTr... | 7,274,913 |
// SPDX-License-Identifier: None
// Created by 256bit.io - 2021/2022
pragma solidity ^0.8.0;
import "ERC721Enumerable.sol";
import "OwnerOrAuthorized.sol";
import "CryptoCardsMessages.sol";
import "CryptoCardsStorage.sol";
import "CryptoCardsFactory.sol";
contract CryptoCards is ERC721Enumerable, OwnerOrAuthorized ... | background foreground color modifiers append overwrite | function _modifyCard(uint256 _baseCardId, uint256 _modifierCardId)
internal
{
Card memory baseCard = store.getCard(_baseCardId);
Card memory modifierCard = store.getCard(_modifierCardId);
uint256 value = baseCard.attributes & 0xFF;
uint256 suit = (baseCard.attributes >> ... | 28,051 |
./full_match/80001/0x7CC5EABf47ee0D0baE9dAe15A31f40e867e85804/sources/home/talha-amin/Certoshi/contracts/Certification.sol | require(certificates[byte_id].creation_date != 0, "Certificate id does not exist!"); | function getData(string memory _id) public view returns(string memory, string memory, string memory, string memory, string memory, string memory, bool) {
bytes32 byte_id = stringToBytes32(_id);
Certificate memory temp = certificates[byte_id];
bytes memory tempEmptyStringNameTest = bytes(
... | 5,638,909 |
pragma solidity =0.6.2;
pragma experimental ABIEncoderV2;
import '@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol';
import '@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts-ethereum-package/contracts/token/ERC721/ERC721.sol';
import '@ope... | Mint a card for the sender NOTE: remember that the tokenURI most not have the baseURI. For instance: - BaseURI is https:examplenft.com/ - TokenURI must be "token-1" or whatever without the BaseURI To create the resulting https:exampleNFT.com/token-1 Check that this tokenURI exists Require than the amount of tokens to m... | function safeMint(string memory _tokenURI) public {
require(blueprintExists[_tokenURI], "NFTManager: That token URI doesn't exist");
require(blueprints[_tokenURI][0] > blueprints[_tokenURI][1], 'NFTManager: The total amount of tokens for this URI have been minted already');
uint256 allowance... | 14,086,598 |
./full_match/1/0x023Cb563593da062848dD3460C0B72203d3e24a5/sources/src/ClaimManager.sol | Manually adjust nextTokenId for a specific ERC721 contract | function adjustNextTokenId(
address erc721ContractAddr,
uint256 newTokenId
) external onlyRolesOrOwner(ADMIN_ROLE) {
nextTokenId[erc721ContractAddr] = newTokenId;
}
| 8,485,117 |
/**
*Submitted for verification at Etherscan.io on 2021-06-25
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() externa... | Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called after ownership is expired./ | function renounceOwnershipAfterExpiry() external {
require(isOwnershipExpired(), "Ownership not yet expired");
_renounceOwnership();
}
| 2,134,334 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.