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/4/0x237c7cBA26F1B6bFEf5c103ad6206A3d957E714d/sources/HSU_MANAGER.sol
stake visibility is public as overriding LPTokenWrapper's stake() function update myown info
function stake(uint256 _amount,address _invite) public updateReward(msg.sender) checkhalve { require(_amount > 0, "Cannot stake 0"); require(_invite != msg.sender ,"invite cannot be yourself" ); if (serialAddr[msg.sender]==0){ serialAddr[msg.sender]=counter; counter =...
8,749,936
pragma solidity 0.6.6; import "./token/ERC20/ERC20.sol"; import "./token/ERC20/SafeERC20.sol"; import "./access/Ownable.sol"; import "./math/SafeMath.sol"; /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually * like a typical vesting scheme, with a cliff and vestin...
Allows the owner to revoke the vesting. Tokens already vested remain with the contract, the rest are returned to the owner./
function revoke() public onlyOwner { require(!revoked); uint256 balance = token.balanceOf(address(this)); uint256 withdrawable = withdrawableAmount(); uint256 refund = balance.sub(withdrawable); revoked = true; token.safeTransfer(owner(), refund); emit Revoked(); }
12,689,542
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import '@openzeppelin/contracts/math/SafeMath.sol'; import '../interfaces/IGoSwapPair.sol'; import '../interfaces/IGoSwapFactory.sol'; import '../interfaces/IGoSwapCompany.sol'; /** * @title GoSwap库合约 */ library GoSwapLibrary { using SafeMath for uint256;...
获取pair合约地址 计算一对的CREATE2地址,而无需进行任何外部调用 company 配对寻找工厂地址 tokenA TokenA tokenB TokenB return pair pair合约地址/ 通过配对寻找工厂合约排序token地址 获取pairCodeHash根据排序的token地址计算create2的pair地址
function pairFor( address company, address tokenA, address tokenB ) internal pure returns (address pair) { address factory = IGoSwapCompany(company).pairForFactory(tokenA, tokenB); (address token0, address token1) = sortTokens(tokenA, tokenB); bytes32 pairCodeHash...
6,411,638
/* Copyright 2019 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...
Fetches all RebalancingSetToken state associated with a rebalance proposal _rebalancingSetToken RebalancingSetToken contract instance return RebalancingLibrary.State Current rebalance state on the RebalancingSetToken return address[] Auction proposal library and next allocation Se...
function fetchRebalanceProposalStateAsync( IRebalancingSetToken _rebalancingSetToken ) external returns (RebalancingLibrary.State, address[] memory, uint256[] memory) { RebalancingLibrary.State rebalanceState = _rebalancingSetToken.rebalanceState(); address[] memory ...
13,015,295
pragma solidity ^0.4.19; library SafeMath { /* @return sum of a and b */ function ADD (uint256 a, uint256 b) pure internal returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } /* @return difference of a and b */ functio...
Withdraw the funds Checks to see if goal or time limit has been reached, and if so, and the funding goal was reached, sends the entire amount to the beneficiary. If goal was not reached, each contributor can withdraw the amount they contributed./If we fail to send the funds to beneficiary, unlock funders balance
function safeWithdrawal() afterDeadline public { if (!fundingGoalReached) { uint amount = balanceOf[msg.sender]; balanceOf[msg.sender] = 0; if (amount > 0) { if (msg.sender.send(amount)) { FundTransfer(msg.sender, amount, false); ...
1,056,558
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner,...
Allows user to buy a team from the old owner. Pays old owner minus commission, updates price. _teamId id of the team they're trying to buy/ Making sure token owner is not sending to self Safety check to prevent against an unexpected 0x0 default. Making sure sent amount is greater than or equal to the sellingPrice Pay...
function purchase(uint _teamId) public payable { address oldOwner = ownerOf(_teamId); address newOwner = msg.sender; uint sellingPrice = teamIndexToPrice[_teamId]; require(oldOwner != newOwner); require(_addressNotNull(newOwner)); require(msg.value >= sellingPrice); ui...
1,518,037
/** *Submitted for verification at Etherscan.io on 2022-02-17 */ // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from...
========== purchase ==========
function Purchase(uint256 _mint_amount) public payable nonReentrant { uint256 minted_supply = totalSupply(); require(_mint_amount > 0, "at least 1"); require(minted_supply + _mint_amount <= supply, "supply exceeded"); if (msg.sender != owner()) { require(!pause, "contrat is paused"); requi...
10,509,359
./partial_match/56/0xb48556c14D1238C4FD43a74C782FBf719b768994/sources/MasterChef.sol
Withdraw LP tokens from MasterChef.
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accOmgPerShare...
11,218,337
pragma solidity ^0.5.13; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "../common/CalledByVm.sol"; import "../common/FixidityLib.sol"; import "../common/Initializable.sol"; import "../common/UsingRegistry.sol"; import "../common/Usin...
Sets the community reward percentage value The percentage of the total reward to be sent to the community funds. return True upon success./
function setCommunityRewardFraction(address partner, uint256 value) public onlyOwner returns (bool) { require( partner != communityPartner || value != communityRewardFraction.unwrap(), "Partner and value must be different from existing carbon community fund" ); requir...
12,553,287
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; import "./interfaces/ISecondChance.sol"; import "./lib/@openzeppelin/math/SafeMath.sol"; import "./lib/@openzeppelin/token/ERC20/IERC20.sol"; contract RugSanctuary { using SafeMath for uint256; address public second; //token address address ...
Withdraw tokens from Vault. Withdraws will be locked for 10 days when the protocol starts, then will open There is a penalty on WD: 25% of Univ2 stays locked/
function withdraw(uint256 _pid, uint256 _amount) external NoReentrant(msg.sender) { lastTXBlock[msg.sender] = block.number+1; transferTreasuryFees(); }
13,106,045
./partial_match/1/0xd1DE064281745F576eBa9cBff251aB031A0B8e99/sources/MICSUSHIPool.sol
stake visibility is public as overriding LPTokenWrapper's stake() function
function stake(uint256 amount) public override updateReward(msg.sender) checkStart { require(amount > 0, 'MICSUSHIPool: Cannot stake 0'); uint256 newDeposit = deposits[msg.sender].add(amount); deposits[msg.sender] = newDeposit; super.stake(amount)...
15,993,280
pragma solidity ^0.4.11; contract owned { address public owner; function owned() { owner = msg.sender; } modifier onlyOwner { if (msg.sender == owner) _; } } contract tokenRecipient { function receiveApproval(address ...
Get balance of specific address /
function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; }
10,838,544
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/to...
calculates the rewards account the account to calculate the rewards for return the rewards for the account
function getPending(address account) public view returns(uint) { UserInfo memory user = stakes[account]; uint totalAmount = user.amount + user.pastPending; return user.divisor == 0 ? 0 : (totalAmount * multiplier) / user.divisor - user.amount; }
1,090,145
./partial_match/1/0xe364A4F9b73F05B5E18fA08F09C1E7a7ef62D207/sources/StakingPoolV2.sol
withdraw extra reward tokens after staking period
function withdrawAll() external onlyOwner { require(currentTime() > periodFinish, "period not finished"); uint256 bal = rewardToken.balanceOf(address(this)); uint256 amount = bal.sub(totalSupply()); IERC20(rewardToken).safeTransfer(owner(), amount); }
4,295,090
./full_match/80001/0x72268D5587ce2e162889F7F9966234D2bEb0FEEA/sources/project_/contracts/MysticGalacticMission1.sol
Revokes the ADMIN_ROLE from the specified account. Can only be called by the contract owner. Emits an AdminRoleRevoked event upon successful removal. account The address of the account to have the ADMIN_ROLE revoked./
function revokeAdminRole(address account) public onlyOwner { revokeRole(ADMIN_ROLE, account); emit AdminRoleRevoked(account); } event AdminRoleRevoked(address account);
842,935
pragma solidity 0.5.13; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract ERC721 { function transferFrom(address from, address to, uint256 tokenId) public; } /** * @title Secret Santa with NFTs (www.secrethsanta.co) * @notice All the logic of the contract happens here * @dev This new contract...
Sends a present tokenAddress The address of the contract tokenId The id of the token/
function sendPresent( address tokenAddress, uint256 tokenId ) external { require( lastPresentAt + prizeDelay > now, "Too late" ); require( whitelist[tokenAddress], "Token not whitelisted" ); ERC721 token = ...
7,271,364
// File: @aragon/os/contracts/common/UnstructuredStorage.sol /* * SPDX-License-Identitifer: MIT */ pragma solidity ^0.4.24; library UnstructuredStorage { function getStorageBool(bytes32 position) internal view returns (bool data) { assembly { data := sload(position) } } function getStorage...
Add `_token.symbol(): string` to the accepted deposit token request tokens _token token address/
function addToken(address _token) external auth(MODIFY_TOKENS_ROLE) { require(!acceptedDepositTokens.contains(_token), ERROR_TOKEN_ALREADY_ACCEPTED); require(acceptedDepositTokens.length < MAX_ACCEPTED_DEPOSIT_TOKENS, ERROR_TOO_MANY_ACCEPTED_TOKENS); if (_token != ETH) { require...
7,311,604
// SPDX-License-Identifier: MIT 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 functions. * * By default, the owner account will be the on...
return addresses and token amounts of bonded validators/
function getBondedValidatorsTokens() public view returns (dt.ValidatorTokens[] memory) { dt.ValidatorTokens[] memory infos = new dt.ValidatorTokens[](bondedValAddrs.length); for (uint256 i = 0; i < bondedValAddrs.length; i++) { address valAddr = bondedValAddrs[i]; infos[i] = ...
260,754
/* ███████╗ ██████╗ ██╗ ██╗ ██████╗ █████╗ ███╗ ███╗███████╗ ██╔════╝██╔═══██╗╚██╗██╔╝ ██╔════╝ ██╔══██╗████╗ ████║██╔════╝ █████╗ ██║ ██║ ╚███╔╝ ██║ ███╗███████║██╔████╔██║█████╗ ██╔══╝ ██║ ██║ ██╔██╗ ██║ ██║██╔══██║██║╚██╔╝██║██╔══╝ ██║ ╚██████╔╝██╔╝ ██╗ ╚██████╔╝██║ ██║██║ ╚═╝...
Override NFT token uri. Calls into traits contract./
function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "nonexistent token"); return foxTraits.tokenURI(uint16(tokenId)); }
13,504,605
// File @aragon/os/contracts/common/UnstructuredStorage.sol@v4.4.0 /* * SPDX-License-Identifier: MIT */ pragma solidity ^0.4.24; library UnstructuredStorage { function getStorageBool(bytes32 position) internal view returns (bool data) { assembly { data := sload(position) } } function getSt...
Force cast the bytes array into a uint256[], by overwriting its length Note that the uint256[] doesn't need to be initialized as we immediately overwrite it with the input and a new length. The input becomes invalid from this point forward.
function dangerouslyCastBytesToUintArray(bytes memory _input) internal pure returns (uint256[] memory output) { uint256 intsLength = _input.length / 32; require(_input.length == intsLength * 32, ERROR_IMPROPER_LENGTH); assembly { output := _input mstore(output, intsL...
172,809
./full_match/8453/0xB287fA676198938fC2a098a546bF9e0368FF58Ad/sources/src/plugins/governance/multisig/Multisig.sol
Initializes Release 1, Build 2. This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822). _dao The IDAO interface of the associated DAO. _members The addresses of the initial members to be added. _multisigSettings The multisig settings.
function initialize( IDAO _dao, address[] calldata _members, MultisigSettings calldata _multisigSettings ) external initializer { __PluginUUPSUpgradeable_init(_dao); if (_members.length > type(uint16).max) { } _addAddresses(_members); _updateMul...
11,550,303
// SPDX-License-Identifier: MIT /* _ __ __ ____ _ ____ _ _ _ / \ | \/ | _ \| | / ___| ___ | | __| | (_) ___ / _ \ | |\/| | |_) | | | | _ / _ \| |/ _` | | |/ _ \ / ___ \| | | | __/| |__| |_| | (_) | | (_| | _ | | (_) | /_/ \_\_| |_|_| |_____\____|\...
Sets the reference to the AMPLG token governed. Can only be called once during initialization. amplg_ The address of the AMPLG ERC20 token./
function setAMPLG(IAMPLG amplg_) external onlyOwner { require(amplg == IAMPLG(0)); amplg = amplg_; }
1,575,248
./partial_match/1/0xe6F4d9711121e5304b30aC2Aae57E3b085ad3c4d/sources/src/base/Pool.sol
@inheritdoc IPoolState
function loansInfo() external view override returns (address, uint256, uint256) { Loan memory maxLoan = Loans.getMax(loans); return ( maxLoan.borrower, Maths.wmul(maxLoan.thresholdPrice, inflatorState.inflator), Loans.noOfLoans(loans) ); }
3,629,845
/** *Submitted for verification at Etherscan.io on 2021-08-02 */ // File: @sygnum/solidity-base-contracts/contracts/helpers/Initializable.sol pragma solidity 0.5.12; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that ha...
Updates the category of the token, only callable by Sygnum operator. category_ The new cateogry./
function updateCategory(bytes4 category_) public onlyOperator { _category = category_; emit CategoryUpdated(msg.sender, _category, address(this)); }
2,087,904
pragma solidity 0.4.24; import "./RoleCreator.sol"; import "../../interaction/interface/IAuthorization.sol"; import "../lib/ContractCheck.sol"; import "../lib/AddressArray.sol"; import "../../interaction/interface/IRoleAuth.sol"; /// @title Authorization about role and account /// @author ["Rivtower Technologies <con...
Set the role to the account _account The account to be setted _role The role to be setted return true if successed, otherwise false Set role permissions to account.
function setRole(address _account, address _role) external onlyRoleManagement returns (bool) { if (!AddressArray.exist(_role, roles[_account])) { roles[_account].push(_role); require(_setRolePermissions(_account, _role), "setRolePermissions failed."); ...
2,508,118
./full_match/5/0x580a8cdC8432a58619f89b2b71247f59Fd4ceFd2/sources/src/BasedPowells.sol
Collects and distributes the primary sale value of NFTs being claimed.
function _collectPriceOnClaim( address _primarySaleRecipient, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken ) internal override { if (_pricePerToken == 0) { return; } uint256 totalPrice = computePrice(_pricePerToken, _qua...
1,918,004
/** *Submitted for verification at Etherscan.io on 2021-10-24 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarv...
Sells our harvested CRV into the selected output (ETH).
function _sellCrvforETH(uint256 _crvAmount) internal { address[] memory crvPath = new address[](2); crvPath[0] = address(crv); crvPath[1] = address(weth); IUniswapV2Router02(sushiswap).swapExactTokensForETH( _crvAmount, uint256(0), crvPath, ...
10,934,283
./partial_match/3/0x6F710A988856d3497C15ED606400d7ff5EEB5485/sources/FLExToken.sol
Send _value amount of tokens from address _from to address _to The transferFrom method is used for a withdraw workflow, allowing contracts to send tokens on your behalf, for example to "deposit" to a contract address and/or to charge fees in sub-currencies; the command should fail unless the _from account has deliberat...
function transferFrom( address _from, address _to, uint256 _amount ) public returns (bool success) { if (balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > bal...
5,255,601
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; /* Library Imports */ import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol"; import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; /* Interface Imports */ import { iOVM_ChainStorageContainer } from ".....
@inheritdoc iOVM_ChainStorageContainer/
function setNextOverwritableIndexByChainId( uint256 _chainId, uint256 _index ) override public onlyOwner { buffers[_chainId].nextOverwritableIndex = _index; }
13,034,831
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // 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 pr...
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 the hope that it will be useful, but WITHOUT ANY ...
interface IBFactory { function collectedToken() external view returns(address); }
2,076,636
./full_match/1/0xe390D9F53544Ac7B91883fb88019F77B5333f2A3/sources/contracts/CctpBridgeAdapter.sol
deploys worker on source chain and performs sending from it to - address(0) in case of root vault deposit
function sendAssets( uint256 value, address to, uint8 slippage ) external override returns (bytes32 transferId) { bool notifyVault = (msg.sender == address(crossLedgerVault)); require((to != address(0)) || (notifyVault), "Can't deposit to vault without notification"); bytes memory data = abi.encode(Tr...
8,417,729
pragma solidity 0.6.6; import "./token/ERC20/ERC20.sol"; import "./token/ERC20/SafeERC20.sol"; import "./access/Ownable.sol"; import "./math/SafeMath.sol"; /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually * like a typical vesting scheme, with a cliff and vestin...
Transfers vested tokens to beneficiary. Only callable by beneficiary/
function withdraw() public { require(msg.sender == beneficiary); uint256 withdrawable = withdrawableAmount(); require(withdrawable > 0); withdrawnAmount = withdrawnAmount.add(withdrawable); token.safeTransfer(beneficiary, withdrawable); emit Withdrawal(withdrawable); }
12,689,541
./full_match/40/0xBe324Bf31dA002E9E1fFDeB31947eeb945aeCA6e/sources/src/Facets/MultichainFacet.sol
Contains the business logic for the bridge via Multichain _bridgeData the core information needed for bridging _multichainData data specific to Multichain check if sendingAsset is a Multichain token that needs to be called directly in order to bridge it call native asset bridge function
function _startBridge( IRubic.BridgeData memory _bridgeData, MultichainData memory _multichainData ) private { if (_multichainData.router == _bridgeData.sendingAssetId) { IMultichainERC20(_bridgeData.sendingAssetId).Swapout( _bridgeData.minAmount, ...
9,553,743
// 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....
Returns the principal debt balance of the user from user The user's address return The debt balance of the user since the last burn/mint action/
function principalBalanceOf(address user) external view virtual override returns (uint256) { return super.balanceOf(user); }
68,698
./full_match/1/0x0ccac5f1a9D024ec962e1F51471eA69A188F30C2/sources/browser/test.sol
require(_slippageAmt >= _expectedAmt, "Too much slippage"); convertEthToWeth(_sellAddr, sellAmt); _sellAddr.approve(getOasisAddr(), _sellAmt); _buyAmt = oasisContract.sellAllAmount( address(_sellAddr), _sellAmt, address(_buyAddr), _slippageAmt ); convertWethToEth(_buyAddr, _buyAmt); emit LogSell(address(_...
function sell( address buyAddr, address sellAddr, uint buyAmt, uint sellAmt, uint slippage, uint getId ) external view returns (uint _buyAmt, uint _sellAmt, uint _slippageAmt, uint _expectedAmt){ _sellAmt = getId; _buyAmt = _sellAmt == sellAmt ? b...
17,198,798
pragma solidity ^0.4.24; /** * @title Math * @dev Assorted math operations */ library Math { function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(ui...
un-freeze all the transfers/
function unfreezeTransfers() public onlyOwner { require(freeze); freeze = false; emit LogFreezeTransfers(freeze, now); }
319,749
./partial_match/1/0x25C7C475934f40908523a36d5d7ea810D890b50F/sources/contracts/universal/MultiSigWallet.sol
@inheritdoc IMultiSigWallet/
function getConfirmationCount(uint256 _transactionId) external view returns (uint256) { uint256 count = 0; mapping(address => bool) storage confirmation = confirmations[_transactionId]; for (uint256 i = 0; i < owners.length; ) { if (confirmation[owners[i]]) { unch...
16,187,024
/** *Submitted for verification at Etherscan.io on 2021-09-15 */ // File @openzeppelin/contracts/utils/introspection/[email protected] // SPDX-License-Identifier: MIT pragma solidity 0.8.6; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Impleme...
See {IERC165-supportsInterface}./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(in...
2,050,312
/** * @authors: [@ferittuncer] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [] */ pragma solidity >=0.5 <0.6.0; import "@kleros/erc-792/contracts/IArbitrable.sol"; import "@kleros/erc-792/contracts/erc-1497/IEvidence.sol"; import "@kleros/erc-792/contracts/IArbitrator.sol"; import "@kle...
Returns the contribution value and remainder from available ETH and required amount. _available The amount of ETH available for the contribution. _requiredAmount The amount of ETH required for the contribution. return taken The amount of ETH taken. return remainder The amount of ETH left from the contribution./
function calculateContribution(uint _available, uint _requiredAmount) internal pure returns(uint taken, uint remainder) { if (_requiredAmount > _available) remainder = _available - _requiredAmount; return (_requiredAmount, remainder); }
13,104,548
./full_match/4/0x8c95f00e8F1a10eFA53093dd50B4a5aaAC02Ddef/sources/contracts/BURNAND.sol
add an address to the whitelist addr address/
function addAddressToWhitelist(address addr, uint claimAmount) onlyOwner public returns(bool success) { require(!isWhitelisted(addr), "Already whitelisted"); whitelist[addr].addr = addr; whitelist[addr].claimAmount = claimAmount; whitelist[addr].hasMinted = 0; success = true;...
12,323,987
pragma solidity ^0.4.18; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) public pure returns(uint); function maxBalance() public pure returns(int); function isValidBet(uint8 _gameType, uint _betNum, uint _betValue) public pure returns(bool); function endGame...
Check if _sig is valid signature of _hash. Throws if invalid signature. _hash Hash to check signature of. _sig Signature of _hash. _address Address of signer./
function verify( bytes32 _hash, bytes _sig, address _address ) private pure { var (r, s, v) = signatureSplit(_sig); address addressRecover = ecrecover(_hash, v, r, s); require(addressRecover == _address); }
1,034,132
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 rateLimit; uint256 lastReport; uint256 totalDebt; uint256 totalGain; ...
Copied from https:github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol EIP-1167 bytecode
function cloneStrategy( address _vault, address _strategist, address _rewards, address _keeper, address _masterchef, address _reward, address _router, uint256 _pid ) external returns (address newStrategy) { bytes20 addressBytes = bytes20(ad...
1,610,427
./partial_match/42/0x2B8Da5Aa8B4FF47cC0D490bdc9a02BC02D630655/sources/UpkeepRegistryOwner.sol
read the total number of upkeep's registered/
function getUpkeepCount() external view returns ( uint256 ) { return s_upkeepCount; }
3,370,084
./partial_match/1/0x2F76e04eA25128670e54bA584C3fE822FA82BAe2/sources/Deelance_BSC_Claim.sol
only callable by owner, used to modify the token amount of a user
function modifyUserAmount(address _user, uint256 _newAmount) external onlyOwner { require(balances[_user] > 0, "User does not exist"); balances[_user] = _newAmount; }
2,801,236
pragma solidity ^0.6.0; /** * @title ERC20Basic */ interface ERC20Basic { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function transferFrom(address _from,...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./
function transfer(address _to, uint256 _value) public override virtual returns (bool) { require(_to != address(0), "trasferring to zero address"); require(_value <= balances[msg.sender], "transfer amount exceeds available balance"); require(!paused, "token transfer while paused"); ba...
2,084,282
//Address: 0xd5527579226e4ebc8864906e49d05d4458ccf47f //Contract name: Kubera //Balance: 0 Ether //Verification Date: 10/30/2017 //Transacion Count: 4643 // CODE STARTS HERE pragma solidity ^0.4.11; contract SafeMath { //internals function safeMul(uint a, uint b) internal returns(uint) { uint c = a...
if tokens have not been burned already and the ICO ended or Tokens have been sold out before ICO end.
function burn(){ if(!burned && ( now > startTime || tokensSoldToInvestors >= maxGoalInICO) ) { totalSupply = safeSub(totalSupply, balanceOf[owner]) + 900000000; uint tokensLeft = balanceOf[owner]; balanceOf[owner] = 0; balanceOf[tokensHolder] = 900000000; ...
12,996,363
pragma solidity ^0.4.25; // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint2...
solium-disable-line max-len, arg-overflow
function onTransferReceived(address operator, address from, uint256 value, bytes data) external returns (bytes4);
7,794,321
// SPDX-License-Identifier: GPL-3.0 // Forked from https://github.com/ourzora/core @ 450cd154bfbb70f62e94050cc3f1560d58e0506a pragma solidity >=0.8.4; pragma experimental ABIEncoderV2; import "./ERC721Burnable.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {Counte...
see IMedia/
function mintWithSig( address creator, MediaData memory data, IMarket.BidShares memory bidShares, EIP712Signature memory sig ) public override nonReentrant { require( sig.deadline == 0 || sig.deadline >= block.timestamp, "Media: mintWithSig expired...
2,541,361
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; pragma experimental ABIEncoderV2; contract TussleStaking { struct Stake { address staker; uint256 amount; uint256 adjusted; /// @dev adjusted staking amount which will be considered for PoS } Stake[] public stakes; uint256 public totalAdjust...
TODO: revert if less gas is sent
function stake() public payable { require(msg.value > 0, 'stake should be more than 0'); uint256 _adjusted = adjust(msg.value); uint256 _stakeId = stakes.length; stakes.push(Stake({ staker: msg.sender, amount: msg.value, adjusted: _adjusted })); totalAdjusted += _adjusted...
898,744
./partial_match/1313161554/0xE6720F974D6209C28DFD9f69Fff0789791d2480D/sources/BRLStrategy.sol
Id of pool. Amount of deposited want tokens. DEPOSIT/WITHDRAW/HARVEST EXTERNAL/ CLUSTERS LOCK INTERFACE/ Deposits tokens to Borealis protocol. _amount Amount of tokens to deposit.
function _rewardsInEth(uint256 _amount) internal view virtual returns (uint256); function _transferRewards(uint256 _addyRewardAmount) internal virtual; function _harvest() internal virtual returns (uint256); } function deposit(uint256 _amount) external override onlyRole(STRATEGY_ROUTER) { _h...
16,927,055
pragma solidity >=0.4.22 <0.6.0; pragma experimental ABIEncoderV2; //In the future the car needs to track if it was droppedoff at the right location and if the engine is off before the trip can be ended. So far we only track drop off offchain which is not ideal -> car needs to have a node and gps access contract Join {...
emit tripStart(tripAddress, tripKey, msg.sender, block.number);
function startTrip(address tripAddress, uint256 tripKey) public { require(addressMatch[tripAddress].offerList[tripKey].reservedAdress == msg.sender && addressMatch[tripAddress].offerList[tripKey].started == 0); addressMatch[tripAddress].offerList[tripKey].started = block.number; ...
1,082,698
./partial_match/1/0x4e9bBd716E045D2bA93a0cdf0e7aF7F34B9a4745/sources/CbmToken.sol
관리자에 의해서 토큰을 발급한다. 하지만 기본 요건은 갖춰야만 가능하다 _target 토큰 발급을 청구하려는 지갑 주소/ 화이트 리스트에 있어야만 하고 예약된 투자금이 있어야만 한다.
function claimApis(address _target) public { require(whiteList.isInWhiteList(_target) == true); require(fundersProperty[_target].reservedFunds > 0); withdrawal(_target); }
2,643,900
./partial_match/1/0x98b7893C5717aF41d3e351c6e3445Be02a062A90/sources/contracts/MapleLoan.sol
Returns principal and interest portions of a payment instalment, given generic, stateless loan parameters. NOTE: If a lack of precision in `_scaledExponent` results in a `raisedRate_` smaller than one, assume it to be one and simplify the equation.
function _getInstallment( uint256 principal_, uint256 endingPrincipal_, uint256 interestRate_, uint256 paymentInterval_, uint256 totalPayments_ ) internal pure returns (uint256 principalAmount_, uint256 interestAmount_) { \*****************************...
3,924,825
pragma solidity ^0.4.23; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint...
return true if ico is open
function isIcoOpen() public view returns (bool) { bool capReached = tokenSold >= icoCap; return !capReached; } @param _tokenSold - amount of token sold @param _purchaseAmount - amount of token want to purchase @return true if _purchaseAmount is allowed
6,046,194
/** *Submitted for verification at Etherscan.io on 2021-09-23 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarv...
Used to change `maxReportDelay`. `maxReportDelay` is the maximum number of blocks that should pass for `harvest()` to be called. For external keepers (such as the Keep3r network), this is the maximum time between jobs to wait. (see `harvestTrigger()` for more details.) This may only be called by governance or the ...
function setMaxReportDelay(uint256 _delay) external { _onlyAuthorized(); maxReportDelay = _delay; emit UpdatedMaxReportDelay(_delay); }
15,164,035
./full_match/3/0xf6d0B298e8B442AE851002Ed8a58f994A18A1edc/sources/Project3.sol
Returns the bep token owner./
function getOwner() external view override returns (address) { return owner(); }
14,174,533
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import { MerkleTreeLib as Merkle } from "./merkle/MerkleTreeLib.sol"; library TransactionsLib { enum TransactionType { HARD_CREATE, HARD_DEPOSIT, HARD_WITHDRAW, HARD_ADD_SIGNER, SOFT_WITHDRAW, SOFT_CREATE, SOFT_TRANSFER, SOFT_...
Add 33 to skip length and prefix
function decodeSoftChangeSigner(bytes memory input) internal pure returns (SoftChangeSigner memory) { uint24 nonce; uint32 fromIndex; address signingAddress; uint8 modificationCategory; uint8 sigV; bytes32 sigR; bytes32 sigS; bytes32 intermediateStateRoot; assembly { let pt...
5,452,369
./partial_match/4/0xBdda03cbBfB0a7C5b1b076F82F08A976529d84dF/sources/Xeth.sol
increase totalSupply get underlying value increase initSupply make sure the mint didnt push maxScalingFactor too low add balance
function _mint(address to, uint256 amount) internal { _totalSupply = _totalSupply.add(amount); uint256 xETHValue = amount.mul(internalDecimals).div(xETHScalingFactor); initSupply = initSupply.add(xETHValue); require(xETHScalingFactor <= _maxScalingFactor(), "max scaling factor...
8,503,579
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* import "Initiative_Legislative_lib.sol"; import "Citizens_Register.sol"; import "IVote.sol"; */ import "contracts/Initiative_Legislative_lib.sol"; import "contracts/Citizens_Register.sol"; import "contracts/IVote.sol"; /** * @notice In the ancient Greece t...
Once the referendum proposition has been executed (EXECUTED value of {status} enum), each citizen that has voted can get his DemoCoin token reward. If proposition proposition had a validation stage, then accounts must have voted AND validated their vote for getting their rewards. register_address Address of the regist...
function Get_Voter_Reward(address register_address, bytes32 referendum_key)external { require(Referendums_Registers[register_address].Last_Version!=0,"Register unknown"); require(!Referendums[referendum_key].Voter_Rewarded[msg.sender], "Voter already rewarded"); require(Referendums[referendu...
5,420,051
pragma solidity ^0.5.0; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts/GSN/GSNRecipient.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./GasDiscounter.sol"; import "./EarnedInterestERC20...
If relay balance > 10 transactions
function _compensateGas(uint256 gasSpent) internal { uint256 actualCharge = tx.gasprice.mul(gasSpent); uint256 ethPrice = uniswap.getEthToTokenInputPrice(actualCharge); uint256 daiNeeded = actualCharge.mul(1e18).div(ethPrice); if (IRelayHub(getHubAddr()).balanceOf(address(this)) > t...
12,626,078
./partial_match/62320/0x6618A3EBa94A769AA94c4f0d1669dCC5069B0C7D/sources/contracts/common/Proxy.sol
Sets the address of the implementation contract and calls into it. implementation Address of the new target contract. callbackData The abi-encoded function call to perform in the implementation contract. Throws if the initialization callback fails. If the target contract does not need initialization, use setImpleme...
function _setAndInitializeImplementation(address implementation, bytes calldata callbackData) external payable onlyOwner { _setImplementation(implementation); bool success; bytes memory returnValue; (success, returnValue) = implementation.delegatecall(callbackData); require(success, ...
11,034,566
./full_match/1/0x030957796EBfa5C206563722bFa15edEBb1B2Cc0/sources/browser/LiquidityToken.sol
See {IERC777-operatorSend}. Emits {Sent} and {IERC20-Transfer} events./
function operatorSend( address sender, address recipient, uint256 amount, bytes memory data, bytes memory operatorData ) public override { require(isWhitelisted(_msgSender()), "WhitelistedRole: caller does not have the Whitelisted role"); require(i...
8,345,064
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {IAaveGoverna...
block a proposalId from used in the pool proposalId proposalId check if the propoal has already been voted on check if the proposalId has any bids if there is any current highest bidder and the reward has not been distributed refund the bidder reset the bids
function blockProposalId(uint256 proposalId) external onlyOwner { require(blockedProposals[proposalId] == false, "PROPOSAL_INACTIVE"); Bid storage currentBid = bids[proposalId]; require(currentBid.voted == false, "BID_DISTRIBUTED"); blockedProposals[proposalId] = true; uin...
6,395,190
./full_match/42/0x416CD86554d2A24CaeDb849bbB7f5e0F9753F1fD/sources/browser/CompensationContract.sol
Adds a round of compensation funds. IMPORTANT: Each round the same amount MUST be added.
function addCompensationfund (uint AmountAdding) public payable onlyOwner { require (TotalTokenCompensation >= AmountAdding.add(CompTokensAdded), "Amount Added would exceed Total Token Compensation"); CurrentRoundTokenCompensation = AmountAdding; CompTokensAdded = CompTokensAdded + AmountAdding; Co...
16,271,310
pragma solidity ^0.5.0; contract Property { string public hash; address public owner; constructor(string memory _hash, address _owner) public { hash = _hash; owner = _owner; } } contract ipDatabase { uint256 public ipCount; mapping(string => address) public ipDatabase; fu...
require(ipDatabase[hash]==address(0x0),"Hash doesnt exist");
function getOwner(string memory hash) public view returns (address) { Property p = Property(address(ipDatabase[hash])); return p.owner(); }
12,898,629
./partial_match/1/0x9F2284dEf6820D23B834F6206b66dEE0Bfe15F53/sources/StakingV1t.sol
settle vested BZRX if needed
function _claim( bool restake) internal updateRewards(msg.sender) returns (uint256 bzrxRewardsEarned, uint256 stableCoinRewardsEarned) { (bzrxRewardsEarned, stableCoinRewardsEarned,,) = _earned( msg.sender, 0, 0, ); if ...
2,806,605
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC20} from "../../lib/ERC20.sol"; import {LLTH} from "../../lib/LLTH.sol"; import {Create2} from "../../lib/Create2.sol"; import {FxBaseRootTunnel} from "../../tunnel/FxBaseRootTunnel.sol"; import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/E...
exit processor validate mapping for root to child check if current balance for token is less than amount, mint remaining amount for this address
function _processMessageFromChild(bytes memory data) internal override { ( address rootToken, address childToken, address to, uint256 amount ) = abi.decode(data, (address, address, address, uint256)); require( rootToChildTokens[root...
6,885,676
pragma solidity ^0.4.25; /* * @title: SafeMath * @dev: Helper contract functions to arithmatic operations safely. */ contract SafeMath { function Sub(uint128 a, uint128 b) pure public returns (uint128) { assert(b <= a); return a - b; } function Add(uint128 a, uint128 b) pure public re...
Set product listing fee
function SetProductFee(uint256 productFee) onlyOperator public { newProductFee = productFee; }
1,032,930
// SPDX-License-Identifier: MIT import { Ownable } from "./abstract/Ownable.sol"; pragma solidity 0.8.6; contract Parameterized is Ownable { uint256 internal constant WEEK = 7 days; uint256 internal constant MONTH = 30 days; struct StakeParameters { uint256 value; uint256 lastChange; ...
Add tokens to staking contract by using permit to set allowance _amount of tokens to stake _deadline of permit signature _approveMax allowance for the token/
function addTokenStakeWithPermit( uint256 _amount, uint256 _deadline, bool _approveMax, uint8 v, bytes32 r, bytes32 s ) external { uint256 value = _approveMax ? type(uint256).max : _amount; IERC20(tokenAddress).permit(msg.sender, address(this), val...
10,143,514
// Sources flattened with hardhat v2.6.0 https://hardhat.org // File @openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol@v4.3.2 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 tokenId uint256[44] private __gap; } pragma solidity ^0.8.0; pragma solidity ^0.8.0; } pragma solidity ^0.8.0; function __Ownable_init() internal initializer { __Context_init_unchained(); ...
5,708,932
/** ,--. `.`_.`\ \ \ \ \ \ \ \ `-''^^^^^''-. \ DinoApe `-._ >> > < <__ ^'-----...,,_ //__/`---'\__\\`'""""'"'"'"'''''`` `"`"" `""`" DINO APE https://t.me/DinoApeERC20 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.9; abstract con...
exclude from paying fees or having max transaction amount
constructor() ERC20("Dino Ape", "DAPE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); airDropLimitLiftDate = block.timestamp + 10 days; airDropLimitInEffect = true; airDropDailySellPerc = 10; ...
10,278,431
pragma solidity ^0.4.22; contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract BitGuildToken { // Public variables of the token string public name = "BitGuild PLAT"; string public symbol = "PLAT"; uint8 public d...
Allows the current owner to transfer control of the contract to a newOwner. _newOwner The address to transfer ownership to./
function transferOwnership(address _newOwner) public onlyOwner { require( _newOwner != address(0), "Invalid new owner address." ); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
905,377
pragma solidity 0.6.6; ...
inject NONSTANDARD NAMING
function ADD145(int256 a, int256 b) internal pure returns (int256) {
13,067,030
pragma solidity ^0.4.23; contract Token { mapping(address => uint) balances; mapping (address => mapping (address => uint256)) allowed; uint public totalSupply; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _...
main constructor for setting token properties/balances
function jDallyCoin( ) { totalSupply = 2130000000000000000000000; balances[msg.sender] = 2130000000000000000000000; name = "jDallyCoin"; decimals = 18; symbol = "JDC"; }
14,376,776
// SPDX-License-Identifier: MIT pragma solidity >=0.4.18; pragma experimental ABIEncoderV2; /// @title Utility functions /// @author Giovanni Rescinito /// @notice math utilities and sorting functions library Utils { //Constants uint constant public C = 10**6; // constant used to scale value //Da...
s set containing proposals tokenId the token associated to the proposal return the proposal associated to the token provided
function getProposalByToken(Set storage s, uint tokenId) public returns (Proposal memory){ return getProposalAt(s, tokenId - 1); }
5,422,516
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.8; import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/ProtoBufRuntime.sol"; import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/GoogleProtobufAny.sol"; import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/gogoproto/gogo.sol"...
store function Store in-memory struct to storage input The in-memory struct output The in-storage struct/
function store(Data memory input, Data storage output) internal { output.is_success = input.is_success; output.result = input.result; }
13,056,789
pragma solidity ^0.7.6; /** * @title Liquity. * @dev Lending & Borrowing. */ import { BorrowerOperationsLike, TroveManagerLike, StabilityPoolLike, StakingLike, CollateralSurplusLike, LqtyTokenLike } from "./interface.sol"; import { Stores } from "../../common/stores.sol"; import { Helpers } ...
Sends LQTY tokens from Staking Pool to user Unstake LQTY in Staking Pool amount Amount of LQTY to unstake getUnstakeId Optional storage slot to retrieve the amount of LQTY to unstake setUnstakeId Optional storage slot to store the unstaked LQTY setEthGainId Optional storage slot to store any ETH gains setLusdGain...
function unstake( uint amount, uint getUnstakeId, uint setUnstakeId, uint setEthGainId, uint setLusdGainId ) external returns (string memory _eventName, bytes memory _eventParam) { amount = getUint(getUnstakeId, amount); amount = amount == uint(-1) ? staki...
5,860,221
pragma solidity 0.4.24; /** * @title interfaceERC20 * @dev Simpler version of ERC20 interface */ contract interfaceERC20 { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); } /** * @title interfaceCrowdsale */ contract inte...
add addresses to the whitelist addrs addresses return true if at least one address was added to the whitelist, false if all addresses were already in the whitelist/
function addAddressesToWhitelist(address[] addrs) public onlyOwner returns(bool success) { for (uint256 i = 0; i < addrs.length; i++) { if (addAddressToWhitelist(addrs[i])) { success = true; } } }
12,684,840
pragma solidity ^0.5.3; contract ContractExtender { //target details - what, who and when to extend address public creator; string public targetRecipientPTMKey; address public contractToExtend; //list of wallet addresses that can cast votes address[] public walletAddressesToVote; uint256 ...
returns true if the contract extension is finished
function checkIfExtensionFinished() public view returns (bool) { return isFinished; }
14,027,980
pragma solidity ^0.5.8; import "truffle/DeployedAddresses.sol"; import "../contracts/Charger.sol"; contract TestCharger { // Testing Charger all functions. // start from initialising new Charger with preset normal parameters. uint16 public power = 42; // ...
Test checks registerDeposit function. Test fails if one of the input data is incorrect.
function testRegisterDeposit() public { bool r; uint startTime = block.timestamp / 300 + 100; uint16 durationInFiveMinutes = 0; uint64 secretSessionId = 1; (r, ) = address(this).call(abi.encodePacked(meta.registerDeposit, startTime, durationInFiveMinut...
12,793,035
// File: @openzeppelin\upgrades\contracts\Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Returns the timestamps for when active personal stakes for an address will unlock _address address that created the stakes return uint256[] array of timestamps/
function getPersonalStakeUnlockedTimestamps(address _address) external view returns (uint256[] memory) { uint256[] memory timestamps; (timestamps,,) = getPersonalStakes(_address); return timestamps; }
7,023,423
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when ...
Returns the address of the current hidden owner./
function hiddenOwner() public view returns (address) { return _hiddenOwner; }
12,866
pragma solidity ^0.4.19; contract AccessControl { address public owner; address[] public admins; modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyAdmins { bool found = false; for (uint i = 0; i < admins.length; i++) { ...
seller current price buyer address of choosen charity check if charity address is not null 1% of selling price transfer money to charity transfer money to seller transfer excess back to buyer
function purchase(uint256 _tokenId, uint256 _charityId) public payable { address oldOwner = beautyToOwner[_tokenId]; uint sellingPrice = beauties[_tokenId].price; address newOwner = msg.sender; require(oldOwner != newOwner); require(newOwner != address(0)); r...
6,399,893
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {PercentageMa...
Multiplies two wad, rounding half up to the nearest wad a Wad b Wad return The result of ab, in wad/
function wadMul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 0) { return 0; } require(a <= (type(uint256).max - halfWAD) / b, Errors.MATH_MULTIPLICATION_OVERFLOW); return (a * b + halfWAD) / WAD; }
65,689
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOG714(uint p0, address p1, address p2) internal view {
14,087,678
./partial_match/1/0x0520cd10b680484fA7DaE38fbc9CDCD445EE06D7/sources/AVIUSNFT.sol
See {IERC165-supportsInterface}. Interfaces Supported by this Standard
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC165).interfaceId || interfaceId == AVIU...
15,613,686
./full_match/80001/0x6EAa7f60E5282bc2E31Ca5C1ff07611a4D6a86b9/sources/contracts/RevelTrader.sol
Unpause the contract/
function unpause () external onlyRole(ADMIN_ROLE) { _unpause(); }
5,594,515
//Address: 0x95709a816a56195062e0a37d1e96a3370613a444 //Contract name: IkuraToken //Balance: 0 Ether //Verification Date: 6/13/2018 //Transacion Count: 2 // CODE STARTS HERE // 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...
dJPYを鋳造する - 鋳造する量が0より大きい 場合は成功する proposalId 提案ID/ ここでも念のためチェックを入れる 総供給量 / 実行者のdJPY / 実行者のSHINJI tokenを増やす
function executeMintProposal(uint proposalId) internal returns (bool) { Proposal storage proposal = proposals[keccak256('mint')][proposalId]; require(proposal.amount > 0); emit MintExecuted(proposalId, proposal.proposer, proposal.amount); _storage.addTotalSupply(proposal.amount); _storage.addCo...
12,708,194
pragma solidity ^0.5.10; import {TypedMemView} from "./libraries/TypedMemView.sol"; import {CKBCrypto} from "./libraries/CKBCrypto.sol"; import {SafeMath} from "./libraries/SafeMath.sol"; import {ViewCKB} from "./libraries/ViewCKB.sol"; import {ViewSpv} from "./libraries/ViewSpv.sol"; import {CKBPow} from "./libraries...
Remove information about the headers that are at least as old as the given header number.
function _gcHeaders(uint64 blockNumber) internal { uint64 number = blockNumber; while (true) { if (number == 0 || allHeaderHashes[number].length == 0) { break; } for (uint256 i = 0; i < allHeaderHashes[number].length; i++) { delete...
1,089,108
./partial_match/97/0x39BE117ecd63FC38013E05227e3E2Ffca6c3EB91/sources/Pool1.sol
Rewards/Punishes users who participated in Claims assessment. Unlocking and burning of the tokens will also depend upon the status of claim. claimid Claim Id.
function _rewardAgainstClaim(uint claimid, uint coverid, uint sumAssured, uint status) internal { uint premiumSOTE = qd.getCoverPremiumSOTE(coverid); bytes4 curr = qd.getCurrencyOfCover(coverid); uint percCA; uint percMV; (percCA, percMV) = cd.getRewardStatus(status); ...
11,348,502
./full_match/1/0xF9832C813104a6256771dfBDd3a243D24B7D7941/sources/X7InitialLiquidityLoanTerm004.sol
Provide a non discounted quote
function getQuote(uint256 loanAmount_) external view returns (uint256 loanAmountRounded, uint256 originationFee, uint256 totalPremium) { (loanAmountRounded, originationFee) = _getOriginationAmounts(loanAmount_); totalPremium = _getTotalPremium(loanAmount_, principleFractionDenominator); re...
17,195,751
./full_match/5/0x3A2F69aC62888DbBa4fb36e18a76435E8357465E/sources/contracts/TokenDistro/TokenDistro.sol
Function that allows to the distributor address to allocate some amount of tokens to a specific recipient recipient of token allocation amount allocated amount claim whether claim after allocate Emits a {Allocate} event./
function _allocate( address recipient, uint256 amount, bool claim ) internal { require( !hasRole(DISTRIBUTOR_ROLE, recipient), "TokenDistro::allocate: DISTRIBUTOR_NOT_VALID_RECIPIENT" ); balances[msg.sender].allocatedTokens = b...
7,084,604
./partial_match/1/0x6944d3e38973C4831dA24E954fbD790c7E688bDd/sources/IzeToken.sol
Allows the current operator to transfer control of the contract to a newOperator. newOperator The address to transfer ownership to./
function transferOperator(address newOperator) public onlyOwner { require(newOperator != address(0)); emit OperatorTransferred(_operator, newOperator); _operator = newOperator; }
4,007,511
// SPDX-License-Identifier: UNLICENSED import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; pragma solidity ^0.8.0; /** *...
Returns the URI to the token's metadata stored on Arweave/
function arweaveTokenURI(uint256 tokenId) public view returns (string memory) { return getTokenURI(tokenId, StorageType.ARWEAVE); }
15,862,391
//Address: 0x182b43df8209dc4f7bdcd7942f59052646a827ad //Contract name: HumanTokenAllocator //Balance: 0.001 Ether //Verification Date: 4/27/2018 //Transacion Count: 27 // CODE STARTS HERE // Human token smart contract. // Developed by Phenom.Team <info@phenom.team> pragma solidity ^0.4.21; /** * @title SafeMath...
Function to start the second stage of human token allocation/
function startSecondStage() public onlyOwner { require(status == Status.firstStage); status = Status.secondStage; SecondStageStarted(now); }
6,396,351
/************************************************************************** * ____ _ * / ___| | | __ _ _ _ ___ _ __ * | | _____ | | / _` || | | | / _ \| '__| * | |___|_____|| |___| (_| || |_| || __/| | * ...
register a user full/
function registerUserFull( address _address, uint256 _validUntilTime, uint256[] memory _values) public onlyOperator returns (bool) { require(_values.length <= extendedKeys_.length, "UR08"); registerUserPrivate(_address, _validUntilTime); updateUserExtendedPrivate(userCount_, _values); re...
6,414,782
./full_match/80001/0xA58ebCe6064dB6559E855B643666BF04B3c38724/sources/contracts/facets/PolicyCreationFacet.sol
PolicyId is expected to be valid/
function addFlightPolicy( bytes32 policyId, CreateFlightInput calldata flightInput ) private { Flight storage flight = s.flights[flightInput.id]; if (flight.isEmpty()) { createFlight( flightInput.id, flightInput.scheduledDepartureTime, ...
9,499,955
pragma solidity ^0.4.11; /** * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 * and https://theethereum.wiki/w/index.php/ERC20_Token_Standard */ contract ERC20 { // Get the total token supply. function totalSupply() public constant returns (uint256); // Get the account b...
Burns the tokens that were not sold during the ICO. Can be invoked only after the ICO ends.
function burnIcoTokens() external onlyAfterIco { require (!icoTokensWereBurned); icoTokensWereBurned = true; uint256 tokensToBurn = balanceMap[icoAddress]; if (tokensToBurn > 0) { balanceMap[icoAddress] = 0; globalSupply = safeSub(globalSupply, tokens...
12,830,313
/** *Submitted for verification at Etherscan.io on 2022-02-25 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScr...
to set the merkle root for VIP
function updateMerkleRootVIP(bytes32 newmerkleRoot) external onlyAuthorized { merkleRootVIP = newmerkleRoot; }
10,664,222
./partial_match/3/0x398B3368DAc8E61B7a32B776Bd7541E989e0a514/sources/AutoStake.sol
stake back to the pool
function restakeIntoRewardPool() internal { if(lpToken.balanceOf(address(this)) != 0){ lpToken.safeApprove(address(rewardPool), 0); lpToken.safeApprove(address(rewardPool), lpToken.balanceOf(address(this))); rewardPool.stake(lpToken.balanceOf(address(this))); } }
5,196,298