You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 14, 2021. It is now read-only.
I'm currently trying to port some Solidity code into wasm using pwasm. But I have a problem that I don't see enough examples or documentation to perform such a transform. For example, here is a simple Solidity contract:
contractExample {
string[] values;
function addValue(stringvalue) public onlyOwner {
values.push(value);
}
function getValue(uinti) publicreturns(string) {
return values[i];
}
modifier onlyOwner {
require(msg.sender== owner);
_;
}
}
it's very simple but it shows all properties that real contracts have: it has onlyOwner modifier, it works with dynamically-sized data and it push values into internal storage (which is not prealocated). Token examples are too simple and don't show how to perform such operations that are crucial for most contracts.
I'm playing with these storage_keys!/pwasm_ethereum::write and so on, but it doesn't look I'm even approaching the solution. Currently It's actually a blocker to me, without stretching storage I cannot migrate my code to wasm.
I'd appreciate any help because I'm currently stuck with that - I only see how I can write into preallocated fixed size storage, but I don't see how to dynamically increase it.
I'm currently trying to port some Solidity code into wasm using
pwasm. But I have a problem that I don't see enough examples or documentation to perform such a transform. For example, here is a simple Solidity contract:it's very simple but it shows all properties that real contracts have: it has
onlyOwnermodifier, it works with dynamically-sized data and it push values into internal storage (which is not prealocated). Token examples are too simple and don't show how to perform such operations that are crucial for most contracts.I'm playing with these
storage_keys!/pwasm_ethereum::writeand so on, but it doesn't look I'm even approaching the solution. Currently It's actually a blocker to me, without stretching storage I cannot migrate my code to wasm.I'd appreciate any help because I'm currently stuck with that - I only see how I can write into preallocated fixed size storage, but I don't see how to dynamically increase it.