This project was built using Algokit!
To learn more about algokit, visit documentation.
I followed the tutorial you can find here: AlgoKit Quick Start Guide, and then made some modifications to the hello_world starter code. Firstly I created a BoxMap to the storage space of the contract. Then I modified the hello method to take in an additional parameter alongside the message. hello() then stores the message under a key with the name of that additional parameter. Lastly, I created a new method that allows anyone to retrieve any message stored in the BoxMap as long as they know the Base64 encoded key name.
Lora was a great tool for interacting with a local blockchain instance while I prepared the contract. and once it was ready I was easily able to switch over to the Algorand Testnet and deploy the contract there.
Link to the Contract Deployment transaction
Link to the first successful hello() call
It's worth mentioning that in order to store and retrieve data from the BoxMap it was necessary to pass in a reference to its storage location. Lora allowed me to do that by opening up the Edit Resources modal.
Through the modal, I was able to pass in the App ID and the Base64 encoded key name required to identify the storage location.
Currently, anyone can call the hello method to store any number of messages without paying for the data to be stored. As a workaround I manually funded the contract address to support this storage cost, but as a next step it would be interesting to calculate this cost beforehand and have the method caller also send the ALGO required to secure the storage to the contract.