跳到主要内容

JBToken

An ERC-20 token that can be used by a project in the JBTokenStore.

Code

https://github.com/jbx-protocol/juice-contracts-v3/blob/main/contracts/JBToken.sol

Interfaces

NameDescription
IJBTokenAllows this contract to be used by projects in the JBTokenStore.

Inheritance

ContractDescription
ERC20VotesGeneral token standard for fungible membership with snapshot capabilities sufficient to interact with standard governance contracts.
OwnableIncludes convenience functionality for specifying an address that owns the contract, with modifiers that only allow access by the owner.

Constructor

/**
@param _name The name of the token.
@param _symbol The symbol that the token should be represented by.
@param _projectId The ID of the project that this token should be exclusively used for. Send 0 to support any project.
*/
constructor(
string memory _name,
string memory _symbol,
uint256 _projectId
)
ERC20(_name, _symbol)
ERC20Permit(_name)
{
projectId = _projectId;
}
  • _name is the name of the token.
  • _symbol is the symbol that the token should be represented by.
  • _projectId is the ID of the project that this token should be exclusively used for. Send 0 to support any project.

Properties

FunctionDefinition
projectId

Returns

  • uint256

Read

FunctionDefinition
decimals

Returns

  • uint256 totalSupply
totalSupply

Params

  • uint256 _projectId

Returns

  • uint256 totalSupply
balanceOf

Params

  • uint256 _projectId
  • address _account

Returns

  • uint256 balanceOf

Write

FunctionDefinition
mint

Traits

Params

  • uint256 _projectId
  • address _account
  • uint256 _amount
burn

Traits

Params

  • uint256 _projectId
  • address _account
  • uint256 _amount
approve

Params

  • uint256 _projectId
  • address _spender
  • uint256 _amount
transfer

Params

  • uint256 _projectId
  • address _to
  • uint256 _amount
transferFrom

Params

  • uint256 _projectId
  • address _from
  • address _to
  • uint256 _amount