gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
875 stars 355 forks source link

trigger contract in onchain #1734

Open r3v4s opened 6 months ago

r3v4s commented 6 months ago

Description

Just like https://github.com/gnolang/gno/pull/1275, this register pattern allows us to call several grc20 tokens without manually importing it. HOWEVER, it requires that token(or token's function) must be registered to registry contract which (AFAIK) can only be done by making new transaction call manually.

One way to resolve this limit is, re use architecture from faucet during certain process like below

  1. use tx indexer to monitor chain activity
  2. (if /vm.m_addpkg is success) check whether deployed contract is grc20 or not
  3. (if it is grc20) proceed (make tx -> sign tx -> broadcast tx) using similar system from faucet

As you can see, it requires bit of 3rd party resources and honestly it would better if we can handle this on-chain.

If we can trigger other contract without jumping in from outside, we can do some automation I think. WDYT ??

cc @zivkovicmilos @moul @dongwon8247 @notJoon @mconcat

dongwon8247 commented 5 months ago

Related with https://github.com/gnoswap-labs/grc20-register