
Database · Acts onchain
Writes a value into a keyed map in the socket's persistent storage. The map and key are both bytes32, so any value can serve as the key. Scope chooses socket storage, shared across every plug the socket runs, or plug storage, private to this plug bundle. Writing zero deletes the entry. Reach for it to record per-token or per-user state across executions, such as the amount deployed into each market or the last run for each recipient, so later runs read it back and act on it.
Set Rebalance Token


1·Take
Take opens the plug by declaring a caller-supplied parameter named token, whose value is furnished at execution time.
2·Take
A second parameter named weight is declared here, also filled in by the caller when the plug runs.
3·Take
Declaring one more caller-supplied parameter named index rounds out the inputs, its value provided at run time.
4·Set map value
Writing into the tokens map in the socket's persistent storage, this step uses the index in slot 2.0 as the key and sets that entry to the token from slot 0.0.
5·Set map value
Using the same index from slot 2.0 as the key, it writes into the weights map in socket storage and stores the weight from slot 1.0 there.