Replies - Activity - gidon - Algorand

April Targeted DeFi Rewards Distribution Update - Algofi

To confirm, is this increasing the DeFi Rewards pool for the past governance period (as opposed to the current governance period)?

Indexer Fetcher Implementation

I see, thanks for the explanation. What is the purpose of the sleeping for 5 seconds on line 194? Is it a timeout to see if the indexer recovers from an error from failing to fetch the next block?

API to disassemble TEAL program

@fabrice What would be the minimum code needed to do this? This is what I have at the moment and I am getting the following error:

message: "failed to decode object: msgpack decode error [pos 1]: only encoded map or array can be decoded into a struct"
My code is as follows:

const app = await Algo…

In the issue it talks about bytecode. However I thought v2/applications/{application-id} returns base64 encoded. Anyway I tried using the dryrun hack and it doesn’t seem to work.

Prevent Opt In Transactions from Draining Contract Account Algos

The lease window is max 1000 rounds so I cannot just set it to a round say 50 years from now. I presume the solution is to also require the asset opt-in to be before the last valid round. Is there an alternative to this?

Thanks @cusma for the example. I think leases would be better though as it guarantees that you will only ever opt in once. Although practically it is probably the same unless someone can predict a stateless contract in advance and manage to submit many transactions in the small time frame.

Thanks @fabrice, I didn’t know about leases. Just to confirm my understanding:

Would I hardcode a lease value into the smart contract which I would verify is used when opting into an asset?
Would I set the last valid round to max value such that it can never be exploited?
How do you choose the lea…

Bond Implementation

Is there somewhere I can read more about the model the node is using in order to distribute rewards?

Thank you for your suggestions.
I don’t quite understand the second solution. My understanding is that you are referring to a ‘Contract Account - Stateless Smart Contract’. Would every bond have its own Contract Account and how would you store any parameters in a stateless contract? Also how would …