Charged Particles Contract

Charged Particles Contract. The primary contract for interfacing with the Charged Particles protocol.

Get Contract Info

Get Info about the Contract, its Settings, and its State.

getStateAddress

function getStateAddress() 
    external 
    view 
    virtual 
    override 
    returns (address stateAddress);

Gets the address of the Charged-State contract, which can be used for setting and retrieving additional information about a Particle (NFT) contract. E.g. time locks on particle mass (principal) or charge (interest).

getSettingsAddress

function getSettingsAddress() 
    external
    view
    virtual
    override 
    returns (address settingsAddress);

Gets the address of the ChargedSettings contract, which can be used for setting and retrieving the settings of the ChargedParticles contract. E.g. Creator annuity.

When Custom Contracts are registered, only the "owner" or operator of the Contract is allowed to register them and define custom rules for how their tokens are "Charged". Otherwise, any token can be "Charged" according to the default rules of Charged Particles.

onERC721Received

Part of the ERC721 standard. Required for any contract that receives ERC-721 tokens. See Open Zeppelin for more detail.

function onERC721Received(
  address, 
  address,
  uint256, 
  bytes calldata
) external virtual override returns (bytes4);

Get Particle balances

Get Particle Mass (principal) and Charge (interest) balances.

baseParticleMass

Gets the amount of Mass (principal) for a Particle for a single asset token. E.g. Returns the amount of USDC deposited into a Particle less earned interest.

function baseParticleMass(
  address contractAddress, 
  uint256 tokenId, 
  string walletManagerId,
  address assetToken
) external virtual override managerEnabled(walletManagerId) returns (uint256);

currentParticleCharge

Gets the amount of Interest that the Particle has generated representing the Charge (interest) of the Particle.

function currentParticleCharge(
  address contractAddress,
  uint256 tokenId,
  string walletManagerId, 
  address assetToken
) external virtual override managerEnabled(walletManagerId) (uint256);

currentParticleKinetics

Gets the amount of LP Tokens that the Particle has generated representing the Kinetics of the Particle.

Kinetics represent additional tokens that a lending protocol provides users in addition to the interest-bearing asset. For example, when a user deposits into Compound, they receive a cToken representing their interest-bearing position, as well as COMP tokens. COMP tokens are the Kinetics in this example.

function currentParticleKinetics(
  address contractAddress,
  uint256 tokenId,
  string walletManagerId,
  address assetToken
) external virtual override managerEnabled(walletManagerId) (uint256);

currentParticleCovalentBonds

Gets the total amount of ERC721 Tokens that the Particle holds.

function currentParticleCovalentBonds(
  address contractAddress,
  uint256 tokenId,
  string basketManagerId
) external view virtual override basketEnabled(basketManagerId) returns (uint256);

Charge & Discharge Particles

Deposit Principal and Withdraw Interest from Particles.

energizeParticle

Fund Particle with Asset Token. Must be called by the account providing the Asset. Account must Approve Charged Particles contract as Operator of Asset.

function energizeParticle(
  address contractAddress,
  uint256 tokenId,
  string walletManagerId,
  address assetToken,
  uint256 assetAmount,
  address referrer
) external virtual override managerEnabled(walletManagerId nonReentrant returns (uint256 yieldTokensAmount);

dischargeParticle

Allows the owner or operator of the Particle to collect or transfer the Charge (interest) generated from the token without removing the Mass (principal) of the underlying asset held within the token.

function dischargeParticle(
  address receiver,
  address contractAddress,
  uint256 tokenId,
  string walletManagerId,
  address assetToken
) external virtual override managerEnabled(walletManagerId) nonReentrant returns (uint256 creatorAmount, uint256 receiverAmount);`

dischargeParticleAmount

Allows the owner or operator of the Particle to collect or transfer a specific amount of the interest generated from the token without removing the Mass (principal) of the underlying asset held within the token.

function dischargeParticleAmount(
  address receiver,
  address contractAddress,
  uint256 tokenId,
  string calldata walletManagerId,
  address assetToken,
  uint256 assetAmount
) external virtual override managerEnabled(walletManagerId) nonReentrant returns (uint256 creatorAmount, uint256 receiverAmount);

dischargeParticleForCreator

Allows the Creator of the Particle to collect or transfer a their portion of the Charge (interest) generated from the token without removing the underlying Mass (principal) held within the token.

function dischargeParticleForCreator(
  address receiver,
  address contractAddress,
  uint256 tokenId,
  string walletManagerId,
  address assetToken,
  uint256 assetAmount
)  external virtual override managerEnabled(walletMangerId) nonReentrant returns (uint256 receiverAmount);

Release Particles

Withdraw principal from particles.

releaseParticle

Releases the Full amount of Mass + Charge (principal + interest) held within the Particle by LP of the Assets.

function releaseParticle(
  address receiver,
  address contractAddress,
  uint256 tokenId,
  string walletManagerId,
  address assetToken
) external virtual override managerEnabled(walletMangerId) nonReentrant returns (uint256 creatorAmount, uint256 receiverAmount)

releaseParticleAmount

Releases a partial amount of Mass + Charge (principal + interest) held within the Particle by LP of the Assets.

function releaseParticleAmount(
  address receiver,
  address contractAddress,
  uint256 tokenId,
  string walletManagerId,
  address assetToken,
  uint256 assetAmount
) external virtual override managerEnabled(walletMangerId) nonReentrant returns (uint256 creatorAmount, uint256 receiverAmount)

Covalent Bonding

Deposit & Withdraw ERC721s from a Particle.

covalentBond

Deposit other NFT Assets into a Particle. Must be called by the account providing the Asset. Account must Approve THIS contract as Operator of Asset.

function covalentBond(
  address contractAddress,
  uint256 tokenId,
  string basketManagerId,
  address nftTokenAddress,
  uint256 nftTokenId
) external virtual override basketEnabled(basketManagerId) nonReentrant returns (bool success)

breakCovalentBond

Release NFT Assets from the Particle.

function breakCovalentBond(
  address receiver,
  address contractAddress,
  uint256 tokenId,
  string calldata basketManagerId,
  address nftTokenAddress,
  uint256 nftTokenId
) external virtual override basketEnabled(basketManagerId) nonReentrant returns (bool success)

Other

Events

UniverseSet

event UniverseSet(address indexed universeAddress);

ChargedStateSet

event ChargedStateSet(address indexed chargedState);

ChargedSettingsSet

event ChargedSettingsSet(address indexed chargedSettings);

LeptonTokenSet

event LeptonTokenSet(address indexed leptonToken);

Wallet / Basket Manager IDs:

Last updated