Charged Settings Contract

Charged Particles Settings Contract. Used to view and update rules for how the Charged Particles contract functions.

Get Contract Settings

Get a Contract's settings, such as its Owner, and which features are enabled, etc.

isContractOwner

Checks if an Account is the Owner of an NFT Contract. 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.

function isContractOwner(
  address contractAddress,
  address account
) external view override virtual returns (bool);

isWalletManagerEnabled

Returns true or false depending on whether or not wallet manager is enabled.

function isWalletManagerEnabled(
  string calldata walletManagerId
) external virtual override view returns (bool);

getWalletManager

Gets interface for wallet manager contract.

getWalletManager(
  string calldata walletManagerId
) external virtual override view returns (contract IWalletManager);

isNftBasketEnabled

Returns true or false depending on whether or not basket manager is enabled.

function isNftBasketEnabled(
  string calldata basketId
) external virtual override view returns (bool);

getBasketManager

Gets the interface of the Basket Manager.

getBasketManager(
  string calldata basketId
) external virtual override view returns (contract IWalletManager);

getCreatorAnnuities

Gets the amount of creator annuities reserved for the creator for the specified NFT.

getCreatorAnnuities(
  address contractAddress,
  uint256 tokenId
) external view override virutal returns (address creator, uint256 annuityPct);

getCreatorAnnuitiesRedirect

Gets address that creator annuties are being redirected to.

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

getTempLockExpiryBlocks

Gets the temporary time lock expiry blocks.

function getTempLockExpiryBlocks() external view override virtual returns (uint256);

getTimelockApprovals

Gets the approvals for time locks.

function getTimelockApprovals(
 address operator
) external view override virutal returns (bool timelockAny, bool timelockOwn);

Parameter / Return Value

getAssetRequirements

Get requirements for an asset token. Aave, Compound, etc. have requirements for tokens. This function returns the requirements for those tokens.

function getAssetRequirements(
  address contractAddress, 
  address assetToken
) external view override virtual
  returns (
    string memory requiredWalletManager,
    bool energizeEnabled,
    bool restrictedAssets,
    bool validAsset,
    uint256 depositCap,
    uint256 depositMin,
    uint256 depositMax
  );

getNftAssetRequirements

Get requirements relating to if / how many NFTs can be deposited into a particle.

function getNftAssetRequirements(
  address contractAddress,
  address nftTokenAddress
) external view override virtual
  returns (
    string requiredBasketManager,
    bool basketEnabled,
    uint256 maxNfts
  );

Register (Set) Contract Settings

Used for external contract integration

setCreatorAnnuities

Sets the Custom Configuration for Creators of Proton-based NFTs.

function setCreatorAnnuities(
  address contractAddress,
  uint256 tokenId,
  address creator,
  uint256 annuityPercent
) external virtual override;

setCreatorAnnuitiesRedirect

Sets a Custom Receiver Address for the Creator Annuities.

setCreatorAnnuitiesRedirect(
  address contractAddress,
  uint256 tokenId,
  address creator,
  address receiver
) external virtual override;

setRequiredWalletManager

Sets a Required Wallet-Manager for External NFT Contracts (otherwise set to "none" to allow any Wallet-Manager).

function setRequiredWalletManager(
  address contractAddress,
  string walletManager
) external 
  virtual 
  override 
  onlyValidExternalContract(contractAddress) 
  onlyContractOwnerOrAdmin(contractAddress, msg.sender);

setRequiredBasketManager

Sets a Required Basket-Manager for External NFT Contracts (otherwise set to "none" to allow any Basket-Manager).

function setRequiredBasketManager(
  address contractAddress,
  string calldata basketManager
) external 
  virtual 
  override 
  onlyValidExternalContract(contractAddress) 
  onlyContractOwnerOrAdmin(contractAddress, msg.sender);

setAssetTokenRestrictions

Enables or Disables Asset-Token Restrictions for External NFT Contracts.

function setAssetTokenRestrictions(
  address contractAddress,
  bool restrictionsEnabled
) external 
  virtual 
  override 
  onlyValidExternalContract(contractAddress)
  onlyContractOwnerOrAdmin(contractAddress, msg.sender);

setAllowedAssetToken

Enables or Disables Allowed Asset Tokens for External NFT Contracts.

function setAllowedAssetToken(
    address contractAddress,
    address assetToken,
    bool isAllowed
  )
    external
    virtual
    override
    onlyValidExternalContract(contractAddress)
    onlyContractOwnerOrAdmin(contractAddress, msg.sender);

setAssetTokenLimits

Sets the Custom Configuration for External Contracts.

function setAssetTokenLimits(
  address contractAddress,
  address assetToken,
  uint256 depositMin,
  uint256 depositMax
) external
  virtual
  override
  onlyValidExternalContract(contractAddress)
  onlyContractOwnerOrAdmin(contractAddress, msg.sender);

setMaxNfts

Sets the Max Number of NFTs that can be held by a Charged Particle NFT.

function setMaxNfts(
  address contractAddress,
  address nftTokenAddress,
  uint256 maxNfts
) external
  virtual 
  override
  onlyValidExternalContract(contractAddress)
  onlyContractOwnerOrAdmin(contractAddress, msg.sender);

Other

Events

DepositCapSet

event DepositCapSet(address assetToken, uint256 depositCap);

TempLockExpirySet

event TempLockExpirySet(uint256 expiryBlocks);

WalletManagerRegistered

event WalletManagerRegistered(
  string indexed walletManagerId, 
  address indexed walletManager
);

BasketManagerRegistered

event BasketManagerRegistered(
  string indexed basketId, 
  address indexed basketManager
);

RequiredWalletManagerSet

event RequiredWalletManagerSet(
  address indexed contractAddress, 
  string walletManager
);

RequiredBasketManagerSet

event RequiredBasketManagerSet(
  address indexed contractAddress, 
  string basketManager
);

AssetTokenRestrictionsSet

event AssetTokenRestrictionsSet(
  address indexed contractAddress, 
  bool restrictionsEnabled
);

AllowedAssetTokenSet

event AllowedAssetTokenSet(
  address indexed contractAddress, 
  address assetToken, bool isAllowed
);

AssetTokenLimitsSet

event AssetTokenLimitsSet(
  address indexed contractAddress,
  address assetToken,
  uint256 assetDepositMin,
  uint256 assetDepositMax
);

MaxNftsSet

event MaxNftsSet(
  address indexed contractAddress, 
  address indexed nftTokenAddress, 
  uint256 maxNfts
);

TokenCreatorConfigsSet

event TokenCreatorConfigsSet(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed creatorAddress,
  uint256 annuityPercent
);

TokenCreatorAnnuitiesRedirected

event TokenCreatorAnnuitiesRedirected(
  address indexed contractAddress,
  uint256 indexed tokenId,
  address indexed redirectAddress
);

PermsForSetCharge

event PermsSetForCharge(address indexed contractAddress, bool state);

PermsSetForBasket

event PermsSetForBasket(address indexed contractAddress, bool state);

PermsSetForTimelockAny

event PermsSetForTimelockAny(address indexed contractAddress, bool state);

PermsSetForTimelockSelf

event PermsSetForTimelockSelf(address indexed contractAddress, bool state);

Last updated