file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/* solium-disable function-order */
pragma solidity 0.5.17;
import {IBondedECDSAKeepFactory} from "@keep-network/keep-ecdsa/contracts/api/IBondedECDSAKeepFactory.sol";
import {VendingMachine} from "./VendingMachine.sol";
import {DepositFactory} from "../proxy/DepositFactory.sol";
import {IRelay} from "@summa-tx/rela... | Finish setting the accepted system lot sizes. `beginLotSizesUpdate` must be called first, once `governanceTimeDelay` has passed, this function can be called to set the lot sizes to the value set in `beginLotSizesUpdate` | function finalizeLotSizesUpdate()
external
onlyOwner
onlyAfterGovernanceDelay(lotSizesChangeInitiated, governanceTimeDelay) {
lotSizesSatoshis = newLotSizesSatoshis;
emit LotSizesUpdated(newLotSizesSatoshis);
lotSizesChangeInitiated = 0;
newLotSizesSatoshis.l... | 1,057,838 |
./full_match/3/0x336e7f473522FE446459FcBfB288DB01f4f2d24D/sources/localhost/FlashSwapGun.sol | emit UniswapV2CallInit(sender, amount0, amount1, wethAddress, pairBAddress); | function testCall6() public view returns (uint) {
return uint(3);
}
| 8,205,479 |
/**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
*... | The maximum auction duration in blocks | function getLotDuration() override external view returns (uint256) {
return getSettingUint("auction.lot.duration");
}
| 13,416,388 |
/**
*Submitted for verification at Etherscan.io on 2020-10-12
*/
// SPDX-License-Identifier: GPL-3.0-or-later
/**
Author: CoFiX Core, https://cofix.io
Commit hash: v0.9.5-1-g7141c43
Repository: https://github.com/Computable-Finance/CoFiX
Issues: https://github.com/Computable-Finance/CoFiX/issues
*/
pragma solidit... | diff ratio could be negative p2: P_{i} p1: P_{i-1} p0: P_{0} | function calcDiffRatio(uint256 p2, uint256 p1, uint256 p0) internal pure returns (int128) {
int128 _p2 = ABDKMath64x64.fromUInt(p2);
int128 _p1 = ABDKMath64x64.fromUInt(p1);
int128 _p0 = ABDKMath64x64.fromUInt(p0);
return ABDKMath64x64.div(ABDKMath64x64.sub(_p2, _p1), _p0);
}
| 12,711,977 |
./full_match/3/0xe3E78C43980456568eE5902C155079e725dcBB99/sources/browser/ERC1400ERC20.sol | [ERC1400 INTERFACE (9/9)] Know the reason on success or failure based on the EIP-1066 application-specific status codes. partition Name of the partition. from Token holder. to Token recipient. value Number of tokens to transfer. data Information attached to the transfer. [CAN CONTAIN THE DESTINATION PARTITION] o... | function canOperatorTransferByPartition(bytes32 partition, address from, address to, uint256 value, bytes calldata data, bytes calldata operatorData)
external
view
returns (byte, bytes32, bytes32)
{
if(!_checkCertificate(operatorData, 0, functionSig)) {
return _canTransfer(functionSig, partiti... | 14,141,614 |
// Sources flattened with hardhat v2.6.1 https://hardhat.org
// File @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol@v4.5.1
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address... | Pause the contract. return `true` if success./ | function pause() external onlyAuthorizedToPause returns (bool) {
isPaused = true;
return true;
}
| 10,436,053 |
./partial_match/4/0x6DA78f115dC013357Da953eB8b4cAba45ef777cC/sources/ATMSettings.sol | Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./ | @notice This interface defines the function to validate the interest to withdraw by lenders.
@author develop@teller.finance
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| 8,543,916 |
./partial_match/1/0xa926231BE5a5364D50FBB18507DfD43Cb2eFFEB7/sources/TaxToken.sol | lpToken = factory.createPair(msg.sender, router.WETH()); emit CreatedLPToken(msg.sender, router.WETH(), lpToken); Camelot V2 fails upon LP creation during the constructor return zaero address to be updated after creation. | function createLPToken() external returns(address lpToken) {
return address(0);
}
| 4,151,936 |
./full_match/1/0x068d23dbc3A6Bddc0916205e15d841C6fD9B0fCB/sources/contracts/DoughV1Index.sol | ========== VIEWS ========== / | function getDoughV1Dsa(address _owner) external view returns (address) {
return _DoughV1DsaList[_owner];
}
| 3,211,132 |
/* Copyright (C) 2020 NexusMutual.io
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 distribu... | Called by user to pay joining membership fee/ | function payJoiningFee(address _userAddress) public payable {
require(_userAddress != address(0));
require(!ms.isPause(), "Emergency Pause Applied");
if (msg.sender == address(ms.getLatestAddress("QT"))) {
require(td.walletAddress() != address(0), "No walletAddress present");
tc.addToWhitelist... | 2,578,509 |
/**
*Submitted for verification at Etherscan.io on 2021-07-23
*/
// Sources flattened with hardhat v2.4.1 https://hardhat.org
// File deps/@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Library for managing
* https://en.w... | Retrieve a list of all Vaults and the basic Vault info | function fromAuthorVaults(address author) public view returns (VaultInfo[] memory) {
uint256 length = vaults[author].length();
VaultInfo[] memory vaultData = new VaultInfo[](length);
for(uint x = 0; x < length; x++){
VaultView vault = VaultView(vaults[author].at(x));
StratInfo[] memory allStr... | 10,569,618 |
./full_match/4/0x3CFBBDf1a8CFe8A6fEbD3210DE14A292856b6336/sources/contracts/ExponentialNoError.sol | Checks if left Exp <= right Exp./ | function lessThanOrEqualExp(Exp memory left, Exp memory right) internal pure returns (bool) {
return left.mantissa <= right.mantissa;
}
| 717,883 |
// File: contracts/Owned.sol
pragma solidity ^0.7.0;
/// @notice Ownership
// SPDX-License-Identifier: GPLv2
contract Owned {
bool initialised;
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
modifier onlyOwner {
require(msg.sender == owner, "Not... | OGDTokenInterface = ERC20 + mint + burn (+ dividend payment) SPDX-License-Identifier: GPLv2 function burnFrom(address tokenOwner, uint tokens) external returns (bool success); | interface OGDTokenInterface is ERC20 {
function mint(address tokenOwner, uint tokens) external returns (bool success);
function burn(uint tokens) external returns (bool success);
}
| 14,097,915 |
./full_match/1/0xAc64fCaB932382005e6d6F13a88Dc5455ECC85a2/sources/contracts/ChainbackSign.sol | Message hash for 'sign', could also be generated off-chain, e.g. with web3j./ | function getSignMessageHash(
address sender,
string calldata chainbackHash,
string calldata cid,
string calldata name,
string calldata comment,
uint256 salt
) public pure returns (bytes32) {
return keccak256(abi.encode(sender, chainbackHash, cid, name, com... | 9,631,998 |
./full_match/3/0xe3E78C43980456568eE5902C155079e725dcBB99/sources/browser/ERC1400ERC20.sol | [NOT MANDATORY FOR ERC1400 STANDARD] Set validator contract address. The validator contract needs to verify "ERC1400TokensValidator" interface. Once setup, the validator will be called everytime a transfer is executed. validatorAddress Address of the validator contract. interfaceLabel Interface label of hook contrac... | function setHookContract(address validatorAddress, string calldata interfaceLabel) external onlyOwner {
ERC1400Raw._setHookContract(validatorAddress, interfaceLabel);
}
| 14,141,629 |
./full_match/4/0xf2acF9d120221Ec8ff76888441110C0a25AF0211/sources/Manwithkey.sol | tokens are numbered from 1 to 10 | function tokenId() internal returns(uint256) {
numberOfTokens += 1;
return numberOfTokens;
}
| 756,054 |
./partial_match/80001/0x129DDF2b913464608EE14f810243949B71F9626E/sources/contracts/libs/WitnetErrorsLib.sol | Extract error codes from a Witnet.Result value. result An instance of `Witnet.Result`. return The `uint[]` error parameters as decoded from the `Witnet.Result`. | function _errorsFromResult(Witnet.Result memory result)
private pure
returns (WitnetCBOR.CBOR[] memory)
{
require(!result.success, "no errors");
return result.value.readArray();
}
| 8,816,293 |
pragma solidity 0.7.6;
pragma abicoder v2;
contract Message {
address public owner;
string public author;
enum Language {PT, EN, ES}
mapping (Language => string[]) public messages;
constructor() {
owner = msg.sender;
author = "Solange Gueiros";
}
event MessageChange... | require(uint8(_language) <= 2, "Invalid language"); Loop through possible options | function getLanguage(Language _language) public pure returns (string memory) {
if (Language.PT == _language) return "Portugues";
if (Language.EN == _language) return "English";
if (Language.ES == _language) return "Espanol";
revert("Invalid language");
}
| 13,003,494 |
./partial_match/1/0xEAc299004Ca13F63dF818A737B39DfA16714B347/sources/Token.sol | Updates token symbol _symbol New token name/ | function updateSymbol(string _symbol) public onlyOwner {
require(bytes(_symbol).length != 0);
symbol = _symbol;
}
| 9,169,907 |
// SPDX-License-Identifier: GPL-3.0-or-later
// 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 dis... | a - b but floors to zero if a <= b XXX: subFloor implementation | function subFloor(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a > b ? a - b : 0;
return c;
}
| 12,998,425 |
./full_match/4/0xC1c61f48c6926ea770BBAeb9432D1F390B1d05B1/sources/RoyaleV1/Pool/RoyaleLP.sol | For claiming withdrawal after user added to the reserve recipient. | function claimTokens() external nonReentrant{
require(reserveRecipients[msg.sender] , "request withdraw first");
uint totalBurnt;
uint decimal;
for(uint8 i=0; i<3; i++) {
if(amountWithdraw[msg.sender][i] > 0) {
decimal=tokens[i].decimals();
... | 679,413 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./ReactPool.sol... | Deploy the pool _stakedToken: staked token address _rewardToken: reward token address _rewardPerBlock: reward per block (in rewardToken) _startBlock: start block _endBlock: end block _poolLimitPerUser: pool limit per user in stakedToken (if any, else 0) _admin: admin address with ownership return address of new ... | function deployPool(
IERC20d _stakedToken,
IERC20d _rewardToken,
uint256 _rewardPerBlock,
uint256 _startBlock,
uint256 _bonusEndBlock,
uint256 _poolLimitPerUser,
address _admin
) external onlyOwner {
require(_stakedToken.totalSupply() >= 0);
... | 7,221,499 |
./full_match/5/0x8a44aF939D25C17f55088ea06bFCD43A80dB4f85/sources/src/MSSC.sol | Make deposits (Native coin or ERC20 tokens) to a existent instruction, {msg.sender} will become the {sender} of the instruction hence will be the only account which is able to withdraw those allocated funds. instructionId Instruction to allocate funds./ | function deposit(bytes32 cycleId, bytes32 instructionId)
external
payable
cycleExists(cycleId)
{
_instructions[instructionId].deposit();
if (_isHybrid(cycleId)) {
if (_allInstructionsFulfilled(cycleId)) {
_cycles[cycleId].lock.init(cycleId);
... | 7,090,369 |
./full_match/42/0x2B4562D92845e05b8Db39C82E887b7Ce71b1e4f5/sources/ERC721/LNKDNS.sol | 可以通过 `_blindedBid` = keccak256(value, fake, secret) 设置一个秘密竞拍。 只有在出价披露阶段被正确披露,已发送的代币才会被退还。 如果与出价一起发送的代币至少为 “value” 且 “fake” 不为真,则出价有效。 将 “fake” 设置为 true ,然后发送满足订金金额但又不与出价相同的金额是隐藏实际出价的方法。 同一个地址可以放置多个出价。 | function toBid(
address _bidder,bytes32 _blindedBid,uint value
) public onlyBefore(biddingEnd) onlyWhitelisted nonReentrant returns(bool){
_token.safeTransferFrom(_bidder,address(this),value);
bids[_bidder].push(Bid({
blindedBid: _blindedBid,
deposit: value
... | 16,278,324 |
./full_match/1/0x86b17741C4B62d40F0824e1cC8A41Bad4B71d7cf/sources/contracts/presale-pool/PreSalePool02.sol | Emergency Mode: Owner can withdraw token Can withdraw token in emergency mode _wallet Address wallet who receive token/ | function emergencyWithdraw(address _wallet, uint256 _amount)
external
onlyOwner
{
require(
token.balanceOf(address(this)) >= _amount,
"POOL::INSUFFICIENT_BALANCE"
);
_deliverTokens(_wallet, _amount);
emit EmergencyWithdraw(_wallet, _amount... | 8,472,568 |
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.0;
import "ds-test/test.sol";
import "./Cheats.sol";
contract Foo {
function f() external view returns(uint256) {
return 1;
}
}
contract SetNonceTest is DSTest {
Cheats constant cheats = Cheats(HEVM_ADDRESS);
Foo public foo;
fun... | set lower nonce should fail | function testFailInvalidNonce() public {
cheats.setNonce(address(foo), 10);
cheats.setNonce(address(foo), 5);
}
| 15,882,911 |
./partial_match/3/0x1B0E0eCa53FB8EbFcBc6071d081961A37628Ca83/sources/Betting.sol | Specify min bet for ERC20. _token address of the erc20 token. _amount min amount to create a bet with the _token/_amount = _amount.mul(1e18); | function setMinBetForERC20(address _token, uint256 _amount) public onlyAdmin {
require(_token != address(0));
require(_amount > 0);
minBetERC20[_token] = _amount;
}
| 5,189,627 |
//SPDX-License-Identifier: Unlicense
// *****+=:. .=*****+-. -#@@#-. .+*****=:. .****+: :*****+=:. -***: -+**= =***.
// ...:=*#%%#*=:.. .+%@*. @@@@%@@@@* .#@@@%%@@@*. [email protected]@@@%@@@- :%@@@%%@@@- [email p... | Provides address of received from swap return v2Address address of the V2 token contract/ | function getV2TokenAddress() external view override returns (address) {
return v2TokenAddress;
}
| 10,107,143 |
// File: contracts/lib/math/SafeMath.sol
pragma solidity 0.5.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error... | Locks a user's balances for the first part of an atomic swap _addresses[0] maker: the address of the user to deduct the swap tokens from _addresses[1] taker: the address of the swap taker who will receive the swap tokens if the swap is completed through `executeSwap` _addresses[2] assetId: the contract address of th... | function createSwap(
address[4] calldata _addresses,
uint256[4] calldata _values,
bytes32[3] calldata _hashes,
uint8 _v,
bool _prefixedSignature
)
external
onlyAdmin
onlyActiveState
nonReentrant
{
require(_values[0] > 0, "20");
... | 13,110,327 |
./partial_match/1/0x2dd110C6646468d82D4160EBdb8Ec462373784A2/sources/pepe.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Pepe0x69", "PEPE0x69") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(... | 4,048,146 |
pragma solidity ^0.4.23;
import "../util/Ownable.sol";
import "../util/SafeMath.sol";
import "../storage/KeyValueStorage.sol";
import "../ip-organisations/IPOrganisations.sol";
/**
* @title Marketplaces
* @author Civic Ledger
*/
contract Marketplaces is Ownable {
using SafeMath for uint256;
KeyValueStora... | Get a marketplace by index _marketplaceIndex Index of the marketplace to retrieve | function byIndex(uint256 _marketplaceIndex)
external
view
returns(string, string, address, uint256)
{
return (
storageContract.getString(keccak256("marketplace.name", _marketplaceIndex)),
storageContract.getString(keccak256("marketplace.website", _marketpl... | 12,609,702 |
./full_match/1/0x2C5e00ec69b27740CB8155736390ee7e74d279DB/sources/contracts/utils/HStrategyHelper.sol | calculates current amounts of tokens erc20Vault the erc20 vault of the strategy moneyVault the money vault of the strategy params current position and pool state combined with predictions from the oracle return amounts amounts of tokens | function calculateCurrentTokenAmounts(
IIntegrationVault erc20Vault,
IIntegrationVault moneyVault,
HStrategy.DomainPositionParams memory params
) external returns (HStrategy.TokenAmounts memory amounts) {
(amounts.uniV3Token0, amounts.uniV3Token1) = LiquidityAmounts.getAmountsFor... | 16,590,921 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "../YakStrategyV2.sol";
/**
* @notice Adapter strategy for MasterChef.
*/
abstract contract MasterChefStrategy is YakStrategyV2 {
using SafeMath for uint256;
uint256 public immutable PID;
address private stakingRewards;
constructor(
... | Estimate recoverable balance after withdraw fee return deposit tokens after withdraw fee/ | function estimateDeployedBalance() external view override returns (uint256) {
return _totalDeposits();
}
| 2,539,598 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../WStep.sol";
import "../WFStorage.sol";
import '../ExtensionEventRegistry.sol';
import "./LibRecetaDocument.sol";
contract RecetaModel is WFStorage, ExtensionEventRegistry, LibRecetaDocument {
address owner;
mapping (uint256 => Docume... | 1 = updated, 0 = nothing | function onUpdate(uint256 doc,
address to,
address sender,
WStep memory current,
WStep memory next,
bytes memory payload
) public returns (bool) {
validateSender(current, sender);
validateRecipient(current, to);
validateStatus(next, curren... | 5,528,645 |
//pragma solidity >=0.6.0 <0.9.0;
pragma solidity ^0.8.10;
//SPDX-License-Identifier: MIT
// import "hardhat/console.sol";
import "./hashVerifier.sol";
import "./MerkleTreeWithHistory.sol";
// import {IHasher} from "./Hasher.sol";
//import "@openzeppelin/contracts/access/Ownable.sol"; //https://github.com/OpenZeppelin... | console.log(msg.sender,"set purpose to",purpose); | function setPurpose(string memory newPurpose) public {
purpose = newPurpose;
emit SetPurpose(msg.sender, purpose);
}
| 12,535,041 |
pragma solidity ^0.5.11;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIAB... | Truffle wasn't playing nice with import "github.com/Arachnid/solidity-stringutils/strings.sol"; So I used the strategy from the above website./ | function compareStrings (string memory a, string memory b)
public view
returns (bool) {
return (keccak256(abi.encodePacked((a))) == keccak256(abi.encodePacked((b))) );
}
| 7,327,187 |
contract IOwnable {
function getOwner() public view returns (address);
function transferOwnership(address _newOwner) public returns (bool);
}
contract IERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address owner) public view returns (uint256);
function tra... | Gets all REP stake in completed bonds for this market return uint256 indicating sum of all stake/ Participants is implicitly bounded by the floor of the initial report REP cost to be no more than 21 | function getParticipantStake() public view returns (uint256) {
uint256 _sum;
for (uint256 i = 0; i < participants.length; ++i) {
_sum += participants[i].getStake();
}
return _sum;
}
| 1,040,705 |
/**
*Submitted for verification at Etherscan.io on 2021-05-07
*/
// Sources flattened with hardhat v2.0.3 https://hardhat.org
// File deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as de... | Approve Chef and xSushi (aka SushiBar) to use our sushi | function initialize(
address _governance,
address _strategist,
address _controller,
address _keeper,
address _guardian,
address[2] memory _wantConfig,
uint256 _pid,
uint256[3] memory _feeConfig
) public initializer whenNotPaused {
__BaseStr... | 2,107,455 |
./full_match/137/0x5FC38507A6223Ce492181B79Bf604929AdB85016/sources/vaultchef/GrasslandChef.sol | Calls strategy earn function to harvest rewards from the underlying farm Transfers amount to the strategy and calls strategy deposit function to calculate the shares assigned to the user/ | function _deposit(
uint256 _pid,
uint256 _amount,
address _to
) internal {
require(_amount > 0, "desposit: amount should be greater than zero");
PoolInfo memory pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_to];
if (pool.strategy.sharesTo... | 4,687,895 |
./partial_match/1/0x136b52Aba68EaBdFEa49A134cB47f35AAA61f8a7/sources/BEAR.sol | Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/ | interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
}
| 2,717,817 |
./partial_match/1/0x3c64Dc415EBB4690d1DF2b6216148c8de6Dd29f7/sources/SonartTools.sol | See {IERC721-transferFrom}./ | function transferFrom(
address from,
address to,
uint256 tokenId
) virtual public override {
_transfer(from, to, tokenId);
}
| 3,662,544 |
/**
*Submitted for verification at Etherscan.io on 2021-08-12
*/
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.7.0;
pragma experimental ABIEncoderV2;
// Harbor Trade 2 addresses at Thu Aug 12 13:31:01 CEST 2021
contract Addresses {
address constant public ACTIONS = 0x80F33ED0A69935dd74310b9D0009D0BA... | dependencies permissions currency setup mgr lock token | function integrateAdapter() internal {
require(SpellERC20Like(RWA_GEM).balanceOf(MAKER_MGR) == 1 ether);
DependLike(CLERK).depend("assessor", ASSESSOR_NEW);
DependLike(CLERK).depend("mgr", MAKER_MGR);
DependLike(CLERK).depend("coordinator", COORDINATOR_NEW);
DependLike(CLERK... | 2,367,763 |
./partial_match/1/0x0C0718F3a881dF98d7c8c59c45eFB321fA49C8CC/sources/CollectionCore.sol | Set signer address on the token contract. Setting signer means we are opening the token contract for external accounts to create tokens. Call this to change the signer immediately./ | function setSignerAddress(address _signerAddress, bool _enableExternalMinting) external
whenNotPaused isApprovedOBO {
require(_signerAddress != address(0), "cant be zero");
signerAddress = _signerAddress;
enableExternalMinting = _enableExternalMinting;
emit NewSignerEvent... | 15,525,471 |
// 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*... | @TODO: we should let DAO to enable/disable locking of the NFTs | function enableLockingNFTs(bool _enabledlockingNFTs) external override onlyOwner {
enabledlockingNFTs = _enabledlockingNFTs;
}
| 422,459 |
pragma solidity ^0.4.11;
import "./RLP.sol";
contract ProvethVerifier {
using RLP for RLP.RLPItem;
using RLP for RLP.Iterator;
using RLP for bytes;
uint256 constant TX_ROOT_HASH_INDEX = 4;
struct UnsignedTransaction {
uint256 nonce;
uint256 gasprice;
uint256 startgas;
... | empty for contract creation tx | function txProof(
bytes32 blockHash,
bytes proofBlob
) public returns (
uint256 index,
uint256 nonce,
uint256 gasprice,
uint256 startgas,
uint256 value,
bytes data,
uint256 v,
uint256 r,
uint256 s,
bool isContractCre... | 6,404,817 |
contract AssetVault {
// TODO: update to recent Solidity developments
// - replace string32 by bytes32
// - replace mappings with counter by arrays as much as possible
// - (if possible) replace clumsy "find this or that" logic by functions, for
// example getAsset(assetID).
// Data structure... | Plumbing function to get all properties of an asset. Currently not possible because return type must be a primitive type. | function getAsset(address ownerAddress, uint assetIndex) returns (string32 id, string32 name, uint verificationCount) {
AssetCollection ac = assetsByOwner[ownerAddress];
Asset a = ac.assets[assetIndex];
id = a.id;
name = a.name;
verificationCount = a.verificationCount;
... | 2,525,636 |
./full_match/1/0xD842D9651F69cEBc0b2Cffc291fC3D3Fe7b5D226/sources/solidity/contracts/core/USDA.sol | Removes a vault controller from the list _vaultController The vault controller to remove The vault controller is removed from the list but keeps the role as to not brick it | function removeVaultControllerFromList(address _vaultController) external onlyOwner {
_vaultControllers.remove(_vaultController);
emit VaultControllerRemovedFromList(_vaultController);
}
| 16,421,854 |
./full_match/73799/0x972B3c7936B1221f59fD44Fa8CD88a474f02D335/sources/project_/contracts/Staking/HBTVault.sol | The entrypoint of funds into the system. People deposit with this function into the vault. The vault is then in charge of sending funds into the strategy./ | function deposit(uint256 _amount) public nonReentrant {
require(_amount > 0, "amount should be more than zero");
require(depositWhitelist[msg.sender], "Cannot deposit");
strategy.beforeDeposit();
uint256 _pool = balance();
want().safeTransferFrom(msg.sender, address(this), _a... | 16,361,865 |
/**
*Submitted for verification at Etherscan.io on 2021-05-13
*/
/**
* Proof of Work, Jonathan Chomko, 2021
*
*/
// File: @openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* ... | Called by front-end to determine current price | function getDutchPrice() external view returns(uint256) {
uint256 tempPrice = startPrice - (block.number - startBlock) * offerPriceDecrement;
if(tempPrice < endPrice || tempPrice > startPrice){
tempPrice = endPrice;
}
return tempPrice;
}
| 10,753,175 |
pragma solidity >=0.5.8 <0.7.0;
contract Admin {
address adminAddress;
constructor () internal {
}
function isAdmin () public view returns (bool) {
return adminAddress == msg.sender;
}
modifier admin {
//require (isAdmin(), "user is not ad... | TODO add back artist modifier when fixedrequire (thisArt.artistAddress == msg.sender, "can't start a feature for art you don't own!"); | function startFeature (uint64 artId, uint _endTime) public {
Art storage thisArt = art[artId];
Feature memory thisFeature = Feature (now, _endTime, thisArt.currentFeatureId, -1, false);
features.push(thisFeature);
thisArt.currentFeatureId = int64(features.length - 1);
}
| 15,794,597 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
import {GelatoConditionsStandard} from "../GelatoConditionsStandard.sol";
import {IERC20} from "../../external/IERC20.sol";
import {SafeMath} from "../../external/SafeMath.sol";
import {ILendingPoolCore} from "../../dapp_interfa... | Compares Compound lending rate vs Aave lending rate and returns "OK" if one is greater than the other _compoundToken cToken to get the lending rate from _underlyingAsset token or / ETH to get aDAI tokens lending rate from _minSpread Minimum spread both amounts have to differ to return "OK" in ray _tokenInCompound t... | function compareLendingRate(
ICToken _compoundToken,
address _underlyingAsset,
uint256 _minSpread,
bool _tokenInCompound
) public view returns (string memory) {
uint256 compRateRay = getCompRateInRay(_compoundToken);
uint256 aaveRate = getAaveInRay(_underlyingAss... | 13,046,848 |
./full_match/11155111/0xb0e9daBA710617b2C398b3987716B2F1f36bB228/sources/AllTypes.sol | Store & retrieve a uint8 val Value to return/ | function getUint8(uint8 val) public pure returns (uint8) {
return val;
}
| 3,818,908 |
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "./interface/IiToken.sol";
import "./interface/IRewardDistributorV3.sol";
import "./interface... | Unpause and set distribution speeds Admin function _borrowiTokens The borrow asset array _borrowSpeeds The borrow speed array _supplyiTokens The supply asset array _supplySpeeds The supply speed array/ | function _unpause(
address[] calldata _borrowiTokens,
uint256[] calldata _borrowSpeeds,
address[] calldata _supplyiTokens,
uint256[] calldata _supplySpeeds
) external override onlyOwner {
_setPaused(false);
_setDistributionSpeedsInternal(
_borrowiToke... | 1,317,992 |
./full_match/1/0x7A40F0d4674baD90D8Dd0c4D355E52347d861931/sources/contracts/MZS.sol | List NFTs owned by address/ | function listNFTs(address _owner) external view returns(uint256[] memory) {
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for(uint256 i; i < tokenCount; i++){
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return ... | 17,012,867 |
./partial_match/42/0x2b335a9234b405724FD5De8e072C66ed1b34D847/sources/P2PLending.sol | require(balances[msg.sender] >= amount, 'Not enough money on your BankAccount');loans[msg.sender].openLoan = false;delete loans[msg.sender]; | function repayLoan() payable public{
require(isBorrower(msg.sender), 'You are not an Borrower');
require(hasOngoingLoan[msg.sender] == true, 'You do not have an ongoing Loan');
require(ifLoanOpen(msg.sender) == true, 'You have already paid your debt');
address payable reciev... | 8,879,192 |
./partial_match/1/0x508efB44A06a64Bd4020e8c5e8Ecf1A9236C75aE/sources/tokenWhitelistable.sol | Checks whether a token is available. return bool available or not. | function _isTokenAvailable(address _a) internal view returns (bool) {
(, , , bool available, , , ) = _getTokenInfo(_a);
return available;
}
| 3,598,120 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.8;
import "./ProtoBufRuntime.sol";
import "./GoogleProtobufAny.sol";
import "./Types.sol";
import "./Validator.sol";
import "./Proofs.sol";
import "./Commitment.sol";
library ClientState {
//struct definition
struct Data {
string chain_id;
Fract... | The decoder for reading a field p The offset of bytes array to start decode bs The bytes array to be decoded r The in-memory struct counters The counters for repeated fields return The number of bytes decoded/ if `r` is NULL, then only counting the number of fields./ | function _read_trust_level(
uint256 p,
bytes memory bs,
Data memory r,
uint[10] memory counters
) internal pure returns (uint) {
(Fraction.Data memory x, uint256 sz) = _decode_Fraction(p, bs);
if (isNil(r)) {
counters[2] += 1;
r.trust_level = x;
if (counters[2] > 0) counter... | 5,547,547 |
pragma solidity 0.8.10;
/***
*@title InsureToken
*@author InsureDAO
* SPDX-License-Identifier: MIT
*@notice InsureDAO's governance token
*/
//libraries
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/pool/IOwnership.sol";
contract InsureToken is IERC20 {
event UpdateMiningParam... | How much supply is mintable from start timestamp till end timestamp start Start of the time interval (timestamp) end End of the time interval (timestamp)return Tokens mintable from `start` till `end`/ Special case if end is in future (not yet minted) epoch InsureDAO will not work in 1000 years. | function mintable_in_timeframe(uint256 start, uint256 end)
external
view
returns (uint256)
{
require(start <= end, "dev: start > end");
uint256 _to_mint = 0;
uint256 _current_epoch_time = start_epoch_time;
uint256 _current_rate = rate;
int256 _cur... | 14,114,007 |
./full_match/1/0x95f808db51579f9c7AC13e0B73075DB86016d0C6/sources/contracts/UnicusNft.sol | Returns all the bidder who participated in this Auction owner_ owner of the Auction Calling conditions: - Only the owner of the smart contract i.e Unicus platform can invoke this return address of the all the bidder who placed the bids for this Auction./ | function getAllBidders(address owner_) public view returns(address[] memory ) {
require(owner_ == _owner, "Only Auction owner can perform this operation");
return _bidders;
}
| 3,154,425 |
pragma solidity ^0.4.18;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.... | Allow owner to set balances/ | function setBalances(uint256 _peBalance, uint256 _bbBalance) public{
peBalance = _peBalance;
bbBalance = _bbBalance;
}
| 6,489,321 |
// SPDX-License-Identifier: MIT
/*
MIT License
Copyright (c) 2020 Hydro Money
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | check if the contract is open to swaps | function isSwapActive() public view returns (bool) {
return isActive;
}
| 548,821 |
/*
Copyright (c) 2018 ZSC Dev Team
*/
pragma solidity ^0.4.21;
import "./object.sol";
contract DBNode {
function getNodeType() public view returns (bytes32);
function getBalance(address _adr) public view returns (uint256);
function getLockedAmount(address _tokenAdr) public view returns (uint);
functi... | ------2018-07-18: new verstion: YYA------checkAllowed(msg.sender); | function getUserWalletAddress() public view returns (address) {
bytes32 userName = getMappedName(msg.sender);
return getBindedWalletAddress(userName);
}
| 13,015,363 |
./full_match/80001/0x66975AD8595E9268c705E33A971Af2111C96e4a0/sources/contracts/FallbackTest.sol | results in test.x becoming == 1. address(test) will not allow to call ``send`` directly, since ``test`` has no payable fallback function. It has to be converted to the ``address payable`` type to even allow calling ``send`` on it. If someone sends Ether to that contract, the transfer will fail, i.e. this returns false ... | function callTest(Test test) public returns (bool) {
(bool success,) = address(test).call(abi.encodeWithSignature("nonExistingFunction()"));
require(success);
address payable testPayable = payable(address(test));
return testPayable.send(0.002 ether);
}
| 5,621,056 |
./full_match/4/0x90Fa288ac57A13478Ae2A6ff4EcaC3e08658f1aF/sources/contracts/TradingContract.sol | Function that created a Path in order to perform transactions with the UniswapV2Router. The directPath booleanwill define if the trading will happen directly (true) or though WBNB (false). If there is no LP between thebaseToken and the PairedToken a direct trade is not possible. | function createPath(address _tokenIn,address _tokenOut) internal view returns (address[] memory) {
address[] memory path;
if (directPath) {
path = new address[](2);
path[0] = _tokenIn;
path[1] = _tokenOut;
if (_tokenIn == WETHAddress || _tokenOut == ... | 756,210 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "hardhat/console.sol";
import "@openzeppelin/contracts/governance/TimelockController.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import { IMembership } from "../interfaces/I... | Shortcut view methods designed for inherited submodules. | function listOperators() public view virtual returns (uint256[] memory) {
return _operators.values();
}
| 1,763,522 |
./full_match/8453/0xF0363DBD4Efb76fC72Aa4df7D8b956269c9052A6/sources/contracts/scribes/Allowance.sol | getRedeemableTrancheCount This method will determine the number of tranches that are available and solvent for redemption. allowanceId the allowance to introspect return the number of tranches that are available and solvent for payment./ get the allowance likely invalid allowance ID make sure that it is enabled make s... | function getRedeemableTrancheCount(bytes32 allowanceId) public view returns (uint256) {
Allowance storage a = allowances[allowanceId];
return getSolventTrancheCount(a);
}
| 11,538,588 |
/**
Etherus presale contract
*/
pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256... | Gets the bonus in percents for the specified sum/ | function getBonus(uint ethSum) public view returns (uint){
uint usdSum = ethSum.mul(ethPrice).div(fractions);
if(usdSum >= 1e6*100)
return 100;
if(usdSum >= 5e5*100)
return 80;
if(usdSum >= 2.5e5*100)
return 70;
if(usdSum >= 2e5*100)
... | 13,038,635 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.9; // code below expects that integer overflows will revert
import "./AreaNFT.sol";
import "./RandomDropVending.sol";
import "./Utilities/PlusCodes.sol";
import "./Vendor/openzeppelin-contracts-3dadd40034961d5ca75fa209a4188b01d7129501/access/Ownable.sol";
///... | Start the sale | function beginSale() external onlyOwner {
_beginSale();
}
| 1,464,325 |
./full_match/1/0x1403773b2fBada61CE1ebD051DA0AB80dE5A1166/sources/Bebe.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Bebe", "Bebe") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswap... | 2,972,386 |
./full_match/80001/0x7bf7b603a46d57b23d4b94696C53f99CDaC404d0/sources/contracts/extension/Drop.sol | Returns the claim condition at the given uid. | function getClaimConditionById(uint256 _conditionId)
external
view
returns (ClaimCondition memory condition)
{
condition = claimCondition.conditions[_conditionId];
}
| 5,597,175 |
./full_match/1/0xE517aa81408236CF3Fd1170b708741614BeCB631/sources/Users/qijunlin/MyWorkSpace/SolidityWorkSpace/gamer_truffle/contracts/token/GAMERGovernance.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "GAMER::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return... | 4,854,125 |
pragma solidity ^0.4.23;
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint25... | Finalization logic. Burn the remaining tokens. Transfer token ownership to contract owner./ | function finalization() internal {
oraclizeContract.finalize();
}
| 14,097,002 |
/*
Copyright (c) 2019 WhaleChat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, subl... | Returns number of ether a token holder is eligible to withdraw. If the token distribution has been changed, the function updateTokenDistribution() needs to be called prior to this to reflect those changes. This function is disabled after contract is upgraded. _tokenHolder The token holder address. retur... | function getWithdrawableCash(address _tokenHolder) external view notUpgraded returns (uint256) {
return withdrawableCash[_tokenHolder];
}
| 12,831,862 |
./partial_match/97/0x99E3c34221A8825BFb44DAE12Dad35596C4aC7c4/sources/MasterChef.sol | Withdraw CAKE tokens from STAKING. | function leaveStaking(uint256 _amount) public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[0][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(0);
uint256 pending = user.amount.mul(pool.accPikaPerShare).div(1e12).sub(us... | 11,361,656 |
//Address: 0x4823429dbda52f05f66a2670852b28bd7999e810
//Contract name: KStarCoin
//Balance: 0 Ether
//Verification Date: 3/2/2018
//Transacion Count: 19
// CODE STARTS HERE
pragma solidity ^0.4.18;
//>> Reference to https://github.com/Arachnid/solidity-stringutils
library strings {
struct slice {
uint... | Function to increase capOfTotalSupply in the next phase of KStarCoin's ecosystem/ | function increaseCap(uint256 _addedValue) onlyOwner public returns (bool) {
require(_addedValue >= 100e6 * 1 ether);
capOfTotalSupply = capOfTotalSupply.add(_addedValue);
return true;
}
| 952,710 |
./partial_match/1/0xe7c8537F92b4fEEFdc19bd6b4023dFe79400cb30/sources/BONES.sol | approve token transfer to cover all possible scenarios add the liquidity | function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniRouterContract), tokenAmount);
address(this),
tokenAmount,
owner(),
block.timestamp
);
}
| 2,679,585 |
/*
* Copyright 2020, NTT Communications Corp.
*
* 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... | for detail, see https:eips.ethereum.org/EIPS/eip-55 | function toChecksumAddress(
string memory addressString
) public pure returns (string memory) {
bytes memory blower = _toLower(bytes(addressString));
bytes memory bhash = _bytes32ToBytes(keccak256(blower));
bfixed[0] = '0';
bfixed[1] = 'x';
for (uint8 i = 0; i < ... | 14,089,824 |
./full_match/1/0x217f947d7aEad260b20278B6EE399bA768994515/sources/contracts/BrewlabsFarm.sol | Withdraw LP tokens from BrewlabsFarm. | function withdraw(uint256 _pid, uint256 _amount) external payable nonReentrant {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
require(_amount > 0, "Amount should be greator than 0");
_transferPer... | 16,565,526 |
/**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.4;
interface Erc20 {
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external returns (uint256);
function transferFrom(address, address, uint256) ex... | Generate a new distribution, cancelling the would be current one f The address of the wallet containing tokens to distribute t The address that will receive any currently remaining distributions (will normally be the same as from) a The amount of tokens in the new distribution r The merkle root associated with the ... | function distribute(address f, address t, uint256 a, bytes32 r) external authorized(admin) returns (bool) {
Erc20 erc = Erc20(token);
uint256 balance = erc.balanceOf(address(this));
erc.transfer(t, balance);
erc.transferFrom(f, address(this), a);
uint256 current = distribution;
... | 10,683,607 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
/**
* @title XUSD AlphaHomora Strategy
* @notice Investment strategy for investing stablecoins via AlphaHomora/CREAM
* @author XUSD.fi Inc
*/
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC20, Initializ... | Converts an underlying amount into cToken amount cTokenAmt = (underlying 1e18) / exchangeRate _cToken cToken for which to change _underlying Amount of underlying to convert return amount Equivalent amount of cTokens/ e.g. 1e181e18 / 205316390724364402565641705 = 50e8 e.g. 1e81e18 / 205316390724364402565... | function _convertUnderlyingToCToken(ICERC20 _cToken, uint256 _underlying)
internal
view
returns (uint256 amount)
{
uint256 exchangeRate = _cToken.exchangeRateStored();
amount = (_underlying * 1e18) / exchangeRate;
}
| 12,813,564 |
./full_match/42/0x1B39B07fDAF1D6AC7cD7818916A5b41403757Dcb/sources/new_test.sol | Returns the amount of tokens in existence. | function totalSupply() external view returns (uint256); | 16,216,524 |
pragma solidity 0.6.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure re... | Safely transfers the ownership of a given token ID to another address Requires the msg.sender to be the owner, approved, or operator _from current owner of the token _to address to receive the ownership of the given token ID _tokenId uint256 ID of the token to be transferred/ require(_checkOnNRC721Received(_from, _t... | function _safeTransfer(address _from, address _to, uint256 _tokenId) internal {
_transfer(_from, _to, _tokenId);
}
| 12,732,124 |
pragma solidity ^0.4.15;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal returns (uint) {
// assert(b > 0); // Soli... | return true if the goal is reached | function capReached() public constant returns (bool) {
return tokensInWeiSold >= totalTokenSupply;
}
| 14,079,034 |
pragma solidity 0.6.6;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high le... | Returns round 2 contributions of an account./ | function getR2Contribution(address accountArg) public view returns (uint256) {
return _contributions[1][accountArg];
}
| 12,816,435 |
/**
*Submitted for verification at Etherscan.io on 2022-05-05
*/
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.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, t... | Allow owner to initiate the vesting schedule/ For Locked allocation For Public sale allocation For Team allocation_1 For Team allocation_2 For Partners & Advisors allocation For Marketing allocation For Development allocation For P2E & Staking rewards allocation For Airdrop allocation | function initVestingSchedule() public onlyOwner {
_createSchedule(lockedWallet, Schedule({
templateName : "Locked",
claimedTokens : uint256(0),
startTime : block.timestamp,
allocation : LOCKED_ALLOCATION,
las... | 1,988,733 |
./partial_match/9000/0xBd7BAE48164F376c12D8e47152c35d5912A06672/sources/contracts/FluxPriceFeed.sol | details about the most recent report return _latestAnswer value from latest report return _latestTimestamp when the latest report was transmitted/ | function latestTransmissionDetails() external view returns (int192 _latestAnswer, uint64 _latestTimestamp) {
return (transmissions[latestAggregatorRoundId].answer, transmissions[latestAggregatorRoundId].timestamp);
}
| 11,342,603 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.4;
import {IBToken} from "../interfaces/IBToken.sol";
import {IDebtToken} from "../interfaces/IDebtToken.sol";
import {ILendPoolLoan} from "../interfaces/ILendPoolLoan.sol";
import {ILendPool} from "../interfaces/ILendPool.sol";
import {IReserveOracleGetter} fro... | Emitted when the state of a reserve is updated asset The address of the underlying asset of the reserve liquidityRate The new liquidity rate variableBorrowRate The new variable borrow rate liquidityIndex The new liquidity index variableBorrowIndex The new variable borrow index/ Returns the ongoing normalized inco... | function getNormalizedIncome(DataTypes.ReserveData storage reserve) internal view returns (uint256) {
uint40 timestamp = reserve.lastUpdateTimestamp;
if (timestamp == uint40(block.timestamp)) {
return reserve.liquidityIndex;
}
uint256 cumulated = MathUtils.calculateLinearInterest(reserve.curre... | 503,171 |
./partial_match/1/0x69f942b6AAa653d722777549808da96935442745/sources/Mis.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Mis::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
if (checkp... | 2,834,518 |
./full_match/1/0x07445312dB273589dcb0fd2bd57aa815A5Afb8CC/sources/contracts/DPT/DividendPayingToken.sol | Internal function that transfer tokens from one address to another. Update magnifiedDividendCorrections to keep dividends unchanged. from The address to transfer from. to The address to transfer to. value The amount to be transferred. | function _transfer(
address from,
address to,
uint256 value
) internal virtual {
require(false);
int256 _magCorrection = magnifiedDividendPerShare
.mul(value)
.toInt256Safe();
magnifiedDividendCorrections[from] = magnifiedDividendCorrectio... | 16,503,573 |
./partial_match/1/0x0E056fF95f68848Ad6d1bC6A8681BB70db884829/sources/Zeirishi.sol | uint256 tokensToLiquify = _balances[address(this)]; | function swapBack() internal lockTheSwap {
uint256 tokensToLiquify = swapThreshold;
uint256 amountToLiquify = tokensToLiquify
.mul(liquidityFee)
.div(totalFee)
.div(2);
uint256 amountToSwap = tokensToLiquify.sub(amountToLiquify);
address[] memory ... | 9,346,818 |
pragma solidity >=0.4.21 <0.7.0;
// It's important to avoid vulnerabilities due to numeric overflow bugs
// OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs
// More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmeti... | Register a future flight for insuring./ | function registerFlight(string calldata airlineCode, uint256 timestamp)
requireIsOperational
external
{
bytes32 flightKey = getFlightKey(msg.sender, airlineCode, timestamp);
flightSuretyData.addFlight(msg.sender, flightKey, timestamp);
}
| 1,833,215 |
library SafeMath
{
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 a, uint256 b) internal pure returns (uint256)
{
// assert(b > 0); // Solidity automatically throws when dividi... | Gets the balance of the specified address. _owner The address to query the the balance of. return An uint256 representing the amount owned by the passed address. | function balanceOf(address _owner) public constant returns (uint256 balance)
{
return balanceOf[_owner];
}
event Transfer( address indexed _owner, address indexed _recipient, uint256 _value );
event Approval( address _owner, address _spender, uint256 _value );
| 5,522,115 |
./full_match/3/0x5CF8F9189222a44334c69ffD491f0D101253cEB8/sources/tow.sol | returns the blueUserInvestment mapping for particular address | function getBlueInvestment(address _address)public view returns (uint256){
return blueUserInvestment[red._date()][red._round()][_address];
}
| 8,224,035 |
./partial_match/1/0x744F4A490Ef4A37163942a42D3FE557203e194D1/sources/TokenConverter.sol | Retrieve user's locked balance. account user's account./ | function lockedBalanceOf(address account) public view returns (uint256) {
return lockedBalances[account];
}
| 4,303,079 |
/* Copyright (C) 2020 NexusMutual.io
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 distribu... | Submits a claim for a given cover note. Adds claim to queue incase of emergency pause else directly submits the claim. coverId Cover Id./ | function submitClaim(uint coverId) external {
_submitClaim(coverId, msg.sender);
}
| 2,578,466 |
./full_match/80001/0xD47F180386148eC00262C3492b39b162afBF9813/sources/project_/contracts/registry/implementation/IdentityRegistry.sol | See {IIdentityRegistry-contains}./ | function contains(address _userAddress) external view override returns (bool) {
if (address(identity(_userAddress)) == address(0)) {
return false;
}
return true;
}
| 5,567,202 |
./full_match/1/0xA4c4808777c16F5A846C92173592272198103DaE/sources/contracts/RockPaperScissors_V8.sol | check if amount > minBetTokenAmount check if currency is not a zeroAddress protect from private game self-connection return new game id transfer tokens to contract | function createGame(
bytes32 hiddenMove,
address currency,
uint256 amount,
address playerB
) external {
if (amount < minBetAmount) revert InvalidBetAmount();
if (currency == address(0)) revert ZeroAddress();
if (msg.sender == playerB) revert AlreadyConne... | 3,130,738 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.9;
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/Client.sol";
libra... | 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 {
Height.store(input.height, output.height);
output.timestamp = input.timestamp;
MultiSignature.store(input.signature, output.signature);
output.new_addresses = input.new_addresses;
output.new_diversifier = input.new_diversifier;
}... | 13,023,177 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.4;
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual returns ... | Hook that is called before any transfer of tokens. This includes minting and burning. Calling conditions: - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens will be to transferred to `to`. - when `from` is zero, `amount` tokens will be minted for `to`. - when `to` is zero, `amount` of ``from``'s to... | function _beforeTokenTransfer(address from, address to, uint256 amount) notPaused internal virtual { }
| 1,576,576 |
./partial_match/1/0x7FEba38C9479d0efeE1e4338BF312c46317c17C9/sources/contracts/implementations/HeyMintERC1155ExtensionE.sol | Freeze all metadata so it can never be changed again/ | function freezeAllMetadata() external onlyOwner {
HeyMintStorage.State storage state = HeyMintStorage.state();
state.data.allMetadataFrozen = true;
}
| 3,933,824 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.