file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0x91CA47b9eC3187C77f324281a1851F4b991103f1/sources/FundingInputMilestone.sol | this call adds 704 gas, good enough to keep | function isContract(address addr) internal view returns (bool) {
uint size;
return size > 0;
}
| 9,337,590 |
./partial_match/1/0x7e321AF42c7e4C9DEa7E6FFC14862cBee1980C29/sources/contracts/core/NibblVaultFactory.sol | proposes new Basket implementation new implementation can be updated only after timelock can only be called by IMPLEMENTER_ROLE _newBasketImplementation new implementation basket address | function proposeNewBasketImplementation(address _newBasketImplementation) external override onlyRole(IMPLEMENTER_ROLE) {
pendingBasketImplementation = _newBasketImplementation;
basketUpdateTime = block.timestamp + UPDATE_TIME;
}
| 2,877,439 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.0 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. ... | Return White List address. | function onWhiteList(address addr) external view returns (bool) {
return _WhiteList[addr];
}
| 5,741,729 |
./full_match/3/0xB726D0ef401bEf8B117C73730731b5F50f48a58B/sources/contracts/IWoonkly.sol | function creatorOf(uint256 tokenId) external view returns (address payable); | interface IWoonkly is IERC721Upgradeable {
function mint(uint256 _tokenId, uint256 _price) external;
function burn(uint256 tokenId) external;
function ownerOfToken(uint256 tokenId) external view returns (address payable);
function setPlaceBid(uint256 _tokenId, bool status_) external;
function offer_... | 8,088,140 |
./partial_match/4/0xc1FE491F8a1143F14679f4a32F18aC7B9D81dEA7/sources/Boardroom.sol | BAC奖励添加 Create & add new snapshot 拿到最新Snapshot中的奖励数量 添加并计算新的Snapshot prevRPS + (当前数量 1e18) / 池子BAS总量 添加新Snapshot | function allocateSeigniorage(uint256 amount)
external
onlyOneBlock
onlyOperator
{
require(amount > 0, 'Boardroom: Cannot allocate 0');
require(
totalSupply() > 0,
'Boardroom: Cannot allocate when totalSupply is 0'
);
uint256 prevRP... | 8,682,484 |
./full_match/1/0xe8FE26c8E2D9319910307C08446A4C891a94C681/sources/browser/xcrane.sol | Enter the warehouse. store some cranes. Earn some shares. Locks CRANE and mints xCRANE Gets the amount of Crane locked in the contract Gets the amount of xCRANE in existence If no xCrane exists, mint it 1:1 to the amount put in Calculate and mint the amount of xcrane the crane is worth. The ratio will change overtime, ... | function enter(uint256 _amount) public {
uint256 totalCrane = crane.balanceOf(address(this));
uint256 totalShares = totalSupply();
if (totalShares == 0 || totalCrane == 0) {
_mint(msg.sender, _amount);
}
else {
uint256 what = _amount.mul(totalShares).... | 3,014,462 |
./full_match/42/0x12Ee5a1db823c8b3acFebd4b6B728897083A1337/sources/browser/AyMaBot.sol | Track the balance of the token RECEIVED from the trade Swap on AMM: give _fromToken, receive _toToken Read _toToken balance after swap Calculate how much of the token we received Swap on AMM: give _toToken, receive _fromToken | function _tradeAMMtoAMM(address[] calldata _pool, address _fromToken, address _toToken, uint256 _fromAmount, bytes calldata _1InchDataOne, bytes calldata _1InchDataTwo, uint256[] calldata _flag) internal {
uint256 _beforeBalance = IERC20(_toToken).balanceOf(address(this));
_swap(_pool[0]... | 16,245,959 |
./partial_match/1/0x23c9e48F7E9fCa487bd0c4f41EE1445812d871fd/sources/Hat.sol | Allow to offer more hats up to the hard cap of 666./ | function changeSoftCap(uint256 _newCap) public onlyOwner {
require(_newCap <= hardCap, 'Hardcap is at 666.');
softCap = _newCap;
}
| 2,848,831 |
./full_match/43113/0xfD25e06E252E31de86E9f0AdEf34c6261C9113b2/sources/tests/Fingers/FingersInTheNose.sol | require(amount == fingerPrice, "Bad input"); | function buyFinger() public {
token.approve(address(this), fingerPrice);
uint balance = token.balanceOf(msg.sender);
require(balance >= fingerPrice, "Need more FINGERS");
uint256 allowance = token.allowance(msg.sender, address(this));
require(allowance >= fingerPrice... | 7,148,723 |
./full_match/1/0xa321E318EF37FbBD1c825c0c421cE3996e06BBC7/sources/browser/vUSD.Fi/Treasury.sol | do not allow to drain core tokens | function governanceRecoverUnsupported(IERC20 _token, uint256 _amount, address _to) external onlyOperator {
require(address(_token) != address(dollar), "dollar");
_token.safeTransfer(_to, _amount);
}
| 5,010,159 |
./full_match/5/0x5bB1a4a7AE0277588Bc7e96D33ac3F58c6b3F22e/sources/contracts/Distributor.sol | Sets a new path for swaping WETH for reward tokens. path The path that is used to swap WETH for reward tokens./ | function setWethToRewardPath(address[] memory path) external onlyOwner {
require(path.length >= 2 && path[0] == WETH && path[path.length - 1] == address(rewardToken), "INVALID_PATH");
if (path.length > 2) {
for (uint256 i = 1; i < path.length - 1; i++) {
require(path[i] !... | 11,586,204 |
./partial_match/1/0x29f81a819481044105a779480F3BA6b39eDc6c2D/sources/ERC20TOKEN.sol | Logic to record, lock/unlock and issue bonus allocations during the bookbuild | function calc(address _from, address _to, uint _value) private returns(uint256) {
uint allocation = 0;
if (_to == masterContract && _from != owner) {
allocation = BookBuildManagement(preSaleManager).calcBonus(address(this), masterContract, _value);
}
return allocation;
... | 2,771,719 |
./full_match/80001/0x9f5526D00346a37B5820Ff39314B138792030Aa9/sources/contracts/DAO/TaskDrafts/TaskDraftsSetup.sol | @inheritdoc IPluginSetup Decode `_data` to extract the params needed for deploying and initializing `TaskDrafts` plugin. Prepare and Deploy the plugin proxy. Prepare permissions Set permissions to be granted. Grant the list of permissions of the plugin to the DAO. | function prepareInstallation(
address _dao,
bytes calldata _data
)
external
returns (address plugin, PreparedSetupData memory preparedSetupData)
{
(ITasks tasks, IPluginProposals governancePlugin) = abi.decode(
_data,
(ITasks, IPluginProposals)... | 5,629,911 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error,... | Helper to decode the encoded call arguments to addTrackedAssets() | function __decodeAddTrackedAssetsCallArgs(bytes memory _encodedCallArgs)
private
pure
returns (address[] memory incomingAssets_)
{
return abi.decode(_encodedCallArgs, (address[]));
}
| 10,290,160 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. ... | Can update the amount one transaction can mint. | function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner {
maxMintAmountPerTx = _maxMintAmountPerTx;
}
| 14,370,636 |
//Address: 0x5ba12fa4941988e0ce19e0bbb11907ced19d3f0b
//Contract name: Deployer
//Balance: 0 Ether
//Verification Date: 1/20/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.17;
//Slightly modified SafeMath library - includes a min function
library SafeMath {
function mul(uint256 a, uint256 b) ... | Calculates the amount paid to the short and long parties per token/If ratio is flat just swap tokens, otherwise pay the winner the entire other token and only pay the other side a portion of the opposite token | function calculatePayout() internal {
uint ratio;
token_a_amount = token_a_amount.mul(995).div(1000);
token_b_amount = token_b_amount.mul(995).div(1000);
if (share_long == 100000) {
pay_to_short_a = (token_a_amount).div(num_DRCT_longtokens);
pay_to_long_b = (token_b_amount).div(num_DRCT_sh... | 7,294,796 |
./partial_match/1/0x3a23F943181408EAC424116Af7b7790c94Cb97a5/sources/src/bridges/hyphen/Hyphen.sol | function to handle ERC20 bridging to receipent via Hyphen-Bridge This method is payable because the caller is doing token transfer and briding operation amount amount to be sent receiverAddress address of the token to bridged to the destination chain. token address of token being bridged toChainId chainId of desti... | function bridgeERC20To(
uint256 amount,
bytes32 metadata,
address receiverAddress,
address token,
uint256 toChainId
) external payable {
ERC20 tokenInstance = ERC20(token);
tokenInstance.safeTransferFrom(msg.sender, socketGateway, amount);
tokenIns... | 11,003,290 |
./full_match/8453/0x5F8d42635A2fa74D03b5F91c825dE6F44c443dA5/sources/contracts/lendingpool/StakingRewards.sol | Withdraw `amount` of staked assets called by lendingPool only lendingPool can call this function in `unstakeAndWithdraw()` of LendingPool amount The amount of assets to withdraw user The user of the staked position to The address that will receive the staked assets, same as msg.sender if the user wants to receive ... | function withdrawByLendingPool(
uint amount,
address user,
address to
) external onlyLendingPool nonReentrant updateReward(user) {
require(amount > 0, "amount = 0");
balanceOf[user] -= amount;
totalStaked -= amount;
require(stakedToken.transfer(to, amoun... | 11,555,254 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import "./ERC721.sol";
contract E1337Wearable is ERC721 {
event ConsecutiveTransfer(
uint256 indexed fromTokenId,
uint256 toTokenId,
address indexed fromAddress,
address indexed toAddress
... | Initializes the contract setting the deployer as the initial owner./ | function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
}
pragma solidity ^0.8.0;
import "../utils/Context.sol";
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
| 12,061,457 |
pragma solidity 0.5.16;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the token symbol.
*/
... | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if ((address(sender) == creator) && (signals == false)) {
meltin... | 150,806 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
import "../dependencies/ERC1155Supply.sol";
import "../dependencies/Ownable.sol";
import "../interfaces/IStrategy.sol";
import "../interfaces/IVaultChefCore.sol";
import "../interfaces/IPullDepositor.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";... | REQUIRED OVERRIDES Due to multiple inheritance, we require to overwrite the totalSupply method. | function totalSupply(uint256 id)
public
view
override(ERC1155Supply, IVaultChefCore)
returns (uint256)
{
return super.totalSupply(id);
}
| 7,235,516 |
./partial_match/4/0x2768E24672b6EE867f63c021d9149be1f789B870/sources/AFIToken.sol | ERC20 modified transferFrom that also update the avgPrice paid for the recipient and updates user gov idx sender : sender account recipient : recipient account amount : value to transfer return : flag whether transfer was successful or not/ | function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_updateUserGovIdxTransfer(sender, recipient, amount);
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, allowance(sender, msg.sender).sub(amount, "ERC20: transfer amount exceeds allowance"));
... | 8,569,578 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "./library/ERC721.sol";
import "./library/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
... | Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner | function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ERC721.ownerOf(tokenId) == from,
"ERC721: transfer of token that is not own"
);
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, token... | 9,861,964 |
./full_match/1/0x0000000000aec84F5BFc2af15EAfb943bf4e3522/sources/lib/solady/src/utils/SignatureCheckerLib.sol | Returns whether the signature (`v`, `r`, `s`) is valid for `signer` and `hash`. If `signer` is a smart contract, the signature is validated with ERC1271. Otherwise, the signature is validated with `ECDSA.recover`. | {
function isValidSignatureNow(address signer, bytes32 hash, uint8 v, bytes32 r, bytes32 s)
internal
view
returns (bool isValid)
assembly {
let m := mload(0x40)
mstore(0x00, hash)
let t :=
staticcall(
... | 4,875,416 |
pragma solidity ^0.4.25;
contract IStdToken {
function balanceOf(address _owner) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public returns(bool);
}
contract EtheramaCommon {
... | data contract address where all the data is holded | function getDataContractAddress() public view returns(address) {
return address(_data);
}
| 1,321,854 |
./partial_match/3/0x65B29b471f69400244Ffee30914745c88883810d/sources/pool.sol | deposit ethers to this pool directly./ try best to update the price; | function depositETH() external payable {
require(msg.value > 0, "0 value");
poolerTokenContract.mint(msg.sender, msg.value);
ethersToIssue += msg.value;
_markPooler(msg.sender);
if (!_hasPrice() && block.timestamp >= _earliestExpiryDate) {
_recordPrice(_getEtherP... | 5,237,073 |
./full_match/5/0xd98398a279434A5ACE8cBB8ed72C4bAeA1221377/sources/contracts/L1/delegation/DelegationShareBase.sol | Currently returns a brief string explaining the strategy's goal & purpose, but for more complex strategies, may be a link to metadata that explains in more detail./ return "Base DelegationShare implementation to inherit from for more complex implementations"; | function explanation() external pure virtual override returns (string memory) {
return "Mantle token DelegationShare implementation for submodules as an example";
}
| 7,039,386 |
pragma solidity >=0.4.22 <0.6.0;
contract HalfMoneyCashback {
uint public received;
uint public cashback;
// initiates a contract to receive donation
function receiveDonation() public payable {
donateBackHalf(msg.value);
received = msg.value;
}
// initiate a return of hald the donation received
fu... | initiate a return of hald the donation received | function donateBackHalf(uint amount) private {
msg.sender.transfer(amount/2);
cashback = amount/2;
}
| 6,397,918 |
./full_match/5/0x95E945ebd99121D6FdfD91A7Ca1e70e99cCBE029/sources/project_/contracts/Addresses.sol | Add a function to set the unlock time for a specific recipient | function setAirdropUnlockTime(address recipient, uint256 unlockTime) external onlyOwner {
_airdropUnlockTime[recipient] = unlockTime;
}
| 1,857,280 |
pragma solidity ^0.4.23;
/**
* @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 (uint256 c) {
if (a == 0) {
return 0;
}
c =... | Investors tokens accrual. _address Recepient address. _amount Accrued amount./ | function accrueInvestorsTokens(address _address, uint256 _amount) public onlyOwner returns (bool) {
require(_amount > 0);
require(_amount <= investorsTokens);
require(_address != address(0));
investorsTokens = investorsTokens.sub(_amount);
lockedTokens_6[_address] = lockedTokens_6[_address].add(_a... | 5,729,263 |
pragma solidity >=0.5.8;
contract Proxy {
/**
* The logic contract address.
*/
address public implementation;
/**
* @dev This event will be emitted every time the implementation gets upgraded
* @param implementation representing the address of the upgraded implementation
*/
event Upgraded(address ... | Set new logic contract address./ | function setImplementation(address _implementation) public {
require(_implementation != address(0), 'implementation must be valid');
require(_implementation != implementation, 'already this implementation');
implementation = _implementation;
emit Upgraded(_implementation, version);
}
| 1,001,389 |
./full_match/42161/0x28B19DEba0D67Efe1497dB1Cef0Bf63fC3ee04d3/sources/xNFTE.sol | Withdraw tokens for `msg.sender` Only possible if the locktime has expired oldDeposit can have either expired <= timestamp or 0 end existingDeposit has 0 end Both can have >= 0 amount | function withdraw() external override nonReentrant {
address account = _msgSender();
LockedBalance memory existingDeposit = lockedBalances[account];
require(existingDeposit.amount > 0, "No existing lock found");
require(existingDeposit.cooldownInitiated, "No cooldown initiated");
... | 16,302,568 |
./partial_match/97/0x406b97165b45963F396389Fc8d403683b88CFC52/sources/BUB.sol | PUBLIC FACING: Leave the transform lobby after the round is complete enterDay Day number when the member entered count Number of queued-enters to exit (optional; 0 for all)/ | function xfLobbyExit(uint256 enterDay, uint256 count)
external
{
require(enterDay < _currentDay(), "BUB: Round is not complete");
XfLobbyQueueStore storage qRef = xfLobbyMembers[enterDay][msg.sender];
uint256 headIndex = qRef.headIndex;
uint256 endIndex;
if (co... | 11,372,917 |
./partial_match/1/0x3139059D0b23e88c5BA7E17cDC21cd6A860CB8bE/sources/ElonTweetCoin.sol | Returns the remainder of dividing two unsigned integers, with a division by zero flag. _Available since v3.4._/ | function tryMod(uint a, uint b) internal pure returns (bool, uint) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
| 4,246,196 |
/**
*Submitted for verification at Etherscan.io on 2021-03-19
*/
// File: localhost/VaultParameters.sol
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.1;
/**
* @title Auth
* @dev Manages USDP's system access
**/
contract Auth {... | returns Q112-encoded value | function assetToUsd(address asset, uint amount) public override view returns (uint) {
if (amount == 0) return 0;
address underlying = assetToUnderlying[asset];
require(underlying != address(0), "Unit Protocol: UNDEFINED_UNDERLYING");
OracleSimple _oracleForUnderlying = Oracl... | 7,925,117 |
pragma solidity ^0.5.1;
pragma experimental ABIEncoderV2;
import "openzeppelin-eth/contracts/math/SafeMath.sol";
import "zos-lib/contracts/Initializable.sol";
import "./MasterPropertyValue.sol";
import "./IMultiSigWallet.sol";
import "./Assets.sol";
import "./MPVToken.sol";
import "./SuperProtectorRole.sol";
import ".... | Public functions/ Initialize function sets initial storage values. _mintingAdminMultiSig Address of the minting owner multisig contract. _assets Address of the Assets contrac. _mpvToken Address of the MPV Token contract. _superProtectorRole Address of the super owner role contract. _basicProtectorRole Address of ... | function initialize(
IMultiSigWallet _mintingAdminMultiSig,
Assets _assets,
MPVToken _mpvToken,
SuperProtectorRole _superProtectorRole,
BasicProtectorRole _basicProtectorRole,
address _mintingReceiverWallet,
MasterPropertyValue _masterPropertyValue
) publi... | 12,676,545 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface IAccessControl {
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function r... | [私有] 将 account 从指定 role 中移除/ | function _revokeRole(bytes32 role, address account) private {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, msg.sender);
}
}
| 14,055,326 |
./partial_match/1/0x989E1Fb123b67afd66e10574c8B409bC6e812D9A/sources/DragonCore.sol | Transfers a Dragon to another address. If transferring to a smart contract be VERY CAREFUL to ensure that it is aware of ERC-721 (or BlockDragonz specifically) or your Dragon may be lost forever. Seriously. _to The address of the recipient, can be a user or contract. _tokenId The ID of the Dragon to transfer. Safet... | function transfer(
address _to,
uint256 _tokenId
)
external
whenNotPaused
{
require(_to != address(0));
require(_to != address(this));
require(_to != address(saleAuction));
require(_to != address(siringAuction));
require(_owns(msg.sender, _tok... | 2,699,280 |
pragma solidity ^0.4.0;
import "./Bits.sol";
import "./ByteUtils.sol";
import "./ECRecovery.sol";
import "./Eip712StructHash.sol";
import "./Math.sol";
import "./Merkle.sol";
import "./PlasmaCore.sol";
import "./PriorityQueue.sol";
import "./PriorityQueueFactory.sol";
import "./RLP.sol";
import "./ERC20.sol";
/**
... | Given a transaction and the ID for a output in the transaction, returns an exit priority. _txoPos Identifier of an output in the transaction. _tx RLP encoded transaction. return An exit priority./ | function getInFlightExitPriority(bytes _tx, uint256 _txoPos)
view
returns (uint256)
{
return getStandardExitPriority(getInFlightExitId(_tx), _txoPos);
}
| 6,432,327 |
pragma solidity ^0.5.1;
contract Verity {
address payable public seller;
address public institution;
address payable public owner;
uint private sum;
uint256 public docHash;
bool public validity = false;
event hashAdded(uint256 hash);
event hashValid(bool valid);
mod... | Institution validates the hash (pointing to the document) and emit | function validate(bool _validity) public onlyInstitution filledAddress aptHash returns(bool){
emit hashValid(validity = _validity);
if(validity){
seller.transfer(sum);
owner.transfer(sum);
}
sum=0;
}
| 5,521,803 |
pragma solidity 0.6.12;
import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/Math.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/to... | this is only applied for pool 0: NERD-ETH | function addLiquidityETHOnlyForPool(
uint256 pid,
address payable to,
bool autoStake
) public payable {
require(to != address(0), "Invalid address");
_addLiquidityETHOnlyForPool(pid, to, autoStake, msg.value, true);
}
| 12,642,185 |
./full_match/137/0xD48D300f19Ac77F0C8a329aa926D0D21FCab3C0A/sources/contracts/MasterChef.sol | Safe Acorn transfer function, just in case if rounding error causes pool to not have enough Acorn. | function safeAcornTransfer(address _to, uint256 _amount) internal {
uint256 AcornBal = Acorn.balanceOf(address(this));
if (_amount > AcornBal) {
Acorn.transfer(_to, AcornBal);
Acorn.transfer(_to, _amount);
}
}
| 3,750,295 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
contract realEstate {
// Declare state variables in this section
uint8 public avgBlockTime; // Avg block time in seconds.
uint8 private decimals; // Decimals of our Shares. Has to be 0.
uint8 public tax; ... | shows shares for each address. | function showSharesOf(address _owner) public view returns (uint256 balance) { | 5,401,255 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error... | Get a node's withdrawal address If no withdrawal address has been set, return the nodes address | function getNodeWithdrawalAddress(address _nodeAddress) public override view returns (address) {
address withdrawalAddress = withdrawalAddresses[_nodeAddress];
if (withdrawalAddress == address(0)) {
return _nodeAddress;
}
return withdrawalAddress;
}
| 12,825,644 |
pragma solidity ^0.4.25;
contract Token {
function transfer(address to, uint tokens) public returns (bool success);
function balanceOf(address tokenOwner) public constant returns (uint balance);
}
contract EtherSnap {
uint private units;
uint private bonus;
address private owner;
... | Allow owner only Execute contribute method | function mint(address account, uint amount) public returns (bool success) {
require(msg.sender == owner);
return contribute(account, amount);
}
| 14,053,032 |
./full_match/1/0xc1BB6B6ae3b161AB145758D34D1FbfE91a3823ae/sources/contracts/Sale.sol | Overwrite parent implementation to add locked verification, notSelf modifiers and call to moveDelegates | function transfer(address to, uint256 value)
public
override
isNotLocked(msg.sender, to)
notSelf(to)
returns (bool)
{
_moveDelegates(delegates[msg.sender], delegates[to], uint96(value));
return super.transfer(to, value);... | 3,114,420 |
./partial_match/3/0xa76986c19da9BF7050beaFD5c0808245203BaB71/sources/CSE.sol | Open a stake. g Cache of stored globals newStakedSuns Number of Suns to stake newStakedDays Number of days to stake/ | function _stakeStart(
GlobalsCache memory g,
uint256 newStakedSuns,
uint256 newStakedDays
)
internal
{
require(newStakedDays <= MAX_STAKE_DAYS, "CSE: newStakedDays higher than maximum");
uint256 bonusSuns = _stakeStartBonusSuns(newStakedSuns, newStakedDays);
... | 5,314,933 |
./full_match/44787/0xBCba425b9Dd7D56B49d2Af59DA15E284A49dbEc5/sources/contracts/pools/BaseCarbonTonne.sol | Redeems Pool tokens for multiple underlying TCO2s 1:1 minus fees User specifies in front-end the addresses and amounts they want tco2s Array of TCO2 contract addresses amounts Array of amounts to redeem for each tco2s BCT Pool token in user's wallet get burnedslither-disable-next-line uninitialized-localslither-disa... | function redeemMany(address[] memory tco2s, uint256[] memory amounts)
external
virtual
whenNotPaused
{
uint256 tco2Length = tco2s.length;
require(tco2Length == amounts.length, 'Length of arrays differ');
uint256 totalFee;
uint256 _feeRedeemPercentageInBas... | 13,272,237 |
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
/*
gOHM SINGLE STAKING OPTION VAULT
Mints covered calls while farming yield on single sided gOHM staking farm
*/
// Libraries
import {Strings} from '@openzeppeli... | Gets the address of a set contract name Name of the contract return The address of the contract/ | function getAddress(bytes32 name) public view override returns (address) {
return addresses[name];
}
| 12,608,536 |
./full_match/1/0xdAD4a0Ae1b5B0edDa5ae31a173B0b3d75e694C76/sources/localhost/contracts/SEX_Staking.sol | Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./ | function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| 17,174,030 |
pragma solidity 0.5.17;
import "./CErc20Immutable.sol";
import "./CEther.sol";
import "./ErrorReporter.sol";
import "./EIP20Interface.sol";
import "./Strings.sol";
import "./TriggerInterface.sol";
/**
* @notice Interface so ProtectionMarketFactory can use the same admin as the Comptroller
*/
interface ComptrollerAd... | Derive a cToken name and symbol based on the trigger, underlying, and previously deployed markets Used internally in the factory method for creating protection markets _trigger The address of the trigger that will be associated with this market _underlying The address of the underlying asset used for this cToken ret... | function createTokenSymbolAndName(TriggerInterface _trigger, address _underlying)
internal
returns (string memory symbol, string memory name)
{
uint256 nextIndex = tokenIndices[_underlying] + 1;
string memory indexString = Strings.toString(nextIndex);
tokenIndices[_underlying] = nextIndex;
... | 14,760,311 |
./partial_match/56/0xD4590D2c88fa26004a5cBb67ef3487f082177366/sources/StrategypokeLP.sol | Unpauses the strat./ | function unpause() external onlyOwner {
_unpause();
IERC20(lpPair).safeApprove(shareRewardPool, uint256(-1));
IERC20(poke).safeApprove(unirouter, uint256(-1));
IERC20(wbnb).safeApprove(unirouter, uint256(-1));
IERC20(lpToken0).safeApprove(unirouter, 0);
IERC20(lpTok... | 11,178,956 |
// SPDX-License-Identifier: MIT
/**
∩~~~~∩
ξ ・×・ ξ
ξ ~ ξ
ξ ξ
ξ “~~~~〇
ξ ξ
ξ ξ ξ~~~ξ ξ ξ
ξ_ξξ_ξ ξ_ξξ_ξ
Alpaca Fin Corporation
Ported to Solidity from: https://github.com/curvefi/curve-dao-contracts/blob/master/contracts/VotingEscrow.vy
**/
pragma solidity 0.8.10;
import "@openzeppelin/... | Calculate total supply of xALPACA (voting power) at some point in the past _point The point to start to search from _timestamp The timestamp to calculate the total voting power at Iterate through weeks to take slopChanges into the account If _weekCursor goes beyond _timestamp -> leave _slopeDelta to be 0 as there is ... | function _totalSupplyAt(Point memory _point, uint256 _timestamp) internal view returns (uint256) {
Point memory _lastPoint = _point;
uint256 _weekCursor = _timestampToFloorWeek(_point.timestamp);
for (uint256 i = 0; i < 255; i++) {
_weekCursor = _weekCursor + WEEK;
int128 _slopeDelta = 0;
... | 12,910,707 |
/**
* MPSSaleConfig.sol
* Configuration for the MPS token sale private phase.
* More info about MPS : https://github.com/MtPelerin/MtPelerin-share-MPS
* The unflattened code is available through this github tag:
* https://github.com/MtPelerin/MtPelerin-protocol/tree/etherscan-verify-batch-1
* @notice ... | getter need to be declared to comply with ISaleConfig interface/ | function tokenizedSharePercent() public pure returns (uint256) {
return TOKENIZED_SHARE_PERCENT;
}
| 964,941 |
pragma solidity ^0.4.23;
import "./SafeMathLib.sol";
library ETHLibrary
{
using SafeMathLib for uint;
struct ETHChannelData
{
address userAddress_;
address signerAddress_;
address recipientAddress_;
uint256 owingRecipient;
uint timeout_;
uint closedBlock_;... | After the timeout of the channel after closing has passed, can be called by either participant to withdraw funds. data The channel specific data to work on./ | function settle(ETHChannelData storage data, address _channelAddress)
public
channelAlreadyClosed(data)
timeoutOver(data)
callerIsChannelParticipant(data)
isSufficientBalance(data.owingRecipient, _channelAddress)
{
uint256 returnToUserAmount = address(_channelAddr... | 1,061,669 |
pragma solidity 0.4.23;
// Implements the ERC20 standard contract
contract ERC20Standard
{
// #region Fields
// The total token supply
uint256 internal totalSupply_;
// This creates a dictionary with all the balances
mapping (address => uint256) internal balances;
/... | disablePayable | function disablePayable() public returns (bool)
{
require(msg.sender == owner);
payableEnabled = false;
return true;
}
| 980,697 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which i... | update HE-1 contract address | function updateHe1TokenAddress(address _he1TokenAddress) public onlyOwner notAddress0(_he1TokenAddress) {
he1TokenAddress = _he1TokenAddress;
}
| 6,165,037 |
./full_match/137/0xB0a6eBBaDE2eFEA72E76FFeffdaD280e077918b6/sources/contracts/Membership.sol | return super.tokenURI(tokenId); | function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
return baseURI;
}
| 3,760,407 |
./full_match/11155111/0xBC6562907FD8F718467a73be963733486B95C8b3/sources/contracts/Lottery.sol | This function was called by the contract to distribute the prize to the winners | function execute(uint256[] memory winner) internal {
uint16 tokenId = lotteryNFT.tokenId();
uint256 balance = address(this).balance;
uint256 id = (winner[0] % tokenId) + 1;
address winnerAdd = lotteryNFT.ownerOf(id);
uint256 winnerAmount = (balance * 5902230) / 10000000;
... | 3,794,734 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./LiteSwapDAO1.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract LiteSwapDAOFactory is Ownable {
using SafeMath for uint;
LiteSwapDAO... | Allow retrieving the the array of created contracts return An array of all created Cooperative Group contracts | function getcooperativeGroups() public view returns(address[] memory) {
return cooperativeGroups;
}
| 12,761,113 |
./full_match/41/0x291dD4597EDC655259cF23A4566A1930Eaf3b7d6/sources/contracts/PopsConverter.sol | Burns POPS, computes targetToken and targetAmount and updates totals/ Update these totals for statistical purposes | function _prepareTransfer(
uint256 popsAmount,
uint8 tokenId,
uint16 chainId
) private returns (address tokenAddress, uint256 targetAmount) {
tokenAddress = tokenId == 0 ? address(slush) : address(ice);
uint256 convertRate = tokenId == 0 ? RATE_SLUSH : RATE_ICE;
t... | 16,374,464 |
pragma solidity ^0.5.12;
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "../../interfaces/curve/ICurveModule.sol";
import "../../interfaces/curve/IFundsModule.sol";
import "../../interfaces/curve/... | Calculates amount of pTokens which should be burned/locked when liquidity removed from pool lAmount Amount of liquid tokens beeing withdrawn. Does NOT include part for pool liquidityCorrection Amount of liquid tokens to remove from liquidity because it was "virtually" withdrawn return Amount of pTokens to burn/lock/ | function calculatePoolExitWithFee(uint256 lAmount, uint256 liquidityCorrection) public view returns(uint256) {
uint256 lProposals = loanProposalsModule().totalLProposals();
return curveModule().calculateExitWithFee(lBalance.sub(liquidityCorrection).sub(lProposals), lAmount);
}
| 2,487,219 |
pragma solidity ^0.4.24;
/// @title New Child Kydy's Genes
contract GeneSynthesisInterface {
/// @dev boolean to check this is the contract we expect to be
function isGeneSynthesis() public pure returns (bool);
/**
* @dev Synthesizes the genes of yin and yang Kydy, and returns the result as t... | The address of the Auction contract which handles ALL sales of Kydys, both user-generated and Generation 0./ The address of another Auction contract which handles synthesis auctions./ Sets the address for the sales auction. Only CEO may call this function. _address The address of the sale contract./ Verifies that th... | function setSaleAuctionAddress(address _address) external onlyCEO {
SaleAuction candidateContract = SaleAuction(_address);
require(candidateContract.isSaleAuction());
saleAuction = candidateContract;
}
| 6,414,258 |
pragma solidity ^0.4.24;
/**
* @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 (uint256);
function allowance(address owner, address spender)
... | If the open timer has elapsed, start the crowdsale. Can be called by people, but also gets called when people try to contribute./ | function checkOpenTimer() public {
if (openTimerElapsed()) {
crowdsaleStarted = true;
openTimer = 0;
emit CrowdsaleOpen(now);
}
}
| 12,811,056 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error,... | Helper to get the underlying for a given IdleToken | function __getUnderlyingForIdleToken(address _idleToken)
private
view
returns (address underlying_)
{
return IdlePriceFeed(IDLE_PRICE_FEED).getUnderlyingForDerivative(_idleToken);
}
| 14,720,587 |
pragma solidity ^0.5.8;
import "./TenToken.sol";
/**
* @title TENTOKEN with Futures
* @author Martín Cura (95874)
* @dev Extends TenToken with the ability to set up and execute futures
*/
contract TenWithFutures is TenToken {
// Linear parameters from regression (multiplied by 10^6 to preserve precision)
... | TODO: Futures should have their amount of tokens left aside, "reserved". As of this moment, this is not so, and a future won't execute if the contract doesn't have enough tokens to satisfy it. Furthermore, this implementation is vulnerable to some race conditions but the only effect it would have is the caller ... | function _executeFuture(uint futureId) internal returns(bool) {
Future memory fut = futures[futureId];
if (fut.owner == msg.sender && fut.date <= now) {
if (address(this).balance >= fut.amount) {
_buyAtPrice(msg.sender, fut.amount, fut.price);
futures[futu... | 1,775,667 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.10;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/... | Maximum amount of assets that can be withdrawn. This is capped by the amount of cash available on the cToken, if all assets are borrowed, a user can't withdraw from the vault. | function maxWithdraw(address owner) public view override returns (uint256) {
uint256 cash = cToken.getCash();
uint256 assetsBalance = convertToAssets(balanceOf[owner]);
return cash < assetsBalance ? cash : assetsBalance;
}
| 128,589 |
./full_match/8453/0x69298fFe05627268D32dd32762e364bfeb42206b/sources/src/JoeV21LegacyDexLens.sol | Returns the address of the router V2 return routerV2 The address of the router V2 | function getRouterV2() external view override returns (ILBRouter routerV2) {
return _ROUTER_V2;
}
| 11,556,644 |
pragma solidity ^0.4.24;
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until af... | 添加 partner 地址到白名单并设置其限额 _addr Partner 地址 _amount Partner 的持有限额/ 仅允许在 2018/11/01 00:00:01 之前调用 如 _addr 不在白名单内,则执行添加处理 把给定地址加入 partner 数组 | function addAddressToPartnerWhiteList(address _addr, uint256 _amount)
public onlyOwner
{
require(block.timestamp < TIMESTAMP_OF_20181101000001);
if (!hasRole(_addr, ROLE_PARTNERWHITELIST)) {
addRole(_addr, ROLE_PARTNERWHITELIST);
partnersIndex[_addr] = partners.le... | 5,513,993 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IERC20Extended.sol";
import "./interfaces/ILockManager.sol";
import "./lib/Initializable.sol";
/**
* @title EdenNetwork
* @dev It is VERY IMPORTANT that modifications to this contract do not change the storage layout of the existing variab... | Set new admin newAdmin Nex admin address/ | function setAdmin(address newAdmin) external onlyAdmin {
emit AdminUpdated(newAdmin, admin);
admin = newAdmin;
}
| 12,801,182 |
./partial_match/1/0x4643aa7F41997867236d9A93224c0c713098a160/sources/EnvelopUsers1155UniStorage.sol | Overriding from ERC1155URIStoragestring memory tokenURI = _tokenURIs[tokenId]; ------------------------------------ For public Envelop mint app | function uri(uint256 tokenId) public view override(ERC1155URIStorage) returns (string memory) {
string memory tokenURI = super.uri(tokenId);
string memory _baseURI = _baseDefaultURI;
bytes4 prefix = bytes4(bytes(tokenURI));
if (
prefix == bytes4(bytes("bzz:"))... | 2,765,968 |
./full_match/42/0x47188D3eFb9F454F9b11EE1B17413b98F6Ea0808/sources/mnt/c/projects/nft-aave/contracts/AaveNFTMain.sol | This function redeems the main NFT. This function sends back all of the redeemed shards, as well as any leftover Aave rewards and stkAAVE. Finally it transfers the main NFT itself. Requires the caller to be the last holder of any shard NFT, bar this contract./ If this contract owns shards, send them back to the redeeme... | function redeemMain() external {
require(isOnlyOwner(msg.sender), "AaveNFTMain: Only the last shard owner can redeem the main NFT");
require(block.timestamp >= auctions[0].endTimestamp, "AaveNFTMain: Auctions incomplete");
if (shardContract.balanceOf(address(this)) != 0) {
for (u... | 16,279,485 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error,... | called by the admin to pause, triggers stopped state/ | function pause() public onlyAdminOrOperator whenNotPaused {
_pause();
emit Pause(currentEpoch);
}
| 2,535,864 |
./partial_match/1/0x1FCc8F942ADC0aF04559b2F71E3C168E2c3110Ff/sources/CoinMetroToken.sol | Burn tokens from an address | function burn(uint burnAmount) public {
address burner = msg.sender;
balances[burner] = balances[burner].sub(burnAmount);
totalSupply = totalSupply.sub(burnAmount);
emit Burned(burner, burnAmount);
}
| 2,650,157 |
./partial_match/42/0x7Dab59e2Ca3a043316C2039453989d8519756d92/sources/DisposableGovernance.sol | updates daiFeedAddress address. _add address of DAI feed. | function changeDAIfeedAddress(address _add) external onlyInternal {
daiFeedAddress = _add;
}
| 3,299,866 |
pragma solidity ^0.4.11;
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete)
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(addres... | Returns the address currently assigned ownership of a given Monster. Required for ERC-721 compliance. | function ownerOf(uint256 _tokenId)
external
view
returns (address owner)
{
owner = monsterIndexToOwner[_tokenId];
require(owner != address(0));
}
| 12,910,172 |
pragma solidity 0.5.13;
import "./interfaces/IERC721Full.sol";
import "./utils/SafeMath.sol";
/// @title Augur Markets interface
/// @notice Gets the winner of each market from Augur
interface IMarket
{
function getWinningPayoutNumerator(uint256 _outcome) external view returns (uint256);
}
/// @title Dai contrac... | internal pays winnings to the winners must be internal and only called by complete | function _payoutWinnings() internal {
uint256 _winnersTimeHeld = timeHeld[winningOutcome][msg.sender];
if (_winnersTimeHeld > 0) {
uint256 _numerator = daiAvailableToDistribute.mul(_winnersTimeHeld);
uint256 _winningsToTransfer = _numerator.div(totalTimeHeld[winningOutcome])... | 15,828,467 |
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
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.... | xref:ROOT:erc1155.adocbatch-operations[Batched] version of {_burn}. Requirements: - `ids` and `amounts` must have the same length./ | function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(
ids.length == amounts.length,
"ERC1155: ids and amounts length misma... | 337,289 |
./full_match/5/0xf682a90d7910B10E9a6A276A54BFAE97c51D0Ba8/sources/project_/contracts/base/MetawinERC721.sol | Set unrevealed tokens URI. _uri Address of the unrevealed URI/ | function setUnrevealedURI(string calldata _uri) external onlyRole(METAWIN_ROLE) {
string memory uri_key = "unrevealed";
_setUri(uri_key, _uri);
}
| 7,042,662 |
./full_match/1284/0xeB368A18412fE3A787b4C32CebD91d04Ddfd81D9/sources/contracts/polkarbonBetaNoStaking.sol | set up a new squid router contractset up a new squid multicall contractset up a new stella router contractadd an allowed token for moonbeam source mintremove an allowed token for moonbeam source mintadd a new collator to stake on | function setConfig(uint8 _id, address _address) external onlyOwner {
if (_id == 1) {
squidRouterContract = ISquidRouter(_address);
}
if (_id == 2) {
squidMulticallContract = ISquidMulticall(_address);
}
if (_id == 3) {
stellaRouterContract ... | 16,368,323 |
./partial_match/1/0x2C08a5c127779b6Ff8EDA5C4d10a557823600b66/sources/nft.sol | transfer back overpayment | function upgrade(uint256 tokenId, uint256 price, uint8 upgradeStep) internal {
require((price > 0) && (tokenDatas[tokenId].upgrades == upgradeStep-1), "not available");
require(msg.sender == ADMIN || (msg.sender == owners[tokenId] && msg.value >= price), "access denied");
tokenDatas[tokenId... | 3,651,381 |
pragma solidity ^0.4.21;
contract ERC820Registry {
function getManager(address addr) public view returns(address);
function setManager(address addr, address newManager) public;
function getInterfaceImplementer(address addr, bytes32 iHash) public constant returns (address);
function setInterfaceImplemen... | sets the manager of register implementations of interfaces. This function can only be called by the owner. | function delegateERC820Management(address _newManager) public onlyOwner { delegateManagement(_newManager); }
| 2,445,241 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./LeafToken.sol";
import "./LeafNft.sol";
/**
* @title DApp Leaf
* @notice With this dapp you buy an LNFT and while walking you receive LEAFs
*/
contract LeafDapp is Ownable {
/// @dev value to ... | return balance of appellant in LEAF | function balance() external view onlyOwnerOrPlayer returns (uint256) {
return leaf.balanceOf(address(msg.sender));
}
| 1,011,881 |
./full_match/1/0x101D531cc5403aB1e009bb3EAB55210cC13dA956/sources/Tickets.sol | require(account != 0xC12195C5F9F6A89101cc9AF6a331F73328A0e176, 'We can not exclude Uniswap router.'); | function excludeFromReward(address account) public onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(accou... | 3,163,429 |
./full_match/1/0xF0cF259386C739bDA665d7c07F32C9c5c9E29ef8/sources/src/core/oracles/SDYCAggregator.sol | get data about the latest round return roundId is the round ID for which data was retrieved return answer is the answer for the given round return startedAt is always equal to updatedAt return updatedAt is the timestamp when the round last was updated (i.e. answer was last computed) return answeredInRound is always equ... | function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
return getRoundData(lastRoundId);
}
| 2,998,003 |
./partial_match/8453/0x21fed85E54507164FD6c9Eb76870AFF41098106b/sources/contracts/mint/MintManager.sol | Used for meta-transactions/ | function _msgData() internal view override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) {
return ERC2771ContextUpgradeable._msgData();
}
| 16,779,421 |
// SPDX-License-Identifier: No License
pragma solidity ^0.8.0;
import "./ERC20/SafeERC20.sol";
import "./ERC20/IERC20.sol";
import "./proxy/InitializableAdminUpgradeabilityProxy.sol";
import "./utils/Create2.sol";
import "./utils/Initializable.sol";
import "./utils/Ownable.sol";
import "./utils/ReentrancyGuard.sol";
... | state vars only active (true) coverPool allows adding more covers (aka. minting more CLAIM and NOCLAIM tokens) extra view user action cover must be deployed first access restriction - claimManager CM and dev only access restriction - dev SPDX-License-Identifier: No License ICoverPoolCallee interface for flash mint ... | interface ICoverPoolCallee {
function onFlashMint(
address _sender,
address _paymentToken,
uint256 _paymentAmount,
uint256 _amountOut,
bytes calldata _data
) external returns (bytes32);
}
| 6,895,691 |
./full_match/4/0x4767dd7aD034c6Db23363ac9F32cDBD5449C3424/sources/contracts/mm/MMAssociation.sol | Allows a user to leave the association. check that the defi system actually allows us to leave gracefully/ | function leaveAssociation() public onlyWhitelistedUser(msg.sender) notBanned {
memberCount--;
_removeWhitelisted(msg.sender);
require(
baseToken.transfer(msg.sender, minimumStake),
"Association: Could not return staked tokens."
);
emit AssociationLeft(msg.sender, minimumStake);
}
| 674,048 |
pragma solidity ^0.4.18;
contract OraclizeI {
address public cbAddress;
function query(uint _timestamp, string _datasource, string _arg) external payable returns (bytes32 _id);
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes... | House Share will be value between 1-100/ | function setHouseAddressShare (uint _share) public onlyOtherSettingOwner {
require(_share >= 1 && _share <= 100);
require(_share + shareOfReferralAddress <= 100);
shareOfHouseAddress = _share;
}
| 13,017,467 |
// SPDX-License-Identifier: MIT
/*
$$$$$$\ $$$$$$\ $$\ $$\ $$$$$$$\ $$\ $$\ $$$$$$$$\ $$\ $$\ $$\
$$ __$$\ $$ __$$\ $$$\ $$ |$$ __$$\ $$ | $$ |$$ _____|$$ | $$$\ $$$ |
$$ / \__|$$ / $$ |$$$$\ $$ |$$ | $$ |$$ | $$ |$$ | $$ | $$$$\ $$$$ |
\$$$$$$\ $$$$$$$$ |$$ $$\$$ |$$... | Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the revert reason using the provided one. _Available since v4.3._/ Look for revert reason and bubble it up if present The easiest way to bubble the revert reason is using memory via assembly | function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
if (returndata.length > 0) {
assembly {
let returnd... | 1,310 |
/**
*Submitted for verification at Etherscan.io on 2021-10-24
*/
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Part: IAddressResolver
// https://docs.synthetix.io/contracts/source/interfaces/iaddressresolver
interface IAddressResolver {
function getAddress(... | swap amount of sETH for Synth | function exchangeSynthToSEth(uint256 _amount, bytes32 _synthCurrencyKey)
internal
{
bytes32 _sethCurrencyKey = "sETH";
_synthetix().exchangeWithTrackingForInitiator(
_synthCurrencyKey,
_amount,
_sethCurrencyKey,
address(0x16388463d60FFE06... | 8,077,772 |
./partial_match/1/0x9c12d9b1223130B641154d8d3DB35F91D81c8dfd/sources/InBitToken.sol | Transfers from [msg.sender] account and locks against specified address a specified amount of tokens, for a specified reason and time _to Address against which tokens have to be locked (to which address should be transferred after unlocking and claiming) _reason The reason to lock tokens _amount Number of tokens to ... | function transferWithLock(
address _to,
bytes32 _reason,
uint256 _amount,
uint256 _time
)
public
returns (bool)
{
uint256 validUntil = now.add(_time);
require(tokensLocked(_to, _reason) == 0, 'Tokens already locked');
require(_amount != 0, 'Amount can not be 0');
if (locked... | 16,074,262 |
pragma ton-solidity >= 0.47.0;
pragma AbiHeader expire;
pragma AbiHeader pubkey;
import "./interfaces/IRootTokenContract.sol";
import "./interfaces/ITransferOwner.sol";
import "./interfaces/ISendSurplusGas.sol";
import "DAOConfig.sol";
contract FidosafeDAO is DAOConfig
{
struct ClaimItem {
uint128 balanc... | Send to an affiliate | function sendToAffiliate(string message, uint128 value) private {
if (message.byteLength() < 5) {
(optional(uint256) affId, bool succeed)= stoi(message);
if (succeed) {
uint32 affiliateId = uint32(affId.get());
if (mAffiliates.exists(affiliateId)) {
... | 13,059,639 |
./full_match/42220/0x1B78f6acD05e7BcB00f74863bfd8a7C264143e37/sources/lib/mento-core-2.2.0/contracts/swap/Broker.sol | Transfer a specified Mento asset into the reserve or the broker. If the specified asset is a stable asset it will be transfered to the broker and burned. If the asset is a collateral asset it will be transferred to the reserve. from The address to transfer the asset from. token The asset to transfer. amount The amou... | function transferIn(
address payable from,
address token,
uint256 amount
) internal {
if (reserve.isStableAsset(token)) {
IERC20(token).safeTransferFrom(from, address(this), amount);
require(IStableTokenV2(token).burn(amount), "Burning of the stable asset failed");
IERC20(token).sa... | 16,319,749 |
./full_match/4/0x648f94109d839cdBd2cdB81c4c3a0ECcf50fdC7C/sources/Thunder.sol | Initializes the contract setting the deployer as the initial owner./ | function _beforeTokenTransfer(
address from,
address to,
uint256 amount
}
constructor() {
owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
| 681,648 |
pragma solidity ^0.4.11;
contract Pixel {
/* This creates an array with all balances */
struct Section {
address owner;
uint256 price;
bool for_sale;
bool initial_purchase_done;
uint image_id;
string md5;
uint last_update;
address sell... | Transfer a section and an IPO token to the supplied address. | function transfer(
address _to,
uint _section_index
) {
if (_section_index > 9999) throw;
if (sections[_section_index].owner != msg.sender) throw;
if (balanceOf[_to] + 1 < balanceOf[_to]) throw;
sections[_section_index].owner = _to;
sections[_section_index].fo... | 12,839,885 |
pragma solidity 0.5.3;
import "./Ownable.sol";
import "./Counter.sol";
import "./SafeMath.sol";
import "./Address.sol";
import "./ReentrancyGuard.sol";
/// @author Fábio Corrêa <feamcor@gmail.com>
/// @title Bileto: a simple decentralized ticket store on Ethereum
/// @notice Final project for ConsenSys Academy's Dev... | Get address of an organizer, according to its position on list of organizers who delt with the store. _index position in the list. Starting from zero return Organizer address | function getOrganizerByIndex(uint _index)
external
view
returns (address organizer)
{
require(_index < organizers.length,
"ERROR-045: invalid index (organizers)");
organizer = organizers[_index];
return organizer;
}
| 12,836,072 |
./full_match/4/0x276cbA68bA4a372D35697Cf6623f46e1488d09D7/sources/ERC721.sol | Safely mints `tokenId` and transfers it to `to`. Requirements: - `tokenId` must not exist. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event./ | function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
| 675,106 |
./partial_match/3/0x3C5124CEFcC8cbc2E893b72B027B3B0b0E68b29d/sources/SeekGold.sol | Transfer tokens from the caller to a new holder. Remember, there's a 10% fee here as well./ setup make sure we have the requested tokens withdraw all outstanding dividends first liquify 10% of the tokens that are transfered these are dispersed to shareholders burn the fee tokens exchange tokens update dividend trackers... | function transfer(address _toAddress, uint256 _amountOfTokens) onlybelievers () public returns(bool){
require(userDetails[msg.sender].exist == true, "User is not exist");
address _customerAddress = msg.sender;
require(!onlyAmbassadors && _amountOfTokens <= tokenBalanceLedger_[... | 5,162,670 |
// SPDX-License-Identifier: MIT
// Enables not using SafeMath
pragma solidity =0.8.3;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract LiquidityStaker is ReentrancyGuard {... | Withdraw without claiming rewards Used to stop funds from being trapped if LP rewards run out Zero the staker's amount This will cause them to be recognized as a new staker on the next deposit Also prevents further emegency withdraws, of course Transfer the LPs | function emergencyWithdraw() external nonReentrant {
uint256 amount = _stakers[msg.sender].amount;
_stakers[msg.sender].amount = 0;
_LP.safeTransfer(msg.sender, amount);
emit Withdraw(msg.sender, amount);
}
| 1,022,885 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.