e.allow
function.
This will grant the address permanent access to seeing, publicly decrypting and computing over the ciphertext.
Since handles are immutable, sharing access to a variable to an account only grants access to the current value of the variable.
Whenever the variable is updated, the handle changes and the access to the new handle must be granted again.
For example, ou can share your current balance with an address, but if you update your balance, the address will not be able to see the new value.
e.allowThis(value)
is an alias for e.allow(value, address(this))
.
A common mistake is to forget to call allowThis
on a variable after updating it.
This will result in the contract being unable to compute over the variable in future transactions.
Always call
e.allowThis
after updating a variable, if this variable will be used in your contract again.Transient Allowance
e.transientAllow
is not yet available in the SDK, but coming very soon.e.add
are transiently allowed to be decrypted by the contract who called the operation.
That is why contracts can perform back to back operations using results of previous operations.
But since this allowance is transient, calling e.allowThis
is necessary to allow the contract to compute over the result in future transactions.