You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guard logic needs to be able to access and modify a machine-specific storage slot. And that storage slot needs to be initializable at the time the machine is installed.
For instance, in the LockableDoor example, the exit guard for the "Locked" state needs to be able to check if the user has a non-zero balance of an ERC20 "key token". If they do, the transition will be allowed to proceed. Otherwise, the guard reverts with a message about the user needing the key.
In order to make this happen, we need to know the address of the "key token" contract, and we can't hard code it since, the tokens are deployed at the same time as the example. So when the LockableDoor machine is installed in Fismo, we need to be able to make a delegatecall to an initializer contract, passing the address of the token contract.
Later when the guard is invoked, it should be able to fetch the "key token" contract's address from the LockableDoor machine's custom storage slot and call balanceOf on it with the user's address.
The text was updated successfully, but these errors were encountered:
Guard logic needs to be able to access and modify a machine-specific storage slot. And that storage slot needs to be initializable at the time the machine is installed.
For instance, in the LockableDoor example, the exit guard for the "Locked" state needs to be able to check if the user has a non-zero balance of an ERC20 "key token". If they do, the transition will be allowed to proceed. Otherwise, the guard reverts with a message about the user needing the key.
In order to make this happen, we need to know the address of the "key token" contract, and we can't hard code it since, the tokens are deployed at the same time as the example. So when the LockableDoor machine is installed in Fismo, we need to be able to make a delegatecall to an initializer contract, passing the address of the token contract.
Later when the guard is invoked, it should be able to fetch the "key token" contract's address from the LockableDoor machine's custom storage slot and call
balanceOf
on it with the user's address.The text was updated successfully, but these errors were encountered: