$RULE_ADMIN
private key is equivalent to $RULE_ADMIN_KEY
in the following example.
For example, we can set a rule for the user to only be able to withdraw 1000 USDC from their account once they’ve reached access level 1 using the Withdrawal Limit By Access Level rule. In order to set this up we first will call the function addAccountMaxValueOutByAccessLevel(address,uint48[])
on the protocol address using our ruleAdministrator account with the address in the function signature being the address of the application manager and the array of uints being [0, 10000000, 10000000, 10000000, 10000000].
to
and the blockNumber
fields:
ruleId
is 0 and we can pass that along to our application manager. It should be noted that if you were to run this in a smart contract script, you would just need to take the return value generated from addAccountMaxValueOutByAccessLevel
. Once we have this ruleId, we can add it to our access level using the setAccountMaxValueOutByAccessLevelId(uint32 _ruleId)
function on the application handler.