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
BondingShareV2
contracts/interfaces/IMasterChefV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
IMasterChefV2
interface IMasterChefV2 { struct BondingShareInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { uint256 lastRewardBlock; // Last block number that SUSHI distribution occurs. uint25...
getBondingShareInfo
function getBondingShareInfo(uint256 _id) external view returns (uint256[2] memory);
// Info about a bondinh share
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 909, 1021 ] }
3,307
BondingShareV2
contracts/interfaces/IMasterChefV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
IMasterChefV2
interface IMasterChefV2 { struct BondingShareInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { uint256 lastRewardBlock; // Last block number that SUSHI distribution occurs. uint25...
totalShares
function totalShares() external view returns (uint256);
// Total amount of shares
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1053, 1112 ] }
3,308
BondingShareV2
contracts/interfaces/IMasterChefV2.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
IMasterChefV2
interface IMasterChefV2 { struct BondingShareInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { uint256 lastRewardBlock; // Last block number that SUSHI distribution occurs. uint25...
pendingUGOV
function pendingUGOV(address _user) external view returns (uint256);
// View function to see pending SUSHIs on frontend.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1170, 1242 ] }
3,309
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
setInventory
function setInventory(address _inventory) external onlyOwner { farm.inventory = _inventory; }
/** * @dev Changes inventory contract */
NatSpecMultiLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 5026, 5138 ] }
3,310
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
farmDeploy
function farmDeploy(uint256 _creatureId, uint256 _landId) external { require(FARMING_ENABLED == true, "Chief Farmer not enable yet"); require(ICreatures(farm.creatures).ownerOf(_creatureId) == msg.sender, "Need to be Creature Owner" ); require(ILand(farm.land).ownerOf(_landId) == msg.sende...
/** * @dev Start farming process. New NFT - Egg will minted for user * @param _creatureId - NFT tokenId, caller must be owner of this token * @param _landId -- NFT tokenId, caller must be owner of this token */
NatSpecMultiLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 6261, 8572 ] }
3,311
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
harvest
function harvest(uint256 _deployId) external { require(eggs.ownerOf(_deployId) == msg.sender, "This is NOT YOUR EGG"); FarmRecord storage f = farming[_deployId]; require(f.harvestTime <= block.timestamp, "To early for harvest"); //Lets Calculate Dung/CHAD-DEGEN chance Result farming...
/** * @dev Finish farming process. Egg NFT will be burn * @param _deployId - NFT tokenId, caller must be owner of this token */
NatSpecMultiLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 8728, 15754 ] }
3,312
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
stakeOneTool
function stakeOneTool(uint8 _itemId) external { _stakeOneTool(_itemId); }
/** * @dev Stake one inventory item * @param _itemId - NFT tokenId, caller must be owner of this token */
NatSpecMultiLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 15887, 15979 ] }
3,313
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
unstakeOneTool
function unstakeOneTool(uint8 _itemId) external { _unstakeOneTool(_itemId); }
/** * @dev UnStake one inventory item * @param _itemId - NFT tokenId */
NatSpecMultiLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 16080, 16176 ] }
3,314
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
setOneCommonAmulet
function setOneCommonAmulet(uint8 _index, address _token) external onlyOwner { COMMON_AMULETS[_index] = _token; }
///////////////////////////////////////////////////// //// Admin functions /////// /////////////////////////////////////////////////////
NatSpecSingleLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 16356, 16488 ] }
3,315
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
addOperator
function addOperator(address _contract, address newOperator) external onlyOwner { IOperatorManage(_contract).addOperator(newOperator); }
//////////////////////////////////////// /// Proxy for NFT Operators mamnage // ////////////////////////////////////////
NatSpecSingleLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 17158, 17314 ] }
3,316
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
getCreatureAmulets
function getCreatureAmulets(uint8 _creatureType) external view returns (address[] memory) { return _getCreatureAmulets(_creatureType); }
////////////////////////////////////////////////////////
NatSpecSingleLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 17724, 17879 ] }
3,317
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
_endFarming
function _endFarming(uint256 _deployId, Result _res) internal { //TODO need refactor if EGGs will be FarmRecord storage f = farming[_deployId]; f.harvest = _res; // unstake creature ICreatures(farm.creatures).transferFrom(address(this), msg.sender, f.creatureId); eggs.burn(_deployId); // ...
/** * @dev Save farming results in storage and mint * appropriate token (NFT, ERC20 or None) */
NatSpecMultiLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 19844, 20765 ] }
3,318
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
onERC1155Received
function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external override returns(bytes4) { return bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")); }
/** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own func...
NatSpecMultiLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 28088, 28427 ] }
3,319
Creatures
DegensFarmBase.sol
0xd227df494367a8b769b4bf2bbebd0388a8758741
Solidity
DegenFarmBase
abstract contract DegenFarmBase is ERC1155Receiver, Ownable { enum AnimalType { Cow, Horse, Rabbit, Chicken, Pig, Cat, Dog, Goose, Goat, Sheep, Snake, Fish, Frog, Worm, Lama, Mouse, Camel, Donkey, Bee, Duck, GenesisEgg // 20 } enum Rarity { Normie, // 0 Ch...
onERC1155BatchReceived
function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override returns(bytes4) { return bytes4(keccak256("onERC1155BatchReceived(address,address,uint256,uint256,bytes)")); }
/** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc1...
NatSpecMultiLine
v0.7.4+commit.3f05b770
MIT
ipfs://308c7d0f38216f626771d86f2b5b3091893bd5f12659a801a1f13db0060ec78f
{ "func_code_index": [ 29425, 29794 ] }
3,320
BondingShareV2
contracts/BondingFormulas.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingFormulas
contract BondingFormulas { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; uint256 public constant ONE = uint256(1 ether); // 18 decimals /// @dev formula UBQ Rights corresponding to a bonding shares LP amount /// @param _bond , bonding share /// @param _amount , amount of LP...
sharesForLP
function sharesForLP( BondingShareV2.Bond memory _bond, uint256[2] memory _shareInfo, uint256 _amount ) public pure returns (uint256 _uLP) { bytes16 a = _shareInfo[0].fromUInt(); // shares amount bytes16 v = _amount.fromUInt(); bytes16 t = _bond.lpAmount.fromUInt(); _uLP = a.mul(v).div(t).t...
/// @dev formula UBQ Rights corresponding to a bonding shares LP amount /// @param _bond , bonding share /// @param _amount , amount of LP tokens /// @notice shares = (bond.shares * _amount ) / bond.lpAmount ;
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 397, 767 ] }
3,321
BondingShareV2
contracts/BondingFormulas.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingFormulas
contract BondingFormulas { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; uint256 public constant ONE = uint256(1 ether); // 18 decimals /// @dev formula UBQ Rights corresponding to a bonding shares LP amount /// @param _bond , bonding share /// @param _amount , amount of LP...
lpRewardsRemoveLiquidityNormalization
function lpRewardsRemoveLiquidityNormalization( BondingShareV2.Bond memory _bond, uint256[2] memory _shareInfo, uint256 _amount ) public pure returns (uint256) { return _amount; }
/* solhint-disable no-unused-vars */
Comment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1069, 1292 ] }
3,322
BondingShareV2
contracts/BondingFormulas.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingFormulas
contract BondingFormulas { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; uint256 public constant ONE = uint256(1 ether); // 18 decimals /// @dev formula UBQ Rights corresponding to a bonding shares LP amount /// @param _bond , bonding share /// @param _amount , amount of LP...
lpRewardsAddLiquidityNormalization
function lpRewardsAddLiquidityNormalization( BondingShareV2.Bond memory _bond, uint256[2] memory _shareInfo, uint256 _amount ) public pure returns (uint256) { return _amount; }
/* solhint-disable no-unused-vars */
Comment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1632, 1852 ] }
3,323
BondingShareV2
contracts/BondingFormulas.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
BondingFormulas
contract BondingFormulas { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; uint256 public constant ONE = uint256(1 ether); // 18 decimals /// @dev formula UBQ Rights corresponding to a bonding shares LP amount /// @param _bond , bonding share /// @param _amount , amount of LP...
correctedAmountToWithdraw
function correctedAmountToWithdraw( uint256 _totalLpDeposited, uint256 _bondingLpBalance, uint256 _amount ) public pure returns (uint256) { if (_bondingLpBalance < _totalLpDeposited && _bondingLpBalance > 0) { // if there is less LP token inside the bonding contract that what have been deposited...
/// @dev formula to calculate the corrected amount to withdraw based on the proportion of /// lp deposited against actual LP token on thge bonding contract /// @param _totalLpDeposited , Total amount of LP deposited by users /// @param _bondingLpBalance , actual bonding contract LP tokens balance minus lp rewards ...
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2448, 3126 ] }
3,324
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
withdraw
function withdraw(uint256 _pid, uint256 _amount) external;
// Withdraw LP tokens from MasterChef.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 916, 978 ] }
3,325
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
massUpdatePools
function massUpdatePools() external;
// Update reward vairables for all pools. Be careful of gas spending!
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1054, 1094 ] }
3,326
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
updatePool
function updatePool(uint256 _pid) external;
// Update reward variables of the given pool to be up-to-date.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1163, 1210 ] }
3,327
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
add
function add( uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate ) external;
// Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1371, 1483 ] }
3,328
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
set
function set( uint256 _pid, uint256 _allocPoint, bool _withUpdate ) external;
// Update the given pool's SUSHI allocation point. Can only be called by the owner.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1573, 1682 ] }
3,329
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
owner
function owner() external view returns (address);
// Returns the address of the current owner.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1733, 1786 ] }
3,330
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
userInfo
function userInfo(uint256 pid, address user) external view returns (ISushiMasterChef.UserInfo memory);
// Info of each pool.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1814, 1944 ] }
3,331
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
sushiPerBlock
function sushiPerBlock() external view returns (uint256);
// SUSHI tokens created per block.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1985, 2046 ] }
3,332
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
poolInfo
function poolInfo(uint256 pid) external view returns (ISushiMasterChef.PoolInfo memory);
// Info of each pool.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2074, 2190 ] }
3,333
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
totalAllocPoint
function totalAllocPoint() external view returns (uint256);
// Total allocation poitns. Must be the sum of all allocation points in all pools.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2279, 2342 ] }
3,334
BondingShareV2
contracts/interfaces/ISushiMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ISushiMasterChef
interface ISushiMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocati...
pendingSushi
function pendingSushi(uint256 _pid, address _user) external view returns (uint256);
// View function to see pending SUSHIs on frontend.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2460, 2571 ] }
3,335
BondingShareV2
contracts/DebtCoupon.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
DebtCoupon
contract DebtCoupon is ERC1155Ubiquity { using StructuredLinkedList for StructuredLinkedList.List; //not public as if called externally can give inaccurate value. see method uint256 private _totalOutstandingDebt; //represents tokenSupply of each expiry (since 1155 doesnt have this) mapping(uint256...
/// @title A coupon redeemable for dollars with an expiry block number /// @notice An ERC1155 where the token ID is the expiry block number /// @dev Implements ERC1155 so receiving contracts must implement IERC1155Receiver
NatSpecSingleLine
mintCoupons
function mintCoupons( address recipient, uint256 amount, uint256 expiryBlockNumber ) public onlyCouponManager { mint(recipient, expiryBlockNumber, amount, ""); emit MintedCoupons(recipient, expiryBlockNumber, amount); //insert new relevant block number if it doesnt exist in our list // (lin...
/// @notice Mint an amount of coupons expiring at a certain block for a certain recipient /// @param amount amount of tokens to mint /// @param expiryBlockNumber the expiration block number of the coupons to mint
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1348, 2068 ] }
3,336
BondingShareV2
contracts/DebtCoupon.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
DebtCoupon
contract DebtCoupon is ERC1155Ubiquity { using StructuredLinkedList for StructuredLinkedList.List; //not public as if called externally can give inaccurate value. see method uint256 private _totalOutstandingDebt; //represents tokenSupply of each expiry (since 1155 doesnt have this) mapping(uint256...
/// @title A coupon redeemable for dollars with an expiry block number /// @notice An ERC1155 where the token ID is the expiry block number /// @dev Implements ERC1155 so receiving contracts must implement IERC1155Receiver
NatSpecSingleLine
burnCoupons
function burnCoupons( address couponOwner, uint256 amount, uint256 expiryBlockNumber ) public onlyCouponManager { require( balanceOf(couponOwner, expiryBlockNumber) >= amount, "Coupon owner not enough coupons" ); burn(couponOwner, expiryBlockNumber, amount); emit BurnedCoupon...
/// @notice Burn an amount of coupons expiring at a certain block from /// a certain holder's balance /// @param couponOwner the owner of those coupons /// @param amount amount of tokens to burn /// @param expiryBlockNumber the expiration block number of the coupons to burn
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2365, 3035 ] }
3,337
BondingShareV2
contracts/DebtCoupon.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
DebtCoupon
contract DebtCoupon is ERC1155Ubiquity { using StructuredLinkedList for StructuredLinkedList.List; //not public as if called externally can give inaccurate value. see method uint256 private _totalOutstandingDebt; //represents tokenSupply of each expiry (since 1155 doesnt have this) mapping(uint256...
/// @title A coupon redeemable for dollars with an expiry block number /// @notice An ERC1155 where the token ID is the expiry block number /// @dev Implements ERC1155 so receiving contracts must implement IERC1155Receiver
NatSpecSingleLine
updateTotalDebt
function updateTotalDebt() public { bool reachedEndOfExpiredKeys = false; uint256 currentBlockNumber = _sortedBlockNumbers.popFront(); //if list is empty, currentBlockNumber will be 0 while (!reachedEndOfExpiredKeys && currentBlockNumber != 0) { if (currentBlockNumber > block.number) { ...
// Updates debt according to current block number
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3163, 4128 ] }
3,338
BondingShareV2
contracts/DebtCoupon.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
DebtCoupon
contract DebtCoupon is ERC1155Ubiquity { using StructuredLinkedList for StructuredLinkedList.List; //not public as if called externally can give inaccurate value. see method uint256 private _totalOutstandingDebt; //represents tokenSupply of each expiry (since 1155 doesnt have this) mapping(uint256...
/// @title A coupon redeemable for dollars with an expiry block number /// @notice An ERC1155 where the token ID is the expiry block number /// @dev Implements ERC1155 so receiving contracts must implement IERC1155Receiver
NatSpecSingleLine
getTotalOutstandingDebt
function getTotalOutstandingDebt() public view returns (uint256) { uint256 outstandingDebt = _totalOutstandingDebt; bool reachedEndOfExpiredKeys = false; (, uint256 currentBlockNumber) = _sortedBlockNumbers.getNextNode(0); while (!reachedEndOfExpiredKeys && currentBlockNumber != 0) { if (curren...
/// @notice Returns outstanding debt by fetching current tally and removing any expired debt
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 4227, 4983 ] }
3,339
BondingShareV2
contracts/UbiquityAutoRedeem.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
UbiquityAutoRedeem
contract UbiquityAutoRedeem is ERC20Ubiquity { constructor(address _manager) ERC20Ubiquity(_manager, "Ubiquity Auto Redeem", "uAR") {} // solhint-disable-line no-empty-blocks /// @notice raise capital in form of uAR (only redeemable when uAD > 1$) /// @param amount the amount to be minted /...
raiseCapital
function raiseCapital(uint256 amount) external { address treasuryAddress = manager.treasuryAddress(); mint(treasuryAddress, amount); }
/// @notice raise capital in form of uAR (only redeemable when uAD > 1$) /// @param amount the amount to be minted /// @dev you should be minter to call that function
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 371, 529 ] }
3,340
BondingShareV2
contracts/interfaces/IMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
IMasterChef
interface IMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { uint256 lastRewardBlock; // Last block number that SUSHI distribution occurs. uint256 accuGOVP...
withdraw
function withdraw(uint256 _amount, address sender) external;
// Withdraw LP tokens from MasterChef.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 615, 679 ] }
3,341
BondingShareV2
contracts/interfaces/IMasterChef.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
IMasterChef
interface IMasterChef { struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. } struct PoolInfo { uint256 lastRewardBlock; // Last block number that SUSHI distribution occurs. uint256 accuGOVP...
pendingUGOV
function pendingUGOV(address _user) external view returns (uint256);
// View function to see pending SUSHIs on frontend.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 737, 809 ] }
3,342
BondingShareV2
contracts/DollarMintingCalculator.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
DollarMintingCalculator
contract DollarMintingCalculator is IDollarMintingCalculator { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; bytes16 private immutable _one = (uint256(1 ether)).fromUInt(); UbiquityAlgorithmicDollarManager public manager; /// @param _manager the address of the manager contract so...
/// @title A mock coupon calculator that always returns a constant
NatSpecSingleLine
getDollarsToMint
function getDollarsToMint() external view override returns (uint256) { TWAPOracle oracle = TWAPOracle(manager.twapOracleAddress()); uint256 twapPrice = oracle.consult(manager.dollarTokenAddress()); require(twapPrice > 1, "DollarMintingCalculator: not > 1"); return twapPrice .fromUInt...
/// @notice returns (TWAP_PRICE -1) * UAD_Total_Supply
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 509, 1186 ] }
3,343
BondingShareV2
contracts/UbiquityAlgorithmicDollar.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
UbiquityAlgorithmicDollar
contract UbiquityAlgorithmicDollar is ERC20Ubiquity { /// @notice get associated incentive contract, 0 address if N/A mapping(address => address) public incentiveContract; event IncentiveContractUpdate( address indexed _incentivized, address indexed _incentiveContract ); constructo...
setIncentiveContract
function setIncentiveContract(address account, address incentive) external { require( ERC20Ubiquity.manager.hasRole( ERC20Ubiquity.manager.UBQ_TOKEN_MANAGER_ROLE(), msg.sender ), "Dollar: must have admin role" ); incentiveContract[account] = incentive; em...
/// @param account the account to incentivize /// @param incentive the associated incentive contract /// @notice only UAD manager can set Incentive contract
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 627, 1040 ] }
3,344
AlphaDraconis
contracts/AlphaDraconis.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
AlphaDraconis
contract AlphaDraconis is Ownable, ERC721A, ReentrancyGuard { uint32 preSaleStartTime = 1643378400; uint32 publicSaleStartTime = 1643464800; uint256 public maxPerAddressDuringMint; uint256 public whitelistPrice = 35000000000000000; uint256 public publicPrice = 50000000000000000; uint256 MA...
mint
function mint(uint256 quantity) external payable callerIsUser { require( totalSupply() + quantity <= collectionSize, "reached max supply" ); if (freelist[msg.sender] > 0) { require(freelist[msg.sender] > 0, "You are not in freelist"); require( block.time...
// Main functions
LineComment
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 1308, 3498 ] }
3,345
AlphaDraconis
contracts/AlphaDraconis.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
AlphaDraconis
contract AlphaDraconis is Ownable, ERC721A, ReentrancyGuard { uint32 preSaleStartTime = 1643378400; uint32 publicSaleStartTime = 1643464800; uint256 public maxPerAddressDuringMint; uint256 public whitelistPrice = 35000000000000000; uint256 public publicPrice = 50000000000000000; uint256 MA...
setWhitelist
function setWhitelist(address[] memory addresses, uint256[] memory numSlots) external onlyOwner { require( addresses.length == numSlots.length, "addresses does not match numSlots length" ); for (uint256 i = 0; i < addresses.length; i++) { whitelist[addresses[i]] = numSlots[i]; } }
// Address Functions
LineComment
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 4387, 4728 ] }
3,346
AlphaDraconis
contracts/AlphaDraconis.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
AlphaDraconis
contract AlphaDraconis is Ownable, ERC721A, ReentrancyGuard { uint32 preSaleStartTime = 1643378400; uint32 publicSaleStartTime = 1643464800; uint256 public maxPerAddressDuringMint; uint256 public whitelistPrice = 35000000000000000; uint256 public publicPrice = 50000000000000000; uint256 MA...
withdrawMoney
function withdrawMoney() external onlyOwner nonReentrant { require(address(this).balance > 0, "No ether left to withdraw"); (bool success, ) = msg.sender.call{value: address(this).balance}(""); require(success, "Transfer failed."); }
// Withdraw
LineComment
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 5090, 5344 ] }
3,347
AlphaDraconis
contracts/AlphaDraconis.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
AlphaDraconis
contract AlphaDraconis is Ownable, ERC721A, ReentrancyGuard { uint32 preSaleStartTime = 1643378400; uint32 publicSaleStartTime = 1643464800; uint256 public maxPerAddressDuringMint; uint256 public whitelistPrice = 35000000000000000; uint256 public publicPrice = 50000000000000000; uint256 MA...
changePresaleTime
function changePresaleTime(uint32 _newDate) public onlyOwner { preSaleStartTime = _newDate;
// Update timestamp
LineComment
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 5370, 5484 ] }
3,348
BondingShareV2
contracts/ExcessDollarsDistributor.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ExcessDollarsDistributor
contract ExcessDollarsDistributor is IExcessDollarsDistributor { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; UbiquityAlgorithmicDollarManager public manager; uint256 private immutable _minAmountToDistribute = 100...
/// @title An excess dollar distributor which sends dollars to treasury, /// lp rewards and inflation rewards
NatSpecSingleLine
_swapDollarsForGovernance
function _swapDollarsForGovernance(bytes16 amountIn) internal returns (uint256) { address[] memory path = new address[](2); path[0] = manager.dollarTokenAddress(); path[1] = manager.governanceTokenAddress(); uint256[] memory amounts = _router.swapExactTokensForTokens( amountIn.toUInt(), ...
// swap half amount to uGOV
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1933, 2427 ] }
3,349
BondingShareV2
contracts/ExcessDollarsDistributor.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ExcessDollarsDistributor
contract ExcessDollarsDistributor is IExcessDollarsDistributor { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; UbiquityAlgorithmicDollarManager public manager; uint256 private immutable _minAmountToDistribute = 100...
/// @title An excess dollar distributor which sends dollars to treasury, /// lp rewards and inflation rewards
NatSpecSingleLine
_governanceBuyBackLPAndBurn
function _governanceBuyBackLPAndBurn(uint256 amount) internal { bytes16 amountUAD = (amount.fromUInt()).div(uint256(2).fromUInt()); // we need to approve sushi router IERC20Ubiquity(manager.dollarTokenAddress()).safeApprove( address(_router), 0 ); IERC20Ubiquity(manager.dollarTokenA...
// buy-back and burn uGOV
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2459, 3565 ] }
3,350
BondingShareV2
contracts/ExcessDollarsDistributor.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
ExcessDollarsDistributor
contract ExcessDollarsDistributor is IExcessDollarsDistributor { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; UbiquityAlgorithmicDollarManager public manager; uint256 private immutable _minAmountToDistribute = 100...
/// @title An excess dollar distributor which sends dollars to treasury, /// lp rewards and inflation rewards
NatSpecSingleLine
_convertToCurveLPAndTransfer
function _convertToCurveLPAndTransfer(uint256 amount) internal returns (uint256) { // we need to approve metaPool IERC20Ubiquity(manager.dollarTokenAddress()).safeApprove( manager.stableSwapMetaPoolAddress(), 0 ); IERC20Ubiquity(manager.dollarTokenAddress()).safeApprove( ...
// @dev convert to curve LP // @param amount to convert to curve LP by swapping to 3CRV // and deposit the 3CRV as liquidity to get uAD-3CRV LP tokens // the LP token are sent to the bonding contract
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3797, 5046 ] }
3,351
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
listExists
function listExists(List storage self) internal view returns (bool) { // if the head nodes previous or next pointers both point to itself, then there are no items in the list if (self.list[_HEAD][_PREV] != _HEAD || self.list[_HEAD][_NEXT] != _HEAD) { return true; } else { return false; }...
/** * @dev Checks if the list exists * @param self stored linked list from contract * @return bool true if list exists, false otherwise */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 464, 818 ] }
3,352
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
nodeExists
function nodeExists(List storage self, uint256 _node) internal view returns (bool) { if (self.list[_node][_PREV] == _HEAD && self.list[_node][_NEXT] == _HEAD) { if (self.list[_HEAD][_NEXT] == _node) { return true; } else { return false; } } else { return t...
/** * @dev Checks if the node exists * @param self stored linked list from contract * @param _node a node to search for * @return bool true if node exists, false otherwise */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1024, 1400 ] }
3,353
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
sizeOf
function sizeOf(List storage self) internal view returns (uint256) { return self.size; }
/** * @dev Returns the number of elements in the list * @param self stored linked list from contract * @return uint256 */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1548, 1652 ] }
3,354
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
getNode
function getNode(List storage self, uint256 _node) internal view returns (bool, uint256, uint256) { if (!nodeExists(self, _node)) { return (false, 0, 0); } else { return (true, self.list[_node][_PREV], self.list[_node][_NEXT]); } }
/** * @dev Returns the links of a node as a tuple * @param self stored linked list from contract * @param _node id of the node to get * @return bool, uint256, uint256 true if node exists or false otherwise, previous node, next node */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1918, 2205 ] }
3,355
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
getAdjacent
function getAdjacent(List storage self, uint256 _node, bool _direction) internal view returns (bool, uint256) { if (!nodeExists(self, _node)) { return (false, 0); } else { return (true, self.list[_node][_direction]); } }
/** * @dev Returns the link of a node `_node` in direction `_direction`. * @param self stored linked list from contract * @param _node id of the node to step from * @param _direction direction to step in * @return bool, uint256 true if node exists or false otherwise, node in _direction */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2531, 2807 ] }
3,356
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
getNextNode
function getNextNode(List storage self, uint256 _node) internal view returns (bool, uint256) { return getAdjacent(self, _node, _NEXT); }
/** * @dev Returns the link of a node `_node` in direction `_NEXT`. * @param self stored linked list from contract * @param _node id of the node to step from * @return bool, uint256 true if node exists or false otherwise, next node */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3073, 3225 ] }
3,357
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
getPreviousNode
function getPreviousNode(List storage self, uint256 _node) internal view returns (bool, uint256) { return getAdjacent(self, _node, _PREV); }
/** * @dev Returns the link of a node `_node` in direction `_PREV`. * @param self stored linked list from contract * @param _node id of the node to step from * @return bool, uint256 true if node exists or false otherwise, previous node */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3495, 3651 ] }
3,358
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
getSortedSpot
function getSortedSpot(List storage self, address _structure, uint256 _value) internal view returns (uint256) { if (sizeOf(self) == 0) { return 0; } uint256 next; (, next) = getAdjacent(self, _HEAD, _NEXT); while ((next != 0) && ((_value < IStructureInterface(_structure).getValue(next)) != ...
/** * @dev Can be used before `insert` to build an ordered list. * @dev Get the node and then `insertBefore` or `insertAfter` basing on your list order. * @dev If you want to order basing on other than `structure.getValue()` override this function * @param self stored linked list from contract * @param _structure ...
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 4126, 4563 ] }
3,359
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
insertAfter
function insertAfter(List storage self, uint256 _node, uint256 _new) internal returns (bool) { return _insert(self, _node, _new, _NEXT); }
/** * @dev Insert node `_new` beside existing node `_node` in direction `_NEXT`. * @param self stored linked list from contract * @param _node existing node * @param _new new node to insert * @return bool true if success, false otherwise */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 4841, 4995 ] }
3,360
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
insertBefore
function insertBefore(List storage self, uint256 _node, uint256 _new) internal returns (bool) { return _insert(self, _node, _new, _PREV); }
/** * @dev Insert node `_new` beside existing node `_node` in direction `_PREV`. * @param self stored linked list from contract * @param _node existing node * @param _new new node to insert * @return bool true if success, false otherwise */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 5273, 5428 ] }
3,361
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
remove
function remove(List storage self, uint256 _node) internal returns (uint256) { if ((_node == _NULL) || (!nodeExists(self, _node))) { return 0; } _createLink(self, self.list[_node][_PREV], self.list[_node][_NEXT], _NEXT); delete self.list[_node][_PREV]; delete self.list[_node][_NEXT]; se...
/** * @dev Removes an entry from the linked list * @param self stored linked list from contract * @param _node node to remove from the list * @return uint256 the removed node */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 5637, 6090 ] }
3,362
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
pushFront
function pushFront(List storage self, uint256 _node) internal returns (bool) { return _push(self, _node, _NEXT); }
/** * @dev Pushes an entry to the head of the linked list * @param self stored linked list from contract * @param _node new entry to push to the head * @return bool true if success, false otherwise */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 6322, 6452 ] }
3,363
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
pushBack
function pushBack(List storage self, uint256 _node) internal returns (bool) { return _push(self, _node, _PREV); }
/** * @dev Pushes an entry to the tail of the linked list * @param self stored linked list from contract * @param _node new entry to push to the tail * @return bool true if success, false otherwise */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 6684, 6813 ] }
3,364
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
popFront
function popFront(List storage self) internal returns (uint256) { return _pop(self, _NEXT); }
/** * @dev Pops the first entry from the head of the linked list * @param self stored linked list from contract * @return uint256 the removed node */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 6989, 7098 ] }
3,365
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
popBack
function popBack(List storage self) internal returns (uint256) { return _pop(self, _PREV); }
/** * @dev Pops the first entry from the tail of the linked list * @param self stored linked list from contract * @return uint256 the removed node */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 7274, 7382 ] }
3,366
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
_push
function _push(List storage self, uint256 _node, bool _direction) private returns (bool) { return _insert(self, _HEAD, _node, _direction); }
/** * @dev Pushes an entry to the head of the linked list * @param self stored linked list from contract * @param _node new entry to push to the head * @param _direction push to the head (_NEXT) or tail (_PREV) * @return bool true if success, false otherwise */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 7680, 7836 ] }
3,367
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
_pop
function _pop(List storage self, bool _direction) private returns (uint256) { uint256 adj; (, adj) = getAdjacent(self, _HEAD, _direction); return remove(self, adj); }
/** * @dev Pops the first entry from the linked list * @param self stored linked list from contract * @param _direction pop from the head (_NEXT) or the tail (_PREV) * @return uint256 the removed node */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 8071, 8269 ] }
3,368
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
_insert
function _insert(List storage self, uint256 _node, uint256 _new, bool _direction) private returns (bool) { if (!nodeExists(self, _new) && nodeExists(self, _node)) { uint256 c = self.list[_node][_direction]; _createLink(self, _node, _new, _direction); _createLink(self, _new, c, _direction); ...
/** * @dev Insert node `_new` beside existing node `_node` in direction `_direction`. * @param self stored linked list from contract * @param _node existing node * @param _new new node to insert * @param _direction direction to insert node in * @return bool true if success, false otherwise */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 8605, 9096 ] }
3,369
BondingShareV2
solidity-linked-list/contracts/StructuredLinkedList.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
StructuredLinkedList
library StructuredLinkedList { uint256 private constant _NULL = 0; uint256 private constant _HEAD = 0; bool private constant _PREV = false; bool private constant _NEXT = true; struct List { uint256 size; mapping(uint256 => mapping(bool => uint256)) list; } /** * @dev...
/** * @title StructuredLinkedList * @author Vittorio Minacori (https://github.com/vittominacori) * @dev An utility library for using sorted linked list data structures in your Solidity project. */
NatSpecMultiLine
_createLink
function _createLink(List storage self, uint256 _node, uint256 _link, bool _direction) private { self.list[_link][!_direction] = _node; self.list[_node][_direction] = _link; }
/** * @dev Creates a bidirectional link between two nodes on direction `_direction` * @param self stored linked list from contract * @param _node existing node * @param _link node to link to in the _direction * @param _direction direction to insert node in */
NatSpecMultiLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 9392, 9591 ] }
3,370
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
repay
function repay( ExchangeData memory _exchangeData, uint _cdpId, uint _gasCost, address _joinAddr, ManagerType _managerType ) public payable { address managerAddr = getManagerAddr(_managerType); address user = getOwner(Manager(managerAddr), _cdpId); bytes32 ilk = Manager(managerAddr).il...
/// @notice Repay - draws collateral, converts to Dai and repays the debt /// @dev Must be called by the DSProxy contract that owns the CDP
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 1273, 2330 ] }
3,371
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
boost
function boost( ExchangeData memory _exchangeData, uint _cdpId, uint _gasCost, address _joinAddr, ManagerType _managerType ) public payable { address managerAddr = getManagerAddr(_managerType); address user = getOwner(Manager(managerAddr), _cdpId); bytes32 ilk = Manager(managerAddr).il...
/// @notice Boost - draws Dai, converts to collateral and adds to CDP /// @dev Must be called by the DSProxy contract that owns the CDP
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 2476, 3562 ] }
3,372
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
drawDai
function drawDai(address _managerAddr, uint _cdpId, bytes32 _ilk, uint _daiAmount) internal returns (uint) { uint rate = Jug(JUG_ADDRESS).drip(_ilk); uint daiVatBalance = vat.dai(Manager(_managerAddr).urns(_cdpId)); uint maxAmount = getMaxDebt(_managerAddr, _cdpId, _ilk); if (_daiAmount >= maxAmount) ...
/// @notice Draws Dai from the CDP /// @dev If _daiAmount is bigger than max available we'll draw max /// @param _managerAddr Address of the CDP Manager /// @param _cdpId Id of the CDP /// @param _ilk Ilk of the CDP /// @param _daiAmount Amount of Dai to draw
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 3848, 4651 ] }
3,373
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
addCollateral
function addCollateral(address _managerAddr, uint _cdpId, address _joinAddr, uint _amount) internal { int convertAmount = 0; if (isEthJoinAddr(_joinAddr)) { Join(_joinAddr).gem().deposit{value: _amount}(); convertAmount = toPositiveInt(_amount); } else { convertAmount = toPositiveIn...
/// @notice Adds collateral to the CDP /// @param _managerAddr Address of the CDP Manager /// @param _cdpId Id of the CDP /// @param _joinAddr Address of the join contract for the CDP collateral /// @param _amount Amount of collateral to add
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 4915, 5671 ] }
3,374
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
drawCollateral
function drawCollateral(address _managerAddr, uint _cdpId, address _joinAddr, uint _amount) internal returns (uint) { uint frobAmount = _amount; if (Join(_joinAddr).dec() != 18) { frobAmount = _amount * (10 ** (18 - Join(_joinAddr).dec())); } Manager(_managerAddr).frob(_cdpId, -toPositiveInt(f...
/// @notice Draws collateral and returns it to DSProxy /// @param _managerAddr Address of the CDP Manager /// @dev If _amount is bigger than max available we'll draw max /// @param _cdpId Id of the CDP /// @param _joinAddr Address of the join contract for the CDP collateral /// @param _amount Amount of collateral to dr...
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 6020, 6655 ] }
3,375
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
paybackDebt
function paybackDebt(address _managerAddr, uint _cdpId, bytes32 _ilk, uint _daiAmount, address _owner) internal { address urn = Manager(_managerAddr).urns(_cdpId); uint wholeDebt = getAllDebt(VAT_ADDRESS, urn, urn, _ilk); if (_daiAmount > wholeDebt) { ERC20(DAI_ADDRESS).transfer(_owner, sub(_daiAm...
/// @notice Paybacks Dai debt /// @param _managerAddr Address of the CDP Manager /// @dev If the _daiAmount is bigger than the whole debt, returns extra Dai /// @param _cdpId Id of the CDP /// @param _ilk Ilk of the CDP /// @param _daiAmount Amount of Dai to payback /// @param _owner Address that owns the DSProxy that ...
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 7018, 7725 ] }
3,376
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
getMaxCollateral
function getMaxCollateral(address _managerAddr, uint _cdpId, bytes32 _ilk, address _joinAddr) public view returns (uint) { uint price = getPrice(_ilk); (uint collateral, uint debt) = getCdpInfo(Manager(_managerAddr), _cdpId, _ilk); (, uint mat) = Spotter(SPOTTER_ADDRESS).ilks(_ilk); uint maxCollatera...
/// @notice Gets the maximum amount of collateral available to draw /// @param _managerAddr Address of the CDP Manager /// @param _cdpId Id of the CDP /// @param _ilk Ilk of the CDP /// @param _joinAddr Joind address of collateral /// @dev Substracts 10 wei to aviod rounding error later on
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 8042, 8634 ] }
3,377
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
getMaxDebt
function getMaxDebt(address _managerAddr, uint _cdpId, bytes32 _ilk) public virtual view returns (uint) { uint price = getPrice(_ilk); (, uint mat) = spotter.ilks(_ilk); (uint collateral, uint debt) = getCdpInfo(Manager(_managerAddr), _cdpId, _ilk); return sub(sub(div(mul(collateral, price), mat), deb...
/// @notice Gets the maximum amount of debt available to generate /// @param _managerAddr Address of the CDP Manager /// @param _cdpId Id of the CDP /// @param _ilk Ilk of the CDP /// @dev Substracts 10 wei to aviod rounding error later on
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 8896, 9250 ] }
3,378
AaveMonitorV2
contracts/mcd/saver/MCDSaverProxy.sol
0xcfd05bebb84787ee2efb2ea633981e44d754485d
Solidity
MCDSaverProxy
contract MCDSaverProxy is DFSExchangeCore, MCDSaverProxyHelper { uint public constant MANUAL_SERVICE_FEE = 400; // 0.25% Fee uint public constant AUTOMATIC_SERVICE_FEE = 333; // 0.3% Fee bytes32 public constant ETH_ILK = 0x4554482d41000000000000000000000000000000000000000000000000000000; address publ...
/// @title Implements Boost and Repay for MCD CDPs
NatSpecSingleLine
getPrice
function getPrice(bytes32 _ilk) public view returns (uint) { (, uint mat) = spotter.ilks(_ilk); (,,uint spot,,) = vat.ilks(_ilk); return rmul(rmul(spot, spotter.par()), mat); }
/// @notice Gets a price of the asset /// @param _ilk Ilk of the CDP
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://285ff2512c6d59b899e93c3b1f893c007ccddbbaccb0949a28275f2880f4f0ca
{ "func_code_index": [ 9329, 9538 ] }
3,379
BondingShareV2
contracts/CurveUADIncentive.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
CurveUADIncentive
contract CurveUADIncentive is IIncentive { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; UbiquityAlgorithmicDollarManager public manager; bool public isSellPenaltyOn = true; bool public isBuyIncentiveOn = true; bytes16 private immutable _one = (uint256(1 ether)).fromUInt(); ...
/// @title Uniswap trading incentive contract /// @author uAD Protocol /// @dev incentives
NatSpecSingleLine
setExemptAddress
function setExemptAddress(address account, bool isExempt) external onlyAdmin { _exempt[account] = isExempt; emit ExemptAddressUpdate(account, isExempt); }
/// @notice set an address to be exempted from Uniswap trading incentives /// @param account the address to update /// @param isExempt a flag for whether to exempt or unexempt
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1645, 1843 ] }
3,380
BondingShareV2
contracts/CurveUADIncentive.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
CurveUADIncentive
contract CurveUADIncentive is IIncentive { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; UbiquityAlgorithmicDollarManager public manager; bool public isSellPenaltyOn = true; bool public isBuyIncentiveOn = true; bytes16 private immutable _one = (uint256(1 ether)).fromUInt(); ...
/// @title Uniswap trading incentive contract /// @author uAD Protocol /// @dev incentives
NatSpecSingleLine
switchSellPenalty
function switchSellPenalty() external onlyAdmin { isSellPenaltyOn = !isSellPenaltyOn; }
/// @notice switch the sell penalty
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 1885, 1988 ] }
3,381
BondingShareV2
contracts/CurveUADIncentive.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
CurveUADIncentive
contract CurveUADIncentive is IIncentive { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; UbiquityAlgorithmicDollarManager public manager; bool public isSellPenaltyOn = true; bool public isBuyIncentiveOn = true; bytes16 private immutable _one = (uint256(1 ether)).fromUInt(); ...
/// @title Uniswap trading incentive contract /// @author uAD Protocol /// @dev incentives
NatSpecSingleLine
switchBuyIncentive
function switchBuyIncentive() external onlyAdmin { isBuyIncentiveOn = !isBuyIncentiveOn; }
/// @notice switch the buy incentive
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2031, 2137 ] }
3,382
BondingShareV2
contracts/CurveUADIncentive.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
CurveUADIncentive
contract CurveUADIncentive is IIncentive { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; UbiquityAlgorithmicDollarManager public manager; bool public isSellPenaltyOn = true; bool public isBuyIncentiveOn = true; bytes16 private immutable _one = (uint256(1 ether)).fromUInt(); ...
/// @title Uniswap trading incentive contract /// @author uAD Protocol /// @dev incentives
NatSpecSingleLine
isExemptAddress
function isExemptAddress(address account) public view returns (bool) { return _exempt[account]; }
/// @notice returns true if account is marked as exempt
NatSpecSingleLine
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 2199, 2312 ] }
3,383
BondingShareV2
contracts/CurveUADIncentive.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
CurveUADIncentive
contract CurveUADIncentive is IIncentive { using ABDKMathQuad for uint256; using ABDKMathQuad for bytes16; UbiquityAlgorithmicDollarManager public manager; bool public isSellPenaltyOn = true; bool public isBuyIncentiveOn = true; bytes16 private immutable _one = (uint256(1 ether)).fromUInt(); ...
/// @title Uniswap trading incentive contract /// @author uAD Protocol /// @dev incentives
NatSpecSingleLine
_getPercentDeviationFromUnderPeg
function _getPercentDeviationFromUnderPeg(uint256 amount) internal returns (uint256) { _updateOracle(); uint256 curPrice = _getTWAPPrice(); if (curPrice >= 1 ether) { return 0; } uint256 res = _one .sub(curPrice.fromUInt()) .mul((amount.fromUInt().div(_one))) ...
// when uAD is <1$
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3168, 3622 ] }
3,384
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
setUGOVShareForTreasury
function setUGOVShareForTreasury(uint256 _uGOVDivider) external onlyTokenManager { uGOVDivider = _uGOVDivider; }
// the bigger uGOVDivider is the less extra Ugov will be minted for the treasury
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3194, 3342 ] }
3,385
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
pendingUBQ
function pendingUBQ(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accUbqPerShare = pool.accUbqPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (block.numb...
// View function to see pending UBQs on frontend.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 3497, 4372 ] }
3,386
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
add
function add( uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint + _allocPoint; pool...
// Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 4533, 5130 ] }
3,387
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
set
function set( uint256 _pid, uint256 _allocPoint, bool _withUpdate ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint; poolInfo[_pid].allocPoint = _allocPoint; }
// Update the given pool's UBQ allocation point. Can only be called by the owner.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 5218, 5580 ] }
3,388
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
massUpdatePools
function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } }
// Update reward vairables for all pools. Be careful of gas spending!
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 5656, 5835 ] }
3,389
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
updatePool
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number; return; } uint2...
// Update reward variables of the given pool to be up-to-date.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 5904, 6916 ] }
3,390
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
deposit
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = ((user.amount * pool.accUbqPerShare) / 1e12) - user.rewardDebt; _saf...
// Deposit LP tokens to MasterChef for UBQ allocation.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 6977, 7674 ] }
3,391
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
withdraw
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = ((user.amount * pool.accUbqPerShare) / 1e12) - user...
// Withdraw LP tokens from MasterChef.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 7719, 8363 ] }
3,392
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
emergencyWithdraw
function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; pool.lpToken.safeTransfer(address(msg.sender), user.amount); emit EmergencyWithdraw(msg.sender, _pid, user.amount); user.amount = 0; user.rewardDebt = 0; ...
// Withdraw without caring about rewards. EMERGENCY ONLY.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 8427, 8780 ] }
3,393
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
getMultiplier
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { if (_to <= bonusEndBlock) { return (_to - _from) * BONUS_MULTIPLIER; } else if (_from >= bonusEndBlock) { return _to - _from; } else { return ((bonusEndBlock - _from) * BONUS_MU...
// Return reward multiplier over the given _from to _to block.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 8849, 9283 ] }
3,394
BondingShareV2
contracts/MasterChefOriginal.sol
0x2da07859613c14f6f05c97efe37b9b4f212b5ef5
Solidity
MasterChefOriginal
contract MasterChefOriginal is Ownable { using SafeERC20 for IERC20Ubiquity; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
// MasterChef is the master of UBQ. He can make UBQ and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once UBQ is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it...
LineComment
_safeUGOVTransfer
function _safeUGOVTransfer(address _to, uint256 _amount) internal { IERC20Ubiquity uGOV = IERC20Ubiquity(manager.governanceTokenAddress()); uint256 uGOVBal = uGOV.balanceOf(address(this)); if (_amount > uGOVBal) { uGOV.safeTransfer(_to, uGOVBal); } else { uGOV.safeTransfer(_to, _amount);...
// Safe uGOV transfer function, just in case if rounding // error causes pool to not have enough uGOVs.
LineComment
v0.8.3+commit.8d00100c
MIT
none
{ "func_code_index": [ 9397, 9761 ] }
3,395
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
totalSupply
function totalSupply() public view override returns (uint256) { return currentIndex; }
/** * @dev See {IERC721Enumerable-totalSupply}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 1486, 1583 ] }
3,396
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
tokenByIndex
function tokenByIndex(uint256 index) public view override returns (uint256) { require(index < totalSupply(), "ERC721A: global index out of bounds"); return index; }
/** * @dev See {IERC721Enumerable-tokenByIndex}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 1649, 1829 ] }
3,397
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
tokenOfOwnerByIndex
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { require(index < balanceOf(owner), "ERC721A: owner index out of bounds"); uint256 numMintedSoFar = totalSupply(); uint256 tokenIdsIdx = 0; address currOwnershipAddr = address(0); for (uint256 i...
/** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 2114, 2861 ] }
3,398
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC721Enumerable).interfaceId || super.supports...
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 2922, 3295 ] }
3,399
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
balanceOf
function balanceOf(address owner) public view override returns (uint256) { require(owner != address(0), "ERC721A: balance query for the zero address"); return uint256(_addressData[owner].balance); }
/** * @dev See {IERC721-balanceOf}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 3348, 3562 ] }
3,400
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
ownerOf
function ownerOf(uint256 tokenId) public view override returns (address) { return ownershipOf(tokenId).addr; }
/** * @dev See {IERC721-ownerOf}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 4471, 4592 ] }
3,401
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
name
function name() public view virtual override returns (string memory) { return _name; }
/** * @dev See {IERC721Metadata-name}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 4648, 4745 ] }
3,402
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
symbol
function symbol() public view virtual override returns (string memory) { return _symbol; }
/** * @dev See {IERC721Metadata-symbol}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 4803, 4904 ] }
3,403
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
tokenURI
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require( _exists(tokenId), "ERC721Metadata: URI query for nonexistent token" ); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(bas...
/** * @dev See {IERC721Metadata-tokenURI}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 4964, 5361 ] }
3,404
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
_baseURI
function _baseURI() internal view virtual returns (string memory) { return ""; }
/** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 5594, 5685 ] }
3,405
AlphaDraconis
contracts/ERC721A.sol
0x749b2c1ef5db3f63e4fbb64888aec78620c7eac6
Solidity
ERC721A
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } ...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support ...
NatSpecMultiLine
approve
function approve(address to, uint256 tokenId) public override { address owner = ERC721A.ownerOf(tokenId); require(to != owner, "ERC721A: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721A: approve caller is not owner nor approved for all" ...
/** * @dev See {IERC721-approve}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b0129ac96174f95a991d497101ac24ab5f5670aaeac412cfa655370e3bcd815f
{ "func_code_index": [ 5736, 6118 ] }
3,406