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
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getTokenHandlerID
function getTokenHandlerID(uint256 index) external view returns (uint256) { return dataStorageInstance.getTokenHandlerID(index); }
/** * @dev Get the handler ID at the index in the handler list * @param index The index of the handler list (array) * @return The handler ID */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 13875, 14014 ] }
20,300
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getUserExtraLiquidityAmount
function getUserExtraLiquidityAmount(address payable userAddr, uint256 handlerID) external view returns (uint256) { return _getUserExtraLiquidityAmount(userAddr, handlerID); }
/** * @dev Get the amount of token that the user can borrow more * @param userAddr The address of user * @param handlerID The handler ID * @return The amount of token that user can borrow more */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 14225, 14409 ] }
20,301
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getUserIntraHandlerAssetWithInterest
function getUserIntraHandlerAssetWithInterest(address payable userAddr, uint256 handlerID) external view returns (uint256, uint256) { return _getUserIntraHandlerAssetWithInterest(userAddr, handlerID); }
/* about user market Information function*/
Comment
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 14688, 14899 ] }
20,302
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getUserTotalIntraCreditAsset
function getUserTotalIntraCreditAsset(address payable userAddr) external view returns (uint256, uint256) { return _getUserTotalIntraCreditAsset(userAddr); }
/** * @dev Get the depositTotalCredit and borrowTotalCredit * @param userAddr The address of the user * @return depositTotalCredit The amount that users can borrow (i.e. deposit * borrowLimit) * @return borrowTotalCredit The sum of borrow amount for all handlers */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 15180, 15345 ] }
20,303
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getUserLimitIntraAsset
function getUserLimitIntraAsset(address payable userAddr) external view returns (uint256, uint256) { uint256 userTotalBorrowLimitAsset; uint256 userTotalMarginCallLimitAsset; for (uint256 handlerID; handlerID < tokenHandlerLength; handlerID++) { if (dataStorageInstance.getTokenHandlerSupport(handlerID)) ...
/** * @dev Get the borrow and margin call limits of the user for all handlers * @param userAddr The address of the user * @return userTotalBorrowLimitAsset the sum of borrow limit for all handlers * @return userTotalMarginCallLimitAsset the sume of margin call limit for handlers */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 15643, 16772 ] }
20,304
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getUserCollateralizableAmount
function getUserCollateralizableAmount(address payable userAddr, uint256 callerID) external view returns (uint256) { uint256 userTotalBorrowAsset; uint256 depositAssetBorrowLimitSum; uint256 depositHandlerAsset; uint256 borrowHandlerAsset; for (uint256 handlerID; handlerID < tokenHandlerLength; handlerID++) ...
/** * @dev Get the maximum allowed amount to borrow of the user from the given handler * @param userAddr The address of the user * @param callerID The target handler to borrow * @return extraCollateralAmount The maximum allowed amount to borrow from the handler. */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 17059, 18125 ] }
20,305
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
partialLiquidationUser
function partialLiquidationUser(address payable delinquentBorrower, uint256 liquidateAmount, address payable liquidator, uint256 liquidateHandlerID, uint256 rewardHandlerID) onlyLiquidationManager external returns (uint256, uint256, uint256) { address tokenHandlerAddr = dataStorageInstance.getTokenHandlerAddr(liquid...
/** * @dev Partial liquidation for a user * @param delinquentBorrower The address of the liquidation target * @param liquidateAmount The amount to liquidate * @param liquidator The address of the liquidator (liquidation operator) * @param liquidateHandlerID The hander ID of the liquidating asset * @pa...
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 18563, 19266 ] }
20,306
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getMaxLiquidationReward
function getMaxLiquidationReward(address payable delinquentBorrower, uint256 liquidateHandlerID, uint256 liquidateAmount, uint256 rewardHandlerID, uint256 rewardRatio) external view returns (uint256) { uint256 liquidatePrice = _getTokenHandlerPrice(liquidateHandlerID); uint256 rewardPrice = _getTokenHandlerPrice(r...
/** * @dev Get the maximum liquidation reward by checking sufficient reward amount for the liquidator. * @param delinquentBorrower The address of the liquidation target * @param liquidateHandlerID The hander ID of the liquidating asset * @param liquidateAmount The amount to liquidate * @param reward...
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 19787, 20553 ] }
20,307
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
partialLiquidationUserReward
function partialLiquidationUserReward(address payable delinquentBorrower, uint256 rewardAmount, address payable liquidator, uint256 handlerID) onlyLiquidationManager external returns (uint256) { address tokenHandlerAddr = dataStorageInstance.getTokenHandlerAddr(handlerID); IProxy TokenHandler = IProxy(tokenHandler...
/** * @dev Reward the liquidator * @param delinquentBorrower The address of the liquidation target * @param rewardAmount The amount of reward token * @param liquidator The address of the liquidator (liquidation operator) * @param handlerID The handler ID of the reward token for the liquidator * @retur...
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 20906, 21513 ] }
20,308
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
flashloan
function flashloan( uint256 handlerID, address receiverAddress, uint256 amount, bytes calldata params ) external returns (bool) { bytes memory callData = abi.encodeWithSelector( IManagerFlashloan .flashloan.selector, handlerID, receiverAddress, amount, params ); (bool resul...
/** * @dev Execute flashloan contract with delegatecall * @param handlerID The ID of the token handler to borrow. * @param receiverAddress The address of receive callback contract * @param amount The amount of borrow through flashloan * @param params The encode metadata of user * @return Whether or not succ...
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 21868, 22358 ] }
20,309
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getFeeTotal
function getFeeTotal(uint256 handlerID) external returns (uint256) bytes memory callData = abi.encodeWithSelector( IManagerFlashloan .getFeeTotal.selector, handlerID ); (bool result, bytes memory returnData) = flashloanAddr.delegatecall(callData); assert(result); return abi.decode(returnData, (uint...
/** * @dev Call flashloan logic contract with delegatecall * @param handlerID The ID of handler with accumulated flashloan fee * @return The amount of fee accumlated to handler */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 22560, 22914 ] }
20,310
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
withdrawFlashloanFee
function withdrawFlashloanFee( uint256 handlerID ) external onlyOwner returns (bool) { bytes memory callData = abi.encodeWithSelector( IManagerFlashloan .withdrawFlashloanFee.selector, handlerID ); (bool result, bytes memory returnData) = flashloanAddr.delegatecall(callData); assert(...
/** * @dev Withdraw accumulated flashloan fee with delegatecall * @param handlerID The ID of handler with accumulated flashloan fee * @return Whether or not succeed */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 23107, 23497 ] }
20,311
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getFeeFromArguments
function getFeeFromArguments( uint256 handlerID, uint256 amount, uint256 bifiAmount ) external returns (uint256) { bytes memory callData = abi.encodeWithSelector( IManagerFlashloan .getFeeFromArguments.selector, handlerID, amount, bifiAmount ); (bool result, bytes memory returnD...
/** * @dev Get flashloan fee for flashloan amount before make product(BiFi-X) * @param handlerID The ID of handler with accumulated flashloan fee * @param amount The amount of flashloan amount * @param bifiAmount The amount of Bifi amount * @return The amount of fee for flashloan amount */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 23824, 24292 ] }
20,312
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
_getHandlerAmount
function _getHandlerAmount(address payable userAddr, uint256 handlerID) internal view returns (uint256, uint256) { IProxy TokenHandler = IProxy(dataStorageInstance.getTokenHandlerAddr(handlerID)); bytes memory data; (, data) = TokenHandler.handlerViewProxy( abi.encodeWithSelector( IMarketHandler .getU...
/** * @dev Get the deposit and borrow amount of the user for the handler (internal) * @param userAddr The address of user * @param handlerID The handler ID * @return The deposit and borrow amount */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 24506, 24932 ] }
20,313
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
_getHandlerAmountWithAmount
function _getHandlerAmountWithAmount(address payable userAddr, uint256 handlerID) internal view returns (uint256, uint256) { IProxy TokenHandler = IProxy(dataStorageInstance.getTokenHandlerAddr(handlerID)); bytes memory data; (, data) = TokenHandler.handlerViewProxy( abi.encodeWithSelector( IMarketHandler...
/** * @dev Get the deposit and borrow amount with interest of the user for the handler (internal) * @param userAddr The address of user * @param handlerID The handler ID * @return The deposit and borrow amount with interest */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 25176, 25624 ] }
20,314
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
setHandlerSupport
function setHandlerSupport(uint256 handlerID, bool support) onlyOwner public returns (bool result) { bytes memory callData = abi.encodeWithSelector( IManagerSlotSetter .setHandlerSupport.selector, handlerID, support ); (result, ) = slotSetterAddr.delegatecall(callData); assert(result); }
/** * @dev Set the support stauts for the handler * @param handlerID the handler ID * @param support the support status (boolean) * @return result the setter call in contextSetter contract */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 25831, 26155 ] }
20,315
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getOwner
function getOwner() public view returns (address) { return owner; }
/** * @dev Get owner's address of the manager contract * @return The address of owner */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 26255, 26331 ] }
20,316
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
_getUserIntraHandlerAssetWithInterest
function _getUserIntraHandlerAssetWithInterest(address payable userAddr, uint256 handlerID) internal view returns (uint256, uint256) { uint256 price = _getTokenHandlerPrice(handlerID); IProxy TokenHandler = IProxy(dataStorageInstance.getTokenHandlerAddr(handlerID)); uint256 depositAmount; uint256 borrowAmount;...
/** * @dev Get the deposit and borrow amount of the user with interest added * @param userAddr The address of user * @param handlerID The handler ID * @return The deposit and borrow amount of the user with interest */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 26564, 27304 ] }
20,317
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
_getUserTotalIntraCreditAsset
function _getUserTotalIntraCreditAsset(address payable userAddr) internal view returns (uint256, uint256) { uint256 depositTotalCredit; uint256 borrowTotalCredit; for (uint256 handlerID; handlerID < tokenHandlerLength; handlerID++) { if (dataStorageInstance.getTokenHandlerSupport(handlerID)) { uint25...
/** * @dev Get the depositTotalCredit and borrowTotalCredit * @param userAddr The address of the user * @return depositTotalCredit The amount that users can borrow (i.e. deposit * borrowLimit) * @return borrowTotalCredit The sum of borrow amount for all handlers */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 27585, 28473 ] }
20,318
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
_getUserExtraLiquidityAmount
function _getUserExtraLiquidityAmount(address payable userAddr, uint256 handlerID) internal view returns (uint256) { int256 depositCredit; int256 borrowCredit; depositCredit, borrowCredit) = _getUserTotalIntraCreditAsset(userAddr); f (depositCredit == 0) return 0; f (depositCredit > borrowCredit) return ...
/** * @dev Get the amount of token that the user can borrow more * @param userAddr The address of user * @param handlerID The handler ID * @return The amount of token that user can borrow more */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 28684, 29156 ] }
20,319
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
_getTokenHandlerPrice
function _getTokenHandlerPrice(uint256 handlerID) internal view returns (uint256) { return (oracleProxy.getTokenPrice(handlerID)); }
/** * @dev Get the token price for the handler * @param handlerID The handler id * @return The token price of the handler */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 29431, 29572 ] }
20,320
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getRewardErc20
function getRewardErc20() public view returns (address) { return address(rewardErc20Instance); }
/** * @dev Get the address of reward token * @return The address of reward token */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 29667, 29772 ] }
20,321
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
getGlobalRewardInfo
function getGlobalRewardInfo() external view returns (uint256, uint256, uint256) { IManagerDataStorage _dataStorage = dataStorageInstance; return (_dataStorage.getGlobalRewardPerBlock(), _dataStorage.getGlobalRewardDecrement(), _dataStorage.getGlobalRewardTotalAmount()); }
/** * @dev Get the reward parameters * @return (uint256,uint256,uint256) rewardPerBlock, rewardDecrement, rewardTotalAmount */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 29910, 30195 ] }
20,322
TokenManager
contracts/marketManager/TokenManager.sol
0xfef1974aeb87a92e8b8b99b7bc260f116679938f
Solidity
TokenManager
contract TokenManager is ManagerSlot { /** * @dev Constructor for marketManager * @param managerDataStorageAddr The address of the manager storage contract * @param oracleProxyAddr The address of oracle proxy contract (e.g., price feeds) * @param breaker The address of default circuit breaker * @param erc...
/** * @title BiFi's marketManager contract * @notice Implement business logic and manage handlers * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */
NatSpecMultiLine
/** * @dev fallback function where handler can receive native coin */
NatSpecMultiLine
v0.6.12+commit.27d51765
BSD-3-Clause
ipfs://1002b3b4f250d3861b527c1cfa08904bbc13ed9463aebc40677e5f875813adf8
{ "func_code_index": [ 30406, 30446 ] }
20,323
KeeperIncentive
contracts/core/interfaces/IACLRegistry.sol
0xcd4f7582b32d90bd9fc7dc9f8116c43ab17de011
Solidity
IACLRegistry
interface IACLRegistry { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAd...
/** * @dev External interface of AccessControl declared to support ERC165 detection. */
NatSpecMultiLine
hasRole
function hasRole(bytes32 role, address account) external view returns (bool);
/** * @dev Returns `true` if `account` has been granted `role`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
GNU GPLv3
{ "func_code_index": [ 1152, 1231 ] }
20,324
KeeperIncentive
contracts/core/interfaces/IACLRegistry.sol
0xcd4f7582b32d90bd9fc7dc9f8116c43ab17de011
Solidity
IACLRegistry
interface IACLRegistry { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAd...
/** * @dev External interface of AccessControl declared to support ERC165 detection. */
NatSpecMultiLine
hasPermission
function hasPermission(bytes32 permission, address account) external view returns (bool);
/** * @dev Returns `true` if `account` has been granted `permission`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
GNU GPLv3
{ "func_code_index": [ 1314, 1405 ] }
20,325
KeeperIncentive
contracts/core/interfaces/IACLRegistry.sol
0xcd4f7582b32d90bd9fc7dc9f8116c43ab17de011
Solidity
IACLRegistry
interface IACLRegistry { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAd...
/** * @dev External interface of AccessControl declared to support ERC165 detection. */
NatSpecMultiLine
getRoleAdmin
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
GNU GPLv3
{ "func_code_index": [ 1584, 1654 ] }
20,326
KeeperIncentive
contracts/core/interfaces/IACLRegistry.sol
0xcd4f7582b32d90bd9fc7dc9f8116c43ab17de011
Solidity
IACLRegistry
interface IACLRegistry { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAd...
/** * @dev External interface of AccessControl declared to support ERC165 detection. */
NatSpecMultiLine
grantRole
function grantRole(bytes32 role, address account) external;
/** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
GNU GPLv3
{ "func_code_index": [ 1880, 1941 ] }
20,327
KeeperIncentive
contracts/core/interfaces/IACLRegistry.sol
0xcd4f7582b32d90bd9fc7dc9f8116c43ab17de011
Solidity
IACLRegistry
interface IACLRegistry { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAd...
/** * @dev External interface of AccessControl declared to support ERC165 detection. */
NatSpecMultiLine
revokeRole
function revokeRole(bytes32 role, address account) external;
/** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
GNU GPLv3
{ "func_code_index": [ 2153, 2215 ] }
20,328
KeeperIncentive
contracts/core/interfaces/IACLRegistry.sol
0xcd4f7582b32d90bd9fc7dc9f8116c43ab17de011
Solidity
IACLRegistry
interface IACLRegistry { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAd...
/** * @dev External interface of AccessControl declared to support ERC165 detection. */
NatSpecMultiLine
renounceRole
function renounceRole(bytes32 role, address account) external;
/** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been g...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
GNU GPLv3
{ "func_code_index": [ 2674, 2738 ] }
20,329
CBDC
CBDC.sol
0x22e3cdaa7d7d39a0be28af28dfe635dc0f5a2907
Solidity
BasicToken
contract BasicToken is ERC20 { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 ...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; }...
/** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://9c9a4f00a659460cd16d0cb45194ad3147d5a6fe5467569f59466c5885933cd3
{ "func_code_index": [ 277, 630 ] }
20,330
CBDC
CBDC.sol
0x22e3cdaa7d7d39a0be28af28dfe635dc0f5a2907
Solidity
BasicToken
contract BasicToken is ERC20 { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 ...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; }
/** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://9c9a4f00a659460cd16d0cb45194ad3147d5a6fe5467569f59466c5885933cd3
{ "func_code_index": [ 846, 970 ] }
20,331
CBDC
CBDC.sol
0x22e3cdaa7d7d39a0be28af28dfe635dc0f5a2907
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfe...
/** * @title Standard ERC20 token * */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, ...
/** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://9c9a4f00a659460cd16d0cb45194ad3147d5a6fe5467569f59466c5885933cd3
{ "func_code_index": [ 402, 1078 ] }
20,332
CBDC
CBDC.sol
0x22e3cdaa7d7d39a0be28af28dfe635dc0f5a2907
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfe...
/** * @title Standard ERC20 token * */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.co...
/** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://9c9a4f00a659460cd16d0cb45194ad3147d5a6fe5467569f59466c5885933cd3
{ "func_code_index": [ 1323, 1914 ] }
20,333
CBDC
CBDC.sol
0x22e3cdaa7d7d39a0be28af28dfe635dc0f5a2907
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfe...
/** * @title Standard ERC20 token * */
NatSpecMultiLine
allowance
function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://9c9a4f00a659460cd16d0cb45194ad3147d5a6fe5467569f59466c5885933cd3
{ "func_code_index": [ 2247, 2396 ] }
20,334
CBDC
CBDC.sol
0x22e3cdaa7d7d39a0be28af28dfe635dc0f5a2907
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfe...
/** * @title Standard ERC20 token * */
NatSpecMultiLine
increaseApproval
function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */
NatSpecMultiLine
v0.4.24+commit.e67f0147
None
bzzr://9c9a4f00a659460cd16d0cb45194ad3147d5a6fe5467569f59466c5885933cd3
{ "func_code_index": [ 2649, 2920 ] }
20,335
kingsGala
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x89633c73096d2150673c9edc7bb5f24db5dc222c
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex;...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://0f69aed9379b91fa697d2d915e6c5eac547307d7e996320aaecaea8acb0d54fb
{ "func_code_index": [ 605, 834 ] }
20,336
kingsGala
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x89633c73096d2150673c9edc7bb5f24db5dc222c
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex;...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
tokenOfOwnerByIndex
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; }
/** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://0f69aed9379b91fa697d2d915e6c5eac547307d7e996320aaecaea8acb0d54fb
{ "func_code_index": [ 913, 1174 ] }
20,337
kingsGala
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x89633c73096d2150673c9edc7bb5f24db5dc222c
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex;...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
totalSupply
function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; }
/** * @dev See {IERC721Enumerable-totalSupply}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://0f69aed9379b91fa697d2d915e6c5eac547307d7e996320aaecaea8acb0d54fb
{ "func_code_index": [ 1245, 1363 ] }
20,338
kingsGala
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x89633c73096d2150673c9edc7bb5f24db5dc222c
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex;...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
tokenByIndex
function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; }
/** * @dev See {IERC721Enumerable-tokenByIndex}. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://0f69aed9379b91fa697d2d915e6c5eac547307d7e996320aaecaea8acb0d54fb
{ "func_code_index": [ 1435, 1673 ] }
20,339
kingsGala
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x89633c73096d2150673c9edc7bb5f24db5dc222c
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex;...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnume...
/** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://0f69aed9379b91fa697d2d915e6c5eac547307d7e996320aaecaea8acb0d54fb
{ "func_code_index": [ 2281, 2875 ] }
20,340
kingsGala
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x89633c73096d2150673c9edc7bb5f24db5dc222c
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex;...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_addTokenToOwnerEnumeration
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; }
/** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://0f69aed9379b91fa697d2d915e6c5eac547307d7e996320aaecaea8acb0d54fb
{ "func_code_index": [ 3171, 3397 ] }
20,341
kingsGala
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x89633c73096d2150673c9edc7bb5f24db5dc222c
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex;...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_addTokenToAllTokensEnumeration
function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); }
/** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://0f69aed9379b91fa697d2d915e6c5eac547307d7e996320aaecaea8acb0d54fb
{ "func_code_index": [ 3593, 3762 ] }
20,342
kingsGala
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
0x89633c73096d2150673c9edc7bb5f24db5dc222c
Solidity
ERC721Enumerable
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex;...
/** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */
NatSpecMultiLine
_removeTokenFromOwnerEnumeration
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 ...
/** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes)....
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://0f69aed9379b91fa697d2d915e6c5eac547307d7e996320aaecaea8acb0d54fb
{ "func_code_index": [ 4384, 5377 ] }
20,343
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_add
function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; retur...
/** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 908, 1327 ] }
20,344
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_remove
function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element f...
/** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1498, 3047 ] }
20,345
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_contains
function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; }
/** * @dev Returns true if the value is in the set. O(1). */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3128, 3262 ] }
20,346
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_length
function _length(Set storage set) private view returns (uint256) { return set._values.length; }
/** * @dev Returns the number of values on the set. O(1). */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3343, 3457 ] }
20,347
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_at
function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; }
/** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3796, 4005 ] }
20,348
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
add
function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); }
/** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 4254, 4402 ] }
20,349
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
remove
function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); }
/** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 4573, 4727 ] }
20,350
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
contains
function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); }
/** * @dev Returns true if the value is in the set. O(1). */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 4808, 4971 ] }
20,351
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
length
function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); }
/** * @dev Returns the number of values in the set. O(1). */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 5052, 5174 ] }
20,352
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
at
function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); }
/** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 5513, 5667 ] }
20,353
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
add
function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); }
/** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 5912, 6048 ] }
20,354
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
remove
function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); }
/** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 6219, 6361 ] }
20,355
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
contains
function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); }
/** * @dev Returns true if the value is in the set. O(1). */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 6442, 6593 ] }
20,356
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
length
function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); }
/** * @dev Returns the number of values on the set. O(1). */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 6674, 6793 ] }
20,357
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
at
function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); }
/** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 7132, 7274 ] }
20,358
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
isContract
function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codeha...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 606, 1230 ] }
20,359
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
sendValue
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 2160, 2562 ] }
20,360
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3318, 3496 ] }
20,361
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3721, 3922 ] }
20,362
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 4292, 4523 ] }
20,363
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 4774, 5095 ] }
20,364
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
hasRole
function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); }
/** * @dev Returns `true` if `account` has been granted `role`. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1546, 1690 ] }
20,365
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
getRoleMemberCount
function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); }
/** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1859, 1991 ] }
20,366
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
getRoleMember
function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); }
/** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make ...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 2585, 2728 ] }
20,367
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
getRoleAdmin
function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; }
/** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 2912, 3031 ] }
20,368
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
grantRole
function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); }
/** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3288, 3520 ] }
20,369
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
revokeRole
function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); }
/** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3760, 3995 ] }
20,370
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
renounceRole
function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); }
/** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 4497, 4711 ] }
20,371
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
_setupRole
function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); }
/** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor w...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 5289, 5406 ] }
20,372
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
AccessControl
abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant D...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` ...
NatSpecMultiLine
_setRoleAdmin
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; }
/** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 5533, 5737 ] }
20,373
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 94, 154 ] }
20,374
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 237, 310 ] }
20,375
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 534, 616 ] }
20,376
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 895, 983 ] }
20,377
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1647, 1726 ] }
20,378
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 2039, 2141 ] }
20,379
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 259, 445 ] }
20,380
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 723, 864 ] }
20,381
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1162, 1359 ] }
20,382
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1613, 2089 ] }
20,383
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 2560, 2697 ] }
20,384
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3188, 3471 ] }
20,385
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3931, 4066 ] }
20,386
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 4546, 4717 ] }
20,387
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
name
function name() public view returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 902, 990 ] }
20,388
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1104, 1196 ] }
20,389
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1829, 1917 ] }
20,390
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
totalSupply
function totalSupply() public view override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 1977, 2082 ] }
20,391
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 2140, 2264 ] }
20,392
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 2472, 2652 ] }
20,393
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 2710, 2866 ] }
20,394
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3008, 3182 ] }
20,395
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amou...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 3651, 3977 ] }
20,396
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 4381, 4604 ] }
20,397
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 5102, 5376 ] }
20,398
GXC
GXC.sol
0x2e93fe8d550a7b7e7b2e561cd45cebccbaa79358
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sen...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.6.2+commit.bacdbe57
MIT
ipfs://d393da844c50d68abd35a268ce0235dd1f8aeebf68d479eb759fe5973443401a
{ "func_code_index": [ 5861, 6405 ] }
20,399