lineradvanced.blogg.se

Midnight protocol vault
Midnight protocol vault




midnight protocol vault

In the previous example, this would mean that once one hour passes, the protected address can once again transfer up to 100 000 tokens. Therefore, even if transactions start failing or the amount transferred is close to the limit, this only lasts until a new period is entered.

midnight protocol vault

However, the limit gets reset every period. Token transfer transactions will start failing if that address transfers out more than 100 000 tokens in an hour. For example, an address has a limit of 100 000 tokens per hour. Setting up single limit protection for an address means that this particular address will be able to transfer not more than a given number of tokens in a set period of time.

  • The address which should have its whitelist removedįunction removeProtectedAddresses(address token, address protectedAddress) external Single Limit.
  • In which token’s scope this whitelist was set.
  • In order to remove the whitelist protection rule from a protected address completely, call the removeProtectedAddresses function on the LosslessGuardian smart contract with these arguments: Setting the flag to true will add the provided list of addresses to the whitelist and setting the flag to false would remove it from the whitelist
  • A flag that specifies if a provided list of addresses has to be removed or added to the whitelist.
  • A list of addresses that need to be removed or added from or to the whitelist.
  • Which address should have its whitelist updated.
  • In which token’s scope you are going to set this whitelist.
  • To call this function you need to specify: function setWhitelistState(address token, address protectedAddress, address calldata addresses, bool state) public onlyProtectionAdmin(token) To remove some addresses from a whitelist or add some new ones, the setWhitelistState function on the TreasuryProtectionStrategy smart contract should be used. You can also see that this function can only be called by the protection admin.
  • Whitelisted addresses (wallets that will be able to receive tokens from the protected address).
  • Which address should have this whitelist applied to it (the protected address).
  • In which token’s scope this whitelist is going to be set.
  • To call this function one needs to specify: function setProtectedAddress(address token, address protectedAddress, address calldata whitelist) external onlyProtectionAdmin(token) The whitelist can be set using the setProtectedAddress function on the TreasuryProtectionStrategy contract. The diagram below summarises steps that need to be executed for Vault Protection to be enabled.Īddress that has a whitelist will be able to transfer tokens only to an address that’s in that whitelist. The address of LosslessGuardian smart contract and all the other contracts mentioned in this article can be found here:

    midnight protocol vault

    All our smart contracts can be found at function setProtectionAdmin(address token, address admin) external onlyVerifiedToken(token) The protection admin for a token can be set by using setProtectionAdmin function on LosslessGuardian smart contract. You can read more about the token admin role on lossless protected tokens here: The Protection admin can only be set by the token admin. The sole responsibility of the Protection admin is to control protection rules. Once a token is verified, its project team has to set a protection admin. This permission is required to stop projects from abusing Vault Protection functionality and also to perform a gradual rollout of this feature to all of the lossless protected tokens. At the moment there are two types of rules that can be used:īefore any of these rules can be turned on for a particular address in a particular token’s scope, the address and the token have to be verified by the lossless team. It can be used by token admins and allows setting up token scoped rules for token transfers execution. Vault Protection can only be used for tokens that have integrated with lossless protection smart contracts, see also. Lossless Vault Protection is a smart contracts system that allows setting up specific protection rules for an address.

    #Midnight protocol vault how to

    In this article, we review Lossless Vault Protection smart contracts, discuss how to use the system directly, and comment on some gas saving implementation details of our system.






    Midnight protocol vault