rchain / rchip-proposals

Where RChain improvement proposals can be submitted
Apache License 2.0
8 stars 5 forks source link

how to make a contract that executes on receipt of REV? #31

Open dckc opened 3 years ago

dckc commented 3 years ago

As far as I can tell, the current RevVault contract makes this impossible.

I hope to evolve this into a proposal to make it possible, as discussed last night with @leithaus .

It would be more straightforward if we could withdraw and deposit purses from rholang as well as do signed transfers

tgrospic commented 3 years ago

@fabcotech can you provide your example of purse transfer which can enable execution of actions when REV transfer occurs. I'm not sure if I missing something here but this should be possible. FYI @dckc

dckc commented 3 years ago

I'm very interested to see how this works.

In particular, it would make it possible to tally the dust votes using a smart contract, without all the trouble of scraping / indexing all the transactions in an off-chain database.

cc @jimscarver @zsluedem

dckc commented 3 years ago

While sketching a CrowdFund contract, I think I figured it out: a fromUnforgeable vault along with the unforgeable name that it came from work like an ERTP purse / payment.

sketch: https://github.com/rchain-community/liquid-democracy/pull/19 791ffe6

dckc commented 3 years ago

I think I got it working ... https://github.com/rchain-community/liquid-democracy/pull/37 and deployed to testnet: rho:id:1xm16jeazfxpyyd7a4834st854nsjgg8izdzbuagc7cigcd3xu3nqz

dckc commented 3 years ago

RevIssuer fixed so that it actually works is deployed to testnet at rho:id:961h8n36ikxz4yxxfye898wh7or3d37fbp1yddmsei1rw64hcyzjmf

ref https://github.com/rchain-community/liquid-democracy/pull/19