Charged State Contract

Charged Particles State Contract. For viewing and setting permissions, approvals, and time locks on Particles.

Get State Data

Get info on time locks, approvals, and permissions.

getDischargeTimelockExpiry

Gets unlock block for Discharge time lock.

function getDischargeTimelockExpiry(
  address contractAddress,
  uint256 tokenId
) external view virtual override returns (uint256 lockExpiry);

getReleaseTimelockExpiry

Gets unlock block for Release time lock.

function getReleaseTimelockExpiry(
  address contractAddress,
  uint256 tokenId
) external view virtual override returns (uint256 lockExpiry);

getBreakBondTimelockExpiry

Gets unlock block for restrictions on withdrawing NFTs from a Particle (covalent bonds).

function getBreakBondTimelockExpiry(
  address contractAddress,
  uint256 tokenId
) external view virtual override returns (uint256 lockExpiry);

isApprovedForDischarge

Checks if an operator is allowed to Discharge a specific Particle.

function isApprovedForDischarge(
  address contractAddress,
  uint256 tokenId,
  address operator
) external virtual override view returns (bool);`

isApprovedForRelease

Checks if an operator is allowed to Release a specific Particle.

function isApprovedForRelease(
  address contractAddress,
  uint256 tokenId,
  address operator
) external virtual override view returns (bool);`

isApprovedForBreakBond

Checks if an operator is allowed to Break Covalent Bonds on a specific Particle.

function isApprovedForBreakBond(
  address contractAddress,
  uint256 tokenId,
  address operator
) external virtual override view returns (bool);`

isApprovedForTimelock

Checks if an operator is allowed to Timelock a specific Particle.

function isApprovedForTimelock(
  address contractAddress,
  uint256 tokenId,
  address operator
) external virtual override view returns (bool);`

isEnergizeRestricted

Checks if energizing a specific Particle is restricted.

function isEnergizeRestricted(
  address contractAddress,
  uint256 tokenId
) external virtual override view returns (bool);'

isCovalentBondRestricted

Checks if covalent bonding (depositing NFTs into a Particle) for a specific Particle is restricted.

function isCovalentBondRestricted(
  address contractAddress,
  uint256 tokenId
) external virtual override view returns (bool);

getDischargeState

Gets state of discharge settings / permissions for a Particle.

function getDischargeState(
  address contractAddress, 
  uint256 tokenId,
  address sender
) external view virtual override 
  returns (
    bool allowFromAll, 
    bool isApproved, 
    uint256 timelock, 
    uint256 tempLockExpiry
  );

getReleaseState

Gets state of release settings / permissions for a Particle.

function getDischargeState(
  address contractAddress, 
  uint256 tokenId,
  address sender
) external view virtual override 
  returns (
    bool allowFromAll, 
    bool isApproved, 
    uint256 timelock, 
    uint256 tempLockExpiry
  );

getBreakBondState

Gets state of covalent bond breaking (releasing an NFT) settings / permissions for a Particle.

function getBreakBondState(
  address contractAddress,
  uint256 tokenId,
  address sender
) external view virtual override 
  returns (
    bool allowFromAll, 
    bool isApproved,
    uint256 timelock,
    uint256 tempLockExpiry
  );

Set Permissions + Approvals

Update a Particle's permissions and approvals

setDischargeApproval

Sets an Operator as Approved to Discharge a specific Token. This allows an operator to withdraw the interest-portion only.

function setDischargeApproval(
  address contractAddress,
  uint256 tokenId,
  address operator
) external 
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setReleaseApproval

Sets an Operator as Approved to Release a specific Token. This allows an operator to withdraw the principal + interest.

function setReleaseApproval(
  address contractAddress,
  uint256 tokenId,
  address operator
) external
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setBreakBondApproval

Sets an Operator as Approved to Break Covalent Bonds on a specific Token. This allows an operator to withdraw Basket NFTs.

function setBreakBondApproval(
  address contractAddress,
  uint256 tokenId,
  address operator
) external
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setTimelockApproval

Sets an Operator as Approved to Timelock a specific Token. This allows an operator to timelock the principal or interest.

