contract_name stringlengths 1 61 | file_path stringlengths 5 50.4k | contract_address stringlengths 42 42 | language stringclasses 1
value | class_name stringlengths 1 61 | class_code stringlengths 4 330k | class_documentation stringlengths 0 29.1k | class_documentation_type stringclasses 6
values | func_name stringlengths 0 62 | func_code stringlengths 1 303k | func_documentation stringlengths 2 14.9k | func_documentation_type stringclasses 4
values | compiler_version stringlengths 15 42 | license_type stringclasses 14
values | swarm_source stringlengths 0 71 | meta dict | __index_level_0__ int64 0 60.4k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PAA | PAA.sol | 0x3d9ac8e7a9c9be11dfac1677dda901e28d44527f | Solidity | PAA | contract PAA{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uin... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value >= balan... | /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | GNU GPLv2 | bzzr://04c6f293224ab21fa7bc6dac445b813468e2a918bcb069ab887508a1c42c7bbc | {
"func_code_index": [
1641,
2498
]
} | 29,400 | ||
PAA | PAA.sol | 0x3d9ac8e7a9c9be11dfac1677dda901e28d44527f | Solidity | PAA | contract PAA{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uin... | transfer | function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
| /**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | GNU GPLv2 | bzzr://04c6f293224ab21fa7bc6dac445b813468e2a918bcb069ab887508a1c42c7bbc | {
"func_code_index": [
2704,
2861
]
} | 29,401 | ||
PAA | PAA.sol | 0x3d9ac8e7a9c9be11dfac1677dda901e28d44527f | Solidity | PAA | contract PAA{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uin... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| /**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | GNU GPLv2 | bzzr://04c6f293224ab21fa7bc6dac445b813468e2a918bcb069ab887508a1c42c7bbc | {
"func_code_index": [
3136,
3437
]
} | 29,402 | ||
PAA | PAA.sol | 0x3d9ac8e7a9c9be11dfac1677dda901e28d44527f | Solidity | PAA | contract PAA{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uin... | approve | function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | GNU GPLv2 | bzzr://04c6f293224ab21fa7bc6dac445b813468e2a918bcb069ab887508a1c42c7bbc | {
"func_code_index": [
3701,
3931
]
} | 29,403 | ||
PAA | PAA.sol | 0x3d9ac8e7a9c9be11dfac1677dda901e28d44527f | Solidity | PAA | contract PAA{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uin... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true... | /**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to s... | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | GNU GPLv2 | bzzr://04c6f293224ab21fa7bc6dac445b813468e2a918bcb069ab887508a1c42c7bbc | {
"func_code_index": [
4325,
4693
]
} | 29,404 | ||
PAA | PAA.sol | 0x3d9ac8e7a9c9be11dfac1677dda901e28d44527f | Solidity | PAA | contract PAA{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uin... | burn | function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender,... | /**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | GNU GPLv2 | bzzr://04c6f293224ab21fa7bc6dac445b813468e2a918bcb069ab887508a1c42c7bbc | {
"func_code_index": [
4863,
5242
]
} | 29,405 | ||
PAA | PAA.sol | 0x3d9ac8e7a9c9be11dfac1677dda901e28d44527f | Solidity | PAA | contract PAA{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uin... | burnFrom | function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Sub... | /**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | GNU GPLv2 | bzzr://04c6f293224ab21fa7bc6dac445b813468e2a918bcb069ab887508a1c42c7bbc | {
"func_code_index": [
5500,
6116
]
} | 29,406 | ||
FxsAccumulator | contracts/interfaces/ILiquidityGauge.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | ILiquidityGauge | interface ILiquidityGauge {
struct Reward {
address token;
address distributor;
uint256 period_finish;
uint256 rate;
uint256 last_update;
uint256 integral;
}
// solhint-disable-next-line
function deposit_reward_token(address _rewardToken, uint256 _amount... | deposit_reward_token | function deposit_reward_token(address _rewardToken, uint256 _amount) external;
| // solhint-disable-next-line | LineComment | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
249,
331
]
} | 29,407 | |||
FxsAccumulator | contracts/interfaces/ILiquidityGauge.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | ILiquidityGauge | interface ILiquidityGauge {
struct Reward {
address token;
address distributor;
uint256 period_finish;
uint256 rate;
uint256 last_update;
uint256 integral;
}
// solhint-disable-next-line
function deposit_reward_token(address _rewardToken, uint256 _amount... | claim_rewards_for | function claim_rewards_for(address _user, address _recipient) external;
| // solhint-disable-next-line | LineComment | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
370,
445
]
} | 29,408 | |||
FxsAccumulator | contracts/interfaces/ILiquidityGauge.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | ILiquidityGauge | interface ILiquidityGauge {
struct Reward {
address token;
address distributor;
uint256 period_finish;
uint256 rate;
uint256 last_update;
uint256 integral;
}
// solhint-disable-next-line
function deposit_reward_token(address _rewardToken, uint256 _amount... | deposit | function deposit(uint256 _value, address _addr) external;
| // // solhint-disable-next-line
// function claim_rewards_for(address _user) external;
// solhint-disable-next-line | LineComment | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
576,
637
]
} | 29,409 | |||
FxsAccumulator | contracts/interfaces/ILiquidityGauge.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | ILiquidityGauge | interface ILiquidityGauge {
struct Reward {
address token;
address distributor;
uint256 period_finish;
uint256 rate;
uint256 last_update;
uint256 integral;
}
// solhint-disable-next-line
function deposit_reward_token(address _rewardToken, uint256 _amount... | reward_tokens | function reward_tokens(uint256 _i) external view returns(address);
| // solhint-disable-next-line | LineComment | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
672,
742
]
} | 29,410 | |||
FxsAccumulator | contracts/interfaces/ILiquidityGauge.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | ILiquidityGauge | interface ILiquidityGauge {
struct Reward {
address token;
address distributor;
uint256 period_finish;
uint256 rate;
uint256 last_update;
uint256 integral;
}
// solhint-disable-next-line
function deposit_reward_token(address _rewardToken, uint256 _amount... | reward_data | function reward_data(address _tokenReward) external view returns(Reward memory);
| // solhint-disable-next-line | LineComment | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
777,
861
]
} | 29,411 | |||
ZetTokenMint | ZetTokenMint.sol | 0xc9a948939e31777b48943a2d423888905c80a872 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://8e305ffeae736a00db4cb56527e1d61221a82018014766156ff5b5fd559ec279 | {
"func_code_index": [
639,
820
]
} | 29,412 | |
ZetTokenMint | ZetTokenMint.sol | 0xc9a948939e31777b48943a2d423888905c80a872 | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | pause | function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
| /**
* @dev called by the owner to pause, triggers stopped state
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://8e305ffeae736a00db4cb56527e1d61221a82018014766156ff5b5fd559ec279 | {
"func_code_index": [
513,
609
]
} | 29,413 | |
ZetTokenMint | ZetTokenMint.sol | 0xc9a948939e31777b48943a2d423888905c80a872 | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | unpause | function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
| /**
* @dev called by the owner to unpause, returns to normal state
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://8e305ffeae736a00db4cb56527e1d61221a82018014766156ff5b5fd559ec279 | {
"func_code_index": [
693,
791
]
} | 29,414 | |
ZetTokenMint | ZetTokenMint.sol | 0xc9a948939e31777b48943a2d423888905c80a872 | Solidity | ERC223ReceivingContract | contract ERC223ReceivingContract {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data) public;
... | /**
* @title Contract that will work with ERC223 tokens.
*/ | NatSpecMultiLine | tokenFallback | function tokenFallback(address _from, uint _value, bytes _data) public;
| /**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://8e305ffeae736a00db4cb56527e1d61221a82018014766156ff5b5fd559ec279 | {
"func_code_index": [
244,
320
]
} | 29,415 | |
ZetTokenMint | ZetTokenMint.sol | 0xc9a948939e31777b48943a2d423888905c80a872 | Solidity | ERC223Token | contract ERC223Token is ERC223Interface, Pausable {
using SafeMath for uint;
mapping(address => uint) balances; // List of user balances.
/**
* @dev Transfer the specified amount of tokens to the specified address.
* Invokes the `tokenFallback` function if the recipient is a con... | /**
* @title Reference implementation of the ERC223 standard token.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint _value, bytes _data) public whenNotPaused {
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
uint codeLength;
assembly {
// Retrieve the size of the code on target address, this ne... | /**
* @dev Transfer the specified amount of tokens to the specified address.
* Invokes the `tokenFallback` function if the recipient is a contract.
* The token transfer fails if the recipient is a contract
* but does not implement the `tokenFallback` function
* or the fallback function to ... | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://8e305ffeae736a00db4cb56527e1d61221a82018014766156ff5b5fd559ec279 | {
"func_code_index": [
691,
1469
]
} | 29,416 | |
ZetTokenMint | ZetTokenMint.sol | 0xc9a948939e31777b48943a2d423888905c80a872 | Solidity | ERC223Token | contract ERC223Token is ERC223Interface, Pausable {
using SafeMath for uint;
mapping(address => uint) balances; // List of user balances.
/**
* @dev Transfer the specified amount of tokens to the specified address.
* Invokes the `tokenFallback` function if the recipient is a con... | /**
* @title Reference implementation of the ERC223 standard token.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint _value) public whenNotPaused {
uint codeLength;
bytes memory empty;
assembly {
// Retrieve the size of the code on target address, this needs assembly .
codeLength := extcodesize(_to)
}
balances[msg.sender] = balances[msg.sender].sub(_va... | /**
* @dev Transfer the specified amount of tokens to the specified address.
* This function works the same with the previous one
* but doesn't contain `_data` param.
* Added due to backwards compatibility reasons.
*
* @param _to Receiver address.
* @param _value Amount of tokens that wi... | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://8e305ffeae736a00db4cb56527e1d61221a82018014766156ff5b5fd559ec279 | {
"func_code_index": [
1857,
2511
]
} | 29,417 | |
ZetTokenMint | ZetTokenMint.sol | 0xc9a948939e31777b48943a2d423888905c80a872 | Solidity | ERC223Token | contract ERC223Token is ERC223Interface, Pausable {
using SafeMath for uint;
mapping(address => uint) balances; // List of user balances.
/**
* @dev Transfer the specified amount of tokens to the specified address.
* Invokes the `tokenFallback` function if the recipient is a con... | /**
* @title Reference implementation of the ERC223 standard token.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public whenNotPaused constant returns (uint balance) {
return balances[_owner];
}
| /**
* @dev Returns balance of the `_owner`.
*
* @param _owner The address whose balance will be returned.
* @return balance Balance of the `_owner`.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://8e305ffeae736a00db4cb56527e1d61221a82018014766156ff5b5fd559ec279 | {
"func_code_index": [
2709,
2845
]
} | 29,418 | |
FxsAccumulator | contracts/accumulator/FxsAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | FxsAccumulator | contract FxsAccumulator is BaseAccumulator {
/* ========== CONSTRUCTOR ========== */
constructor(address _tokenReward) BaseAccumulator(_tokenReward) {}
/* ========== MUTATIVE FUNCTIONS ========== */
/// @notice Claims rewards from the locker and notifies it to the LGV4
/// @param _amount amount to ... | /// @title A contract that accumulates FXS rewards and notifies them to the LGV4
/// @author StakeDAO | NatSpecSingleLine | claimAndNotify | function claimAndNotify(uint256 _amount) external {
require(locker != address(0), "locker not set");
ILocker(locker).claimFXSRewards(address(this));
_notifyReward(tokenReward, _amount);
}
| /// @notice Claims rewards from the locker and notifies it to the LGV4
/// @param _amount amount to notify | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
327,
546
]
} | 29,419 | |
FxsAccumulator | contracts/accumulator/FxsAccumulator.sol | 0x1cc16bedaacd15848bca5eb80188e0931bc59fb2 | Solidity | FxsAccumulator | contract FxsAccumulator is BaseAccumulator {
/* ========== CONSTRUCTOR ========== */
constructor(address _tokenReward) BaseAccumulator(_tokenReward) {}
/* ========== MUTATIVE FUNCTIONS ========== */
/// @notice Claims rewards from the locker and notifies it to the LGV4
/// @param _amount amount to ... | /// @title A contract that accumulates FXS rewards and notifies them to the LGV4
/// @author StakeDAO | NatSpecSingleLine | claimAndNotifyAll | function claimAndNotifyAll() external {
require(locker != address(0), "locker not set");
ILocker(locker).claimFXSRewards(address(this));
uint256 amount = IERC20(tokenReward).balanceOf(address(this));
_notifyReward(tokenReward, amount);
}
| /// @notice Claims rewards from the locker and notify all to the LGV4 | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | {
"func_code_index": [
622,
900
]
} | 29,420 | |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
94,
154
]
} | 29,421 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
237,
310
]
} | 29,422 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
534,
616
]
} | 29,423 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
895,
983
]
} | 29,424 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1647,
1726
]
} | 29,425 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2039,
2141
]
} | 29,426 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | token0 | function token0() external view returns (address);
| /// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
150,
205
]
} | 29,427 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | token1 | function token1() external view returns (address);
| /// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
329,
384
]
} | 29,428 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | tickSpacing | function tickSpacing() external view returns (int24);
| /// @notice The pool tick spacing
/// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
/// This value is an int24 to avoid casting even though it is always positive.
/// @r... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
759,
817
]
} | 29,429 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | pool | function pool() external view returns (IUniswapV3Pool);
| /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @return The address of the Uniswap V3 Pool | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1034,
1094
]
} | 29,430 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | tickLower | function tickLower() external view returns (int24);
| /// @notice The lower tick of the range | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1142,
1198
]
} | 29,431 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | tickUpper | function tickUpper() external view returns (int24);
| /// @notice The upper tick of the range | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1246,
1302
]
} | 29,432 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | deposit | function deposit(uint256 amount0Desired, uint256 amount1Desired) external payable returns (uint256 shares, uint256 amount0,uint256 amount1);
| /**
* @notice Deposits tokens in proportion to the Sorbetto's current ticks.
* @param amount0Desired Max amount of token0 to deposit
* @param amount1Desired Max amount of token1 to deposit
* @return shares minted
* @return amount0 Amount of token0 deposited
* @return amount1 Amount of token1 deposited
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1658,
1803
]
} | 29,433 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | withdraw | function withdraw(uint256 shares) external returns (uint256 amount0, uint256 amount1);
| /**
* @notice Withdraws tokens in proportion to the Sorbetto's holdings.
* @dev Removes proportional amount of liquidity from Uniswap.
* @param shares burned by sender
* @return amount0 Amount of token0 sent to recipient
* @return amount1 Amount of token1 sent to recipient
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2124,
2215
]
} | 29,434 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | rerange | function rerange() external;
| /**
* @notice Updates sorbetto's positions.
* @dev Finds base position and limit position for imbalanced token
* mints all amounts to this position(including earned fees)
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2421,
2454
]
} | 29,435 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoFragola | interface ISorbettoFragola {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract ... | rebalance | function rebalance() external;
| /**
* @notice Updates sorbetto's positions. Can only be called by the governance.
* @dev Swaps imbalanced token. Finds base position and limit position for imbalanced token if
* we don't have balance during swap because of price impact.
* mints all amounts to this position(including earned fees)
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2792,
2827
]
} | 29,436 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoStrategy | interface ISorbettoStrategy {
/// @notice Period of time that we observe for price slippage
/// @return time in seconds
function twapDuration() external view returns (uint32);
/// @notice Maximum deviation of time waited avarage price in ticks
function maxTwapDeviation() external view returns... | twapDuration | function twapDuration() external view returns (uint32);
| /// @notice Period of time that we observe for price slippage
/// @return time in seconds | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
131,
191
]
} | 29,437 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoStrategy | interface ISorbettoStrategy {
/// @notice Period of time that we observe for price slippage
/// @return time in seconds
function twapDuration() external view returns (uint32);
/// @notice Maximum deviation of time waited avarage price in ticks
function maxTwapDeviation() external view returns... | maxTwapDeviation | function maxTwapDeviation() external view returns (int24);
| /// @notice Maximum deviation of time waited avarage price in ticks | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
267,
330
]
} | 29,438 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoStrategy | interface ISorbettoStrategy {
/// @notice Period of time that we observe for price slippage
/// @return time in seconds
function twapDuration() external view returns (uint32);
/// @notice Maximum deviation of time waited avarage price in ticks
function maxTwapDeviation() external view returns... | tickRangeMultiplier | function tickRangeMultiplier() external view returns (int24);
| /// @notice Tick multuplier for base range calculation | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
393,
459
]
} | 29,439 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoStrategy | interface ISorbettoStrategy {
/// @notice Period of time that we observe for price slippage
/// @return time in seconds
function twapDuration() external view returns (uint32);
/// @notice Maximum deviation of time waited avarage price in ticks
function maxTwapDeviation() external view returns... | protocolFee | function protocolFee() external view returns (uint24);
| /// @notice The protocol's fee denominated in hundredths of a bip, i.e. 1e-6
/// @return The fee | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
569,
628
]
} | 29,440 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ISorbettoStrategy | interface ISorbettoStrategy {
/// @notice Period of time that we observe for price slippage
/// @return time in seconds
function twapDuration() external view returns (uint32);
/// @notice Maximum deviation of time waited avarage price in ticks
function maxTwapDeviation() external view returns... | priceImpactPercentage | function priceImpactPercentage() external view returns (uint24);
| /// @notice The price impact percentage during swap denominated in hundredths of a bip, i.e. 1e-6
/// @return The max price impact percentage | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
783,
852
]
} | 29,441 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PositionKey | library PositionKey {
/// @dev Returns the key of the position in the core library
function compute(
address owner,
int24 tickLower,
int24 tickUpper
) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(owner, tickLower, tickUpper));
}
} | compute | function compute(
address owner,
int24 tickLower,
int24 tickUpper
) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(owner, tickLower, tickUpper));
}
| /// @dev Returns the key of the position in the core library | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
89,
308
]
} | 29,442 | ||
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | TickMath | library TickMath {
/// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
int24 internal constant MIN_TICK = -887272;
/// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
int24 internal const... | /// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128 | NatSpecSingleLine | getSqrtRatioAtTick | function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
require(absTick <= uint256(MAX_TICK), 'T');
uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x1000000000000000000... | /// @notice Calculates sqrt(1.0001^tick) * 2^96
/// @dev Throws if |tick| > max tick
/// @param tick The input tick for the above formula
/// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
/// at the given tick | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1061,
3677
]
} | 29,443 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | TickMath | library TickMath {
/// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
int24 internal constant MIN_TICK = -887272;
/// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
int24 internal const... | /// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128 | NatSpecSingleLine | getTickAtSqrtRatio | function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
// second inequality must be < because the price can never reach the price at the max tick
require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R');
uint256 ratio = uint256(sqrtPriceX96) << 32;
... | /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
/// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
/// ever return.
/// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
/// @return tick The gr... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
4098,
8527
]
} | 29,444 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LiquidityAmounts | library LiquidityAmounts {
/// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128
function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
/// @notice Comp... | /// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices | NatSpecSingleLine | toUint128 | function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
| /// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128 | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
180,
297
]
} | 29,445 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LiquidityAmounts | library LiquidityAmounts {
/// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128
function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
/// @notice Comp... | /// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices | NatSpecSingleLine | getLiquidityForAmount0 | function getLiquidityForAmount0(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint256 amount0
) internal pure returns (uint128 liquidity) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
uint256 intermediate = FullMath.mulDiv(sqrtRatioAX96,... | /// @notice Computes the amount of liquidity received for a given amount of token0 and price range
/// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower))
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the sec... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
768,
1256
]
} | 29,446 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LiquidityAmounts | library LiquidityAmounts {
/// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128
function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
/// @notice Comp... | /// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices | NatSpecSingleLine | getLiquidityForAmount1 | function getLiquidityForAmount1(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint256 amount1
) internal pure returns (uint128 liquidity) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
return toUint128(FullMath.mulDiv(amount1, FixedPoint9... | /// @notice Computes the amount of liquidity received for a given amount of token1 and price range
/// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param ... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1698,
2093
]
} | 29,447 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LiquidityAmounts | library LiquidityAmounts {
/// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128
function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
/// @notice Comp... | /// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices | NatSpecSingleLine | getLiquidityForAmounts | function getLiquidityForAmounts(
uint160 sqrtRatioX96,
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint256 amount0,
uint256 amount1
) internal pure returns (uint128 liquidity) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
if... | /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current
/// pool prices and the prices at the tick boundaries
/// @param sqrtRatioX96 A sqrt price representing the current pool prices
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2698,
3623
]
} | 29,448 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LiquidityAmounts | library LiquidityAmounts {
/// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128
function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
/// @notice Comp... | /// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices | NatSpecSingleLine | getAmount0ForLiquidity | function getAmount0ForLiquidity(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint128 liquidity
) internal pure returns (uint256 amount0) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
return
FullMath.mulDiv(
uint2... | /// @notice Computes the amount of token0 for a given amount of liquidity and a price range
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param liquidity The liquidity being valued
/// @return amount0 The amoun... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3983,
4499
]
} | 29,449 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LiquidityAmounts | library LiquidityAmounts {
/// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128
function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
/// @notice Comp... | /// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices | NatSpecSingleLine | getAmount1ForLiquidity | function getAmount1ForLiquidity(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint128 liquidity
) internal pure returns (uint256 amount1) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
return FullMath.mulDiv(liquidity, sqrtRatioBX96 - s... | /// @notice Computes the amount of token1 for a given amount of liquidity and a price range
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param liquidity The liquidity being valued
/// @return amount1 The amoun... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
4859,
5247
]
} | 29,450 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | LiquidityAmounts | library LiquidityAmounts {
/// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128
function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
/// @notice Comp... | /// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices | NatSpecSingleLine | getAmountsForLiquidity | function getAmountsForLiquidity(
uint160 sqrtRatioX96,
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint128 liquidity
) internal pure returns (uint256 amount0, uint256 amount1) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
if (sqr... | /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current
/// pool prices and the prices at the tick boundaries
/// @param sqrtRatioX96 A sqrt price representing the current pool prices
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX9... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
5793,
6613
]
} | 29,451 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | amountsForLiquidity | function amountsForLiquidity(
IUniswapV3Pool pool,
uint128 liquidity,
int24 _tickLower,
int24 _tickUpper
) internal view returns (uint256, uint256) {
//Get current price from the pool
(uint160 sqrtRatioX96, , , , , , ) = pool.slot0();
return
LiquidityAmounts.getAmountsForLiq... | /// @dev Wrapper around `LiquidityAmounts.getAmountsForLiquidity()`.
/// @param pool Uniswap V3 pool
/// @param liquidity The liquidity being valued
/// @param _tickLower The lower tick of the range
/// @param _tickUpper The upper tick of the range
/// @return amounts of token0 and token1 that corresponds to liquidity | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
681,
1246
]
} | 29,452 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | liquidityForAmounts | function liquidityForAmounts(
IUniswapV3Pool pool,
uint256 amount0,
uint256 amount1,
int24 _tickLower,
int24 _tickUpper
) internal view returns (uint128) {
//Get current price from the pool
(uint160 sqrtRatioX96, , , , , , ) = pool.slot0();
return
LiquidityAmounts.get... | /// @dev Wrapper around `LiquidityAmounts.getLiquidityForAmounts()`.
/// @param pool Uniswap V3 pool
/// @param amount0 The amount of token0
/// @param amount1 The amount of token1
/// @param _tickLower The lower tick of the range
/// @param _tickUpper The upper tick of the range
/// @return The maximum amount of liqui... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1646,
2252
]
} | 29,453 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | positionAmounts | function positionAmounts(IUniswapV3Pool pool, int24 _tickLower, int24 _tickUpper)
internal
view
returns (uint256 amount0, uint256 amount1)
{
//Compute position key
bytes32 positionKey = PositionKey.compute(address(this), _tickLower, _tickUpper);
//Get Position.Info for specified ticks
... | /// @dev Amounts of token0 and token1 held in contract position.
/// @param pool Uniswap V3 pool
/// @param _tickLower The lower tick of the range
/// @param _tickUpper The upper tick of the range
/// @return amount0 The amount of token0 held in position
/// @return amount1 The amount of token1 held in position | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2598,
3337
]
} | 29,454 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | positionLiquidity | function positionLiquidity(IUniswapV3Pool pool, int24 _tickLower, int24 _tickUpper)
internal
view
returns (uint128 liquidity)
{
//Compute position key
bytes32 positionKey = PositionKey.compute(address(this), _tickLower, _tickUpper);
//Get liquidity stored in position
(liquidity, , , ... | /// @dev Amount of liquidity in contract position.
/// @param pool Uniswap V3 pool
/// @param _tickLower The lower tick of the range
/// @param _tickUpper The upper tick of the range
/// @return liquidity stored in position | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3589,
3987
]
} | 29,455 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | checkRange | function checkRange(int24 tickLower, int24 tickUpper) internal pure {
require(tickLower < tickUpper, "TLU");
require(tickLower >= TickMath.MIN_TICK, "TLM");
require(tickUpper <= TickMath.MAX_TICK, "TUM");
}
| /// @dev Common checks for valid tick inputs.
/// @param tickLower The lower tick of the range
/// @param tickUpper The upper tick of the range | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
4149,
4392
]
} | 29,456 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | floor | function floor(int24 tick, int24 tickSpacing) internal pure returns (int24) {
int24 compressed = tick / tickSpacing;
if (tick < 0 && tick % tickSpacing != 0) compressed--;
return compressed * tickSpacing;
}
| /// @dev Rounds tick down towards negative infinity so that it's a multiple
/// of `tickSpacing`. | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
4503,
4746
]
} | 29,457 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | getPositionTicks | function getPositionTicks(IUniswapV3Pool pool, uint256 amount0Desired, uint256 amount1Desired, int24 baseThreshold, int24 tickSpacing) internal view returns(int24 tickLower, int24 tickUpper) {
Info memory cache =
Info(amount0Desired, amount1Desired, 0, 0, 0, 0, 0);
// Get current price and tick from... | /// @dev Gets ticks with proportion equivalent to desired amount
/// @param pool Uniswap V3 pool
/// @param amount0Desired The desired amount of token0
/// @param amount1Desired The desired amount of token1
/// @param baseThreshold The range for upper and lower ticks
/// @param tickSpacing The pool tick spacing
/// @re... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
5202,
7103
]
} | 29,458 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | amountsForTicks | function amountsForTicks(IUniswapV3Pool pool, uint256 amount0Desired, uint256 amount1Desired, int24 _tickLower, int24 _tickUpper) internal view returns(uint256 amount0, uint256 amount1) {
uint128 liquidity = liquidityForAmounts(pool, amount0Desired, amount1Desired, _tickLower, _tickUpper);
(amount0, amount1... | /// @dev Gets amounts of token0 and token1 that can be stored in range of upper and lower ticks
/// @param pool Uniswap V3 pool
/// @param amount0Desired The desired amount of token0
/// @param amount1Desired The desired amount of token1
/// @param _tickLower The lower tick of the range
/// @param _tickUpper The upper ... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
7616,
8021
]
} | 29,459 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | baseTicks | function baseTicks(int24 currentTick, int24 baseThreshold, int24 tickSpacing) internal pure returns(int24 tickLower, int24 tickUpper) {
int24 tickFloor = floor(currentTick, tickSpacing);
tickLower = tickFloor - baseThreshold;
tickUpper = tickFloor + baseThreshold;
}
| /// @dev Calc base ticks depending on base threshold and tickspacing | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
8098,
8413
]
} | 29,460 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | amountsDirection | function amountsDirection(uint256 amount0Desired, uint256 amount1Desired, uint256 amount0, uint256 amount1) internal pure returns (bool zeroGreaterOne) {
zeroGreaterOne = amount0Desired.sub(amount0).mul(amount1Desired) > amount1Desired.sub(amount1).mul(amount0Desired) ? true : false;
}
| /// @dev Get imbalanced token
/// @param amount0Desired The desired amount of token0
/// @param amount1Desired The desired amount of token1
/// @param amount0 Amounts of token0 that can be stored in base range
/// @param amount1 Amounts of token1 that can be stored in base range
/// @return zeroGreaterOne true if token... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
8813,
9120
]
} | 29,461 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | checkDeviation | function checkDeviation(IUniswapV3Pool pool, int24 maxTwapDeviation, uint32 twapDuration) internal view {
(, int24 currentTick, , , , , ) = pool.slot0();
int24 twap = getTwap(pool, twapDuration);
int24 deviation = currentTick > twap ? currentTick - twap : twap - currentTick;
require(deviation <= max... | // Check price has not moved a lot recently. This mitigates price
// manipulation during rebalance and also prevents placing orders
// when it's too volatile. | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
9297,
9667
]
} | 29,462 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolVariables | library PoolVariables {
using LowGasSafeMath for uint256;
// Cache struct for calculations
struct Info {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0;
uint256 amount1;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
... | /// @title Liquidity and ticks functions
/// @notice Provides functions for computing liquidity and ticks for token amounts and prices | NatSpecSingleLine | getTwap | function getTwap(IUniswapV3Pool pool, uint32 twapDuration) internal view returns (int24) {
uint32 _twapDuration = twapDuration;
uint32[] memory secondsAgo = new uint32[](2);
secondsAgo[0] = _twapDuration;
secondsAgo[1] = 0;
(int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);
r... | /// @dev Fetches time-weighted average price in ticks from Uniswap pool for specified duration | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
9770,
10197
]
} | 29,463 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolActions | interface IUniswapV3PoolActions {
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. Th... | /// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone | NatSpecSingleLine | mint | function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
| /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
/// on tickLo... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1082,
1295
]
} | 29,464 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolActions | interface IUniswapV3PoolActions {
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. Th... | /// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone | NatSpecSingleLine | collect | function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
| /// @notice Collects tokens owed to a position
/// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
/// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
/// amount1Requested may be set to zero. To withdra... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2368,
2599
]
} | 29,465 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolActions | interface IUniswapV3PoolActions {
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. Th... | /// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone | NatSpecSingleLine | burn | function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
| /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
/// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
/// @dev Fees must be collected separately via a call to #collect
/// @param tickLower The lower tick of the posi... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3246,
3401
]
} | 29,466 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolActions | interface IUniswapV3PoolActions {
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. Th... | /// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone | NatSpecSingleLine | swap | function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external returns (int256 amount0, int256 amount1);
| /// @notice Swap token0 for token1, or token1 for token0
/// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
/// @param recipient The address to receive the output of the swap
/// @param zeroForOne The direction of the swap, true for token0 to token1, false... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
4434,
4663
]
} | 29,467 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolDerivedState | interface IUniswapV3PoolDerivedState {
/// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
/// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
/// the beginning of the... | /// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs. | NatSpecSingleLine | observe | function observe(uint32[] calldata secondsAgos)
external
view
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);
| /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
/// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
/// the beginning of the period and another for the end of the period. E.g., t... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1100,
1288
]
} | 29,468 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolState | interface IUniswapV3PoolState {
/// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// tick The current tick of the p... | /// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction | NatSpecSingleLine | slot0 | function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
| /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// tick The current tick of the pool, i.e. according to the last tick transition that... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1191,
1524
]
} | 29,469 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolState | interface IUniswapV3PoolState {
/// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// tick The current tick of the p... | /// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction | NatSpecSingleLine | positions | function positions(bytes32 key)
external
view
returns (
uint128 _liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
| /// @notice Returns the information about a position by the position's key
/// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
/// @return _liquidity The amount of liquidity in the position,
/// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick ra... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2239,
2532
]
} | 29,470 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolImmutables | interface IUniswapV3PoolImmutables {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token... | /// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values | NatSpecSingleLine | token0 | function token0() external view returns (address);
| /// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
160,
215
]
} | 29,471 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolImmutables | interface IUniswapV3PoolImmutables {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token... | /// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values | NatSpecSingleLine | token1 | function token1() external view returns (address);
| /// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
339,
394
]
} | 29,472 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IUniswapV3PoolImmutables | interface IUniswapV3PoolImmutables {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token... | /// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values | NatSpecSingleLine | tickSpacing | function tickSpacing() external view returns (int24);
| /// @notice The pool tick spacing
/// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
/// This value is an int24 to avoid casting even though it is always positive.
/// @r... | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
765,
823
]
} | 29,473 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolActions | library PoolActions {
using PoolVariables for IUniswapV3Pool;
using LowGasSafeMath for uint256;
using SafeCast for uint256;
/**
* @notice Withdraws liquidity in share proportion to the Sorbetto's totalSupply.
* @param pool Uniswap V3 pool
* @param tickLower The lower tick of the ... | /// @title This library is created to conduct a variety of burn liquidity methods | NatSpecSingleLine | burnLiquidityShare | function burnLiquidityShare(
IUniswapV3Pool pool,
int24 tickLower,
int24 tickUpper,
uint256 totalSupply,
uint256 share,
address to
) internal returns (uint256 amount0, uint256 amount1) {
require(totalSupply > 0, "TS");
uint128 liquidityInPool = pool.positionLiquidity(tickLower, ... | /**
* @notice Withdraws liquidity in share proportion to the Sorbetto's totalSupply.
* @param pool Uniswap V3 pool
* @param tickLower The lower tick of the range
* @param tickUpper The upper tick of the range
* @param totalSupply The amount of total shares in existence
* @param share to burn
* @param to R... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
628,
1578
]
} | 29,474 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolActions | library PoolActions {
using PoolVariables for IUniswapV3Pool;
using LowGasSafeMath for uint256;
using SafeCast for uint256;
/**
* @notice Withdraws liquidity in share proportion to the Sorbetto's totalSupply.
* @param pool Uniswap V3 pool
* @param tickLower The lower tick of the ... | /// @title This library is created to conduct a variety of burn liquidity methods | NatSpecSingleLine | burnExactLiquidity | function burnExactLiquidity(
IUniswapV3Pool pool,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
address to
) internal returns (uint256 amount0, uint256 amount1) {
uint128 liquidityInPool = pool.positionLiquidity(tickLower, tickUpper);
require(liquidityInPool >= liquidity, "TML... | /**
* @notice Withdraws exact amount of liquidity
* @param pool Uniswap V3 pool
* @param tickLower The lower tick of the range
* @param tickUpper The upper tick of the range
* @param liquidity to burn
* @param to Recipient of amounts
* @return amount0 Amount of token0 withdrawed
* @return amount1 Amount... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1969,
2744
]
} | 29,475 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | PoolActions | library PoolActions {
using PoolVariables for IUniswapV3Pool;
using LowGasSafeMath for uint256;
using SafeCast for uint256;
/**
* @notice Withdraws liquidity in share proportion to the Sorbetto's totalSupply.
* @param pool Uniswap V3 pool
* @param tickLower The lower tick of the ... | /// @title This library is created to conduct a variety of burn liquidity methods | NatSpecSingleLine | burnAllLiquidity | function burnAllLiquidity(
IUniswapV3Pool pool,
int24 tickLower,
int24 tickUpper
) internal {
// Burn all liquidity in this range
uint128 liquidity = pool.positionLiquidity(tickLower, tickUpper);
if (liquidity > 0) {
pool.burn(tickLower, tickUpper, liquidity);
}
... | /**
* @notice Withdraws all liquidity in a range from Uniswap pool
* @param pool Uniswap V3 pool
* @param tickLower The lower tick of the range
* @param tickUpper The upper tick of the range
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2976,
3562
]
} | 29,476 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | Babylonian | library Babylonian {
// credit for this implementation goes to
// https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L687
function sqrt(uint256 x) internal pure returns (uint256) {
if (x == 0) return 0;
// this block is equivalent to r = uint256(1) ... | // computes square roots using the babylonian method
// https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method | LineComment | sqrt | function sqrt(uint256 x) internal pure returns (uint256) {
if (x == 0) return 0;
// this block is equivalent to r = uint256(1) << (BitMath.mostSignificantBit(x) / 2);
// however that code costs significantly more gas
uint256 xx = x;
uint256 r = 1;
if (xx >= 0x100000000000000000000000000000... | // credit for this implementation goes to
// https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L687 | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
171,
1415
]
} | 29,477 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ChainId | library ChainId {
/// @dev Gets the current chain ID
/// @return chainId The current chain ID
function get() internal pure returns (uint256 chainId) {
assembly {
chainId := chainid()
}
}
} | /// @title Function for getting the current chain ID | NatSpecSingleLine | get | function get() internal pure returns (uint256 chainId) {
assembly {
chainId := chainid()
}
}
| /// @dev Gets the current chain ID
/// @return chainId The current chain ID | NatSpecSingleLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
105,
238
]
} | 29,478 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ECDSA | library ECDSA {
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
// EIP-2 still allows signature malleability for ecrecover(). R... | /**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/ | NatSpecMultiLine | recover | function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), de... | /**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
148,
1498
]
} | 29,479 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ECDSA | library ECDSA {
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
// EIP-2 still allows signature malleability for ecrecover(). R... | /**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/ | NatSpecMultiLine | toTypedDataHash | function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
| /**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1843,
2044
]
} | 29,480 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | EIP712 | abstract contract EIP712 {
/* solhint-disable var-name-mixedcase */
// Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
// invalidate the cached domain separator if the chain id changes.
bytes32 private immutable _CACHED_DOMAIN_SEPARAT... | /**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols ... | NatSpecMultiLine | _domainSeparatorV4 | function _domainSeparatorV4() internal view returns (bytes32) {
if (ChainId.get() == _CACHED_CHAIN_ID) {
return _CACHED_DOMAIN_SEPARATOR;
} else {
return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
}
}
| /**
* @dev Returns the domain separator for the current chain.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1777,
2063
]
} | 29,481 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | EIP712 | abstract contract EIP712 {
/* solhint-disable var-name-mixedcase */
// Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
// invalidate the cached domain separator if the chain id changes.
bytes32 private immutable _CACHED_DOMAIN_SEPARAT... | /**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols ... | NatSpecMultiLine | _hashTypedDataV4 | function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
}
| /**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```sol... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3045,
3217
]
} | 29,482 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20Permit | interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
* given `owner`'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
... | /**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed b... | NatSpecMultiLine | permit | function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
| /**
* @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
* given `owner`'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
840,
966
]
} | 29,483 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20Permit | interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
* given `owner`'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
... | /**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed b... | NatSpecMultiLine | nonces | function nonces(address owner) external view returns (uint256);
| /**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1275,
1343
]
} | 29,484 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | IERC20Permit | interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
* given `owner`'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
... | /**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed b... | NatSpecMultiLine | DOMAIN_SEPARATOR | function DOMAIN_SEPARATOR() external view returns (bytes32);
| // solhint-disable-next-line func-name-mixedcase | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1536,
1601
]
} | 29,485 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | name | function name() public view virtual returns (string memory) {
return _name;
}
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
873,
969
]
} | 29,486 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | symbol | function symbol() public view virtual returns (string memory) {
return _symbol;
}
| /**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1083,
1183
]
} | 29,487 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | decimals | function decimals() public view virtual returns (uint8) {
return _decimals;
}
| /**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1816,
1912
]
} | 29,488 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | totalSupply | function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
| /**
* @dev See {IERC20-totalSupply}.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
1972,
2085
]
} | 29,489 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | balanceOf | function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
| /**
* @dev See {IERC20-balanceOf}.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2143,
2275
]
} | 29,490 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| /**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2483,
2663
]
} | 29,491 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | allowance | function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
| /**
* @dev See {IERC20-allowance}.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
2721,
2877
]
} | 29,492 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| /**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3019,
3193
]
} | 29,493 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "TEA"));
return true;
}
| /**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
3670,
3959
]
} | 29,494 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | increaseAllowance | function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
| /**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
4363,
4586
]
} | 29,495 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "DEB"));
return true;
}
| /**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
5084,
5324
]
} | 29,496 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _transfer | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "FZA");
require(recipient != address(0), "TZA");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "TEB");
_balances[recipi... | /**
* @dev 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.
*... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
5809,
6252
]
} | 29,497 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _mint | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "MZA");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amoun... | /** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
6529,
6884
]
} | 29,498 |
SorbettoFragola | SorbettoFragola.sol | 0x98d149e227c75d38f623a9aa9f030fb222b3faa3 | Solidity | ERC20 | contract ERC20 is Context, IERC20 {
using LowGasSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 privat... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _burn | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "BZA");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "BEB");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0)... | /**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://17a0ff78ae37eadd3a897e80511d728021795b93b530e9d516acb0263696e5bd | {
"func_code_index": [
7212,
7574
]
} | 29,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.