-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone 11: Write Solidity to Substrate porting guide #978
Comments
in the discord channel, @extraymond gave us already some useful insight about possible topics to consider, especially about
thanks! |
I am extremely keen to know the progress made here. Where is best to keep updated on the porting guide for Solidity to Substrate? Some simple things keep me away from using "Solang + Contracts Pallet on Substrate" when compared with simply using EVM-Compatible Frontier. I am very aware that Solang + Contracts Pallet have much more runtime efficiency benefits however without the guide, it would be extremely difficult:
|
The best place to keep updated is probably this issue, or also the discord chat where you asked as well. So currently there is no progress made here. You can also refer to the roadmap in our README; this will be something for solang 0.4. Note that I am aware that the user experience, compared to the tooling of the ETH world, is lacking as of now. However I can only do one thing at the time, so any contributions to improve the situation are highly welcome.
This depends on the specific case. Solang supports compiling multiple .sol files. If you run into issues, feel free to ask in our discord channel.
You want to use
|
Thanks for your reply, another silly question that I do think helps a lot in understanding: How can I deploy a contract that interfaces with a previously deployed contract (much like in this example: https://cryptozombies.io/en/lesson/2/chapter/11 )? |
Interfaces are supported. Close to the example you linked would be: abstract contract NumberInterface {
function getNum(address _myAddress) virtual public view returns (uint);
}
contract Implementor {
function getNum(address _myAddress) public view returns (uint) {
return uint(_myAddress);
}
}
contract MyContract {
function someFunction(address NumberInterfaceAddress) public view returns(uint){
NumberInterface numberContract = NumberInterface(NumberInterfaceAddress);
return numberContract.getNum(msg.sender);
}
} A bit more idiomatic would be to use an interface NumberInterface {
function getNum(address _myAddress) view external returns (uint);
}
contract Implementor is NumberInterface {
function getNum(address _myAddress) virtual public view returns (uint) {
return uint(_myAddress);
}
}
contract MyContract {
function someFunction(address NumberInterfaceAddress) public view returns(uint) {
NumberInterface numberContract = NumberInterface(NumberInterfaceAddress);
return numberContract.getNum(msg.sender);
}
} |
This milestone is a documentation effort. This should be a guide which explains how to port existing Solidity contracts to Substrate. This should include:
The documentation should be formatted in restructuredtext and added to the solang repository.
Success means that a pull request has had all its review comments addressed and it is merged.
The text was updated successfully, but these errors were encountered: