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.
1
function isContractOwner(
2
address contractAddress,
3
address account
4
) external view override virtual returns (bool);
Copied!
Parameter / Return Value
Description
contractAddress
address of external NFT contract to configure
account
if set, will only allow deposits from allowed asset tokens
return
true if the account is the Owner of the contract

isWalletManagerEnabled

Returns true or false depending on whether or not wallet manager is enabled.
1
function isWalletManagerEnabled(
2
string calldata walletManagerId
3
) external virtual override view returns (bool);
Copied!
Parameter / Return Value
Description
walletManagerId
id of wallet manager to check
return
True if enabled

getWalletManager

Gets interface for wallet manager contract.
1
getWalletManager(
2
string calldata walletManagerId
3
) external virtual override view returns (contract IWalletManager);
Copied!
Parameter / Return Value
Description
walletManagerId
id of wallet manager to check
IWalletManager
interface of wallet manager contract

isNftBasketEnabled

Returns true or false depending on whether or not basket manager is enabled.
1
function isNftBasketEnabled(
2
string calldata basketId
3
) external virtual override view returns (bool);
Copied!
Parameter / Return Value
Description
basketManagerId
id of basket manager to check
return
True if enabled

getBasketManager

Gets the interface of the Basket Manager.
1
getBasketManager(
2
string calldata basketId
3
) external virtual override view returns (contract IWalletManager);
Copied!
Parameter / Return Value
Description
basketManagerId
id of basket manager to check
IBasketManager
interface of basket manager contract

getCreatorAnnuities

Gets the amount of creator annuities reserved for the creator for the specified NFT.
1
getCreatorAnnuities(
2
address contractAddress,
3
uint256 tokenId
4
) external view override virutal returns (address creator, uint256 annuityPct);
Copied!
Parameter / Return Value
Description
contractAddress
The Address to the Contract of the NFT
tokenId
The tokenId of the NFT
creator
The creator's address
annuityPct
The percentage of annuities reserved for the creator

getCreatorAnnuitiesRedirect

Gets address that creator annuties are being redirected to.
1
function getCreatorAnnuitiesRedirect(
2
address contractAddress,
3
uint256 tokenId
4
) external view override virtual returns (address address);
Copied!
Parameter / Return Value
Description
contractAddress
The Address to the Contract of the NFT
tokenId
The tokenId of the NFT
address
address of account where annuities are being redirected

getTempLockExpiryBlocks

Gets the temporary time lock expiry blocks.
1
function getTempLockExpiryBlocks() external view override virtual returns (uint256);
Copied!
Parameter / Return Value
Description
return
expiry blocks

getTimelockApprovals

Gets the approvals for time locks.
1
function getTimelockApprovals(
2
address operator
3
) external view override virutal returns (bool timelockAny, bool timelockOwn);
Copied!
Parameter / Return Value
Parameter / Return Value
Description
operator
operator of Particle
timelockAny
whether or not operator can time lock any NFT on behalf of user
timelockOwn
whether or not operator can time lock their own NFTS

getAssetRequirements

Get requirements for an asset token. Aave, Compound, etc. have requirements for tokens. This function returns the requirements for those tokens.
1
function getAssetRequirements(
2
address contractAddress,
3
address assetToken
4
) external view override virtual
5
returns (
6
string memory requiredWalletManager,
7
bool energizeEnabled,
8
bool restrictedAssets,
9
bool validAsset,
10
uint256 depositCap,
11
uint256 depositMin,
12
uint256 depositMax
13
);
Copied!
Parameter / Return Value
Description
contractAddress
address of contract
assetToken
address of asset token to get requirements for
requiredWalletManager
wallet manager required for asset token
energizeEnabled
whether or not energizing is enabled for asset token
restrictedAssets
whether or not asset token is a restricted asset
validAsset
whether or not asset token is a valid asset
depositCap
cap on deposit amount for asset token
depositMin
minimum deposit amount for asset token
depositMax
maximum deposit amount for asset token

getNftAssetRequirements

Get requirements relating to if / how many NFTs can be deposited into a particle.
1
function getNftAssetRequirements(
2
address contractAddress,
3
address nftTokenAddress
4
) external view override virtual
5
returns (
6
string requiredBasketManager,
7
bool basketEnabled,
8
uint256 maxNfts
9
);
Copied!
Parameter / Return Value
Description
contractAddress
address of Particle contract
nftTokenAddress
address of NFT token
requiredBasketManager
basket manager
basketEnabled
whether or not depositing NFTs into Particles is enabled
maxNfts
maxNfts that can be desposited into a Particle

Register (Set) Contract Settings

Used for external contract integration

setCreatorAnnuities

Sets the Custom Configuration for Creators of Proton-based NFTs.
1
function setCreatorAnnuities(
2
address contractAddress,
3
uint256 tokenId,
4
address creator,
5
uint256 annuityPercent
6
) external virtual override;
Copied!
Parameter / Return Value
Description
contractAddress
address of Particle contract
tokenId
id of Particle
creator
address of creator
annuityPercent
percentage of Particle's charge (interest) creator will receive

setCreatorAnnuitiesRedirect

Sets a Custom Receiver Address for the Creator Annuities.
1
setCreatorAnnuitiesRedirect(
2
address contractAddress,
3
uint256 tokenId,
4
address creator,
5
address receiver
6
) external virtual override;
Copied!
Parameter / Return Value
Description
contractAddress
address of Particle contract
tokenId
id of Particle
creator
address of creator
receiver
address that annuities will be redirected to

setRequiredWalletManager

Sets a Required Wallet-Manager for External NFT Contracts (otherwise set to "none" to allow any Wallet-Manager).
1
function setRequiredWalletManager(
2
address contractAddress,
3
string walletManager
4
) external
5
virtual
6
override
7
onlyValidExternalContract(contractAddress)
8
onlyContractOwnerOrAdmin(contractAddress, msg.sender);
Copied!
Parameter / Return Value
Description
contractAddress
address of external NFT contract to configure
walletManager
if set, will only allow deposits from this specific wallet-manager

setRequiredBasketManager

Sets a Required Basket-Manager for External NFT Contracts (otherwise set to "none" to allow any Basket-Manager).
1
function setRequiredBasketManager(
2
address contractAddress,
3
string calldata basketManager
4
) external
5
virtual
6
override
7
onlyValidExternalContract(contractAddress)
8
onlyContractOwnerOrAdmin(contractAddress, msg.sender);
Copied!
Parameter / Return Value
Description
contractAddress
address of external NFT contract to configure
basketManager
if set, will only allow deposits from this specific wallet-manager

setAssetTokenRestrictions

Enables or Disables Asset-Token Restrictions for External NFT Contracts.
1
function setAssetTokenRestrictions(
2
address contractAddress,
3
bool restrictionsEnabled
4
) external
5
virtual
6
override
7
onlyValidExternalContract(contractAddress)
8
onlyContractOwnerOrAdmin(contractAddress, msg.sender);
Copied!
Parameter / Return Value
Description
contractAddress
address of external NFT contract to configure
restrictionsEnabled
if set, will only allow deposits from allowed asset tokens

setAllowedAssetToken

Enables or Disables Allowed Asset Tokens for External NFT Contracts.
1
function setAllowedAssetToken(
2
address contractAddress,
3
address assetToken,
4
bool isAllowed
5
)
6
external
7
virtual
8
override
9
onlyValidExternalContract(contractAddress)
10
onlyContractOwnerOrAdmin(contractAddress, msg.sender);
Copied!
Parameter / Return Value
Description
contractAddress
address of external NFT contract to configure
walletManager
if set, will only allow deposits from allowed asset tokens

setAssetTokenLimits

Sets the Custom Configuration for External Contracts.
1
function setAssetTokenLimits(
2
address contractAddress,
3
address assetToken,
4
uint256 depositMin,
5
uint256 depositMax
6
) external
7
virtual
8
override
9
onlyValidExternalContract(contractAddress)
10
onlyContractOwnerOrAdmin(contractAddress, msg.sender);
Copied!
Parameter / Return Value
Description
contractAddress
address of external NFT contract to configure
assetToken
address of asset token to set limits for (e.g. DAI)
depositMin
if set, will define the minimum amount of Asset tokens the NFT may hold, otherwise any amount
depositMax
if set, will define the maximum amount of Asset tokens the NFT may hold, otherwise any amount

setMaxNfts

Sets the Max Number of NFTs that can be held by a Charged Particle NFT.
1
function setMaxNfts(
2
address contractAddress,
3
address nftTokenAddress,
4
uint256 maxNfts
5
) external
6
virtual
7
override
8
onlyValidExternalContract(contractAddress)
9
onlyContractOwnerOrAdmin(contractAddress, msg.sender);
Copied!
Parameter / Return Value
Description
contractAddress
address of external NFT contract to configure
nftTokenAddress
address of the NFT token to set a maximum for
maxNfts
maximum number of NFTs a Particle can hold

Other

Events

DepositCapSet
1
event DepositCapSet(address assetToken, uint256 depositCap);
Copied!
TempLockExpirySet
1
event TempLockExpirySet(uint256 expiryBlocks);
Copied!
WalletManagerRegistered
1
event WalletManagerRegistered(
2
string indexed walletManagerId,
3
address indexed walletManager
4
);
Copied!
BasketManagerRegistered
1
event BasketManagerRegistered(
2
string indexed basketId,
3
address indexed basketManager
4
);
Copied!
RequiredWalletManagerSet
1
event RequiredWalletManagerSet(
2
address indexed contractAddress,
3
string walletManager
4
);
Copied!
RequiredBasketManagerSet
1
event RequiredBasketManagerSet(
2
address indexed contractAddress,
3
string basketManager
4
);
Copied!
AssetTokenRestrictionsSet
1
event AssetTokenRestrictionsSet(
2
address indexed contractAddress,
3
bool restrictionsEnabled
4
);
Copied!
AllowedAssetTokenSet
1
event AllowedAssetTokenSet(
2
address indexed contractAddress,
3
address assetToken, bool isAllowed
4
);
Copied!
AssetTokenLimitsSet
1
event AssetTokenLimitsSet(
2
address indexed contractAddress,
3
address assetToken,
4
uint256 assetDepositMin,
5
uint256 assetDepositMax
6
);
Copied!
MaxNftsSet
1
event MaxNftsSet(
2
address indexed contractAddress,
3
address indexed nftTokenAddress,
4
uint256 maxNfts
5
);
Copied!
TokenCreatorConfigsSet
1
event TokenCreatorConfigsSet(
2
address indexed contractAddress,
3
uint256 indexed tokenId,
4
address indexed creatorAddress,
5
uint256 annuityPercent
6
);
Copied!
TokenCreatorAnnuitiesRedirected
1
event TokenCreatorAnnuitiesRedirected(
2
address indexed contractAddress,
3
uint256 indexed tokenId,
4
address indexed redirectAddress
5
);
Copied!
PermsForSetCharge
1
event PermsSetForCharge(address indexed contractAddress, bool state);
Copied!
PermsSetForBasket
1
event PermsSetForBasket(address indexed contractAddress, bool state);
Copied!
PermsSetForTimelockAny
1
event PermsSetForTimelockAny(address indexed contractAddress, bool state);
Copied!
PermsSetForTimelockSelf
1
event PermsSetForTimelockSelf(address indexed contractAddress, bool state);
Copied!