Sharing temporarily data between stateful and stateless contracts

Trying to use new opcode gload in atomic transaction, accessing stored value in Stateful contract from first txn and trying to load on second txn in Stateless contract: gload 0 0

Teal version 4

goal version -v
Version: [v1 v2] 
GenesisID: sandnet-v1 
Build: 2.7.1.stable [rel/stable]

Got the error:

gload not allowed in current mode

Is sharing data between contracts supported only for Stateful ones?

Stateless smart contracts cannot read scratch pad of stateful smart contracts.
That is because stateless smart contracts are executed immediately when the transaction is received while stateful smart contracts are executed when the block is assembled.
This is for performance reasons.
That is why stateless smart contracts can have a much higher cost.

1 Like