Hello All,
I am new to Sophia language and have been exploring the environment for sometime now.
I am implementing a Hashed TimeLock Contract in Sophia for which I am facing an issue.
To explain a bit more about the functionality which I am looking forward to build is that, I need to create a structure datatype which I should be able to instantiate with different values and use as required as we do in solidity.
// =========
// Here is my struct from solidity SC implementation
struct TimeLockContract {
address payable sender;
address payable receiver;
bytes32 preimage;
bytes32 hashlock;
uint amount;
uint timelock;
bool withdrawn;
bool refunded;
}
// =================
I need to convert this to Sophia compatible version.
I see that there is ‘record’ datatype in solidity, which I believe holds only single values for the key values pairs mentioned.
The functionality which I am looking forward to is, how to I extend the ‘record’ for multiple instantiations.
I am thinking of list of ‘record’ is one way to move(if such a thing is possible in Sophia). but the limit of required number of instantiations would be dynamic. so this approach might no suffice.
Any information/direction in which I should look forward to achieve my functionality is welcomed