function setTimelockApproval(
  address contractAddress,
  uint256 tokenId,
  address operator
) external
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setApprovalForAll

Sets an Operator as Approved to Discharge/Release/Timelock a specific Token.

function setApprovalForAll(
  address contractAddress,
  uint256 tokenId,
  address operator
) external
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setPermsForRestrictCharge

Updates Restrictions on Energizing an NFT.

function setPermsForRestrictCharge(
  address contractAddress,
  uint256 tokenId,
  bool state
  ) external
    virtual
    override
    onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setPermsForAllowDischarge

Updates Allowance on Discharging an NFT by Anyone.

function setPermsForAllowDischarge(
  address contractAddress,
  uint256 tokenId,
  bool state
) external
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setPermsForAllowRelease

Updates Allowance on Releasing an NFT by Anyone.

function setPermsForAllowRelease(
  address contractAddress,
  uint256 tokenId,
  bool state
) external
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setPermsForRestrictBond

Updates Restrictions on Covalent Bonds on an NFT.

function setPermsForRestrictBreakBond(
  address contractAddress,
  uint256 tokenId,
  bool state
) external
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

setPermsForAllowBreakBond

Updates Allowance on Breaking Covalent Bonds on an NFT by Anyone.

function setPermsForAllowBreakBond(
  address contractAddress,
  uint256 tokenId,
  bool state
) external
  virtual
  override
  onlyErc721OwnerOrOperator(contractAddress, tokenId, _msgSender());

Set Timelocks

Update time locks for a particles Mass (principal), Charge (interest), or Bonds (locked NFTs)

setDischargeTimelock

Sets a Timelock on the ability to Discharge the Interest of a Particle.

function setDischargeTimelock(
  address contractAddress,
  uint256 tokenId,
  uint256 unlockBlock
) external override virtual;

setReleaseTimelock

Sets a Timelock on the ability to Release the Assets of a Particle.

function setReleaseTimelock(
  address contractAddress,
  uint256 tokenId,
  uint256 unlockBlock
) external override virtual;

setBreakBondTimelock

Sets a Timelock on the ability to Break the Covalent Bond of a Particle.

function setBreakBondTimelock(
  address contractAddress,
  uint256 tokenId,
  uint256 unlockBlock
) external override virtual;

Other

Events

ChargedSettingsSet

event ChargedSettingsSet(address indexed settingsController);

DischargeApproval

event DischargeApproval(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed owner,
  address operator
);

ReleaseApproval

event ReleaseApproval(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed owner,
  address operator
);

BreakBondApproval

event BreakBondApproval(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed owner,
  address operator
);

TimelockApproval

event TimelockApproval(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed owner,
  address operator
);

TokenDischargeTimelock

event TokenDischargeTimelock(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed operator,
  uint256 unlockBlock
);

TokenReleaseTimelock

event TokenReleaseTimelock(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed operator,
  uint256 unlockBlock
);

TokenBreakBondTimelock

event TokenBreakBondTimelock(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed operator, 
  uint256 unlockBlock
);

TokenTempLock

event TokenTempLock(
  address indexed contractAddress,
  uint256 indexed tokenId,
  uint256 unlockBlock
);

PermsSetForRestrictCharge

event PermsSetForRestrictCharge(
  address indexed contractAddress, 
  uint256 indexed tokenId, 
  bool state
);

PermsSetForAllowDischarge

event PermsSetForAllowDischarge(
  address indexed contractAddress, 
  uint256 indexed tokenId, 
  bool state
);

PermsSetForAllowRelease

event PermsSetForAllowRelease(
  address indexed contractAddress, 
  uint256 indexed tokenId, 
  bool state
);

PermsSetForRestrictBond

event PermsSetForRestrictBond(
  address indexed contractAddress, 
  uint256 indexed tokenId, 
  bool state
);

PermsSetForAllowBreakBond

event PermsSetForAllowBreakBond(
  address indexed contractAddress, 
  uint256 indexed tokenId, 
  bool state
);

Last updated