

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.

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.

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.
