I am trying to figure out how will I go about uploading a contract that is importing two other contracts from different folders in Strato.
Hi Suchit, are you trying to upload this via the bloc api or with the management GUI?
Strato management GUI
I tried adding all contracts in one file but then Strato GUI won’t recognize that file.
Hmmm, I think that should work. Trying it now
It won’t recognize it.
here is the link to the contract that I am trying to compile:
This same contract works when I compile it on Remix using Web3
The issue is that your contracts fail to compile. The two issues I found were
- The events are declared twice. Once in the interface and then again in the DKYToken contract
- The code is using
require, which is defined in solidity 0.4.10 I think. Strato supports solidity 0.4.8.
The best way to check if your contract will compile or not is to use remix, with the compiler version set to solidity 0.4.8. You can find this at https://remix.ethereum.org/#version=soljson-v0.4.8+commit.60cc1668.js
We are working on improving the dashboard, so that it gives you better feedback when you have errors in your contract.
Thanks for clarifying the versioning part. When I uploaded this contract https://github.com/suchitgupta60/temp/blob/master/MultipleContracts.sol
Strato GUI recognized it but after I submit the contract…there is nowhere I can see it.
This is after create contract, as you can see there no contract published in the background.
I am uploading same contract using Bloc API and compiles successfully but management dashboard doesn’t reflect anything.
Here is the link to the dashboard
Try uploading without the pragma directive
It did not work…What else you suggest?
I was able to download https://raw.githubusercontent.com/suchitgupta60/temp/master/MultipleContracts.sol, save it to a file called Caller.sol and then upload it successfully to a local instance after removing the pragma statement.
It worked! I had to recreated a new instance in azure and the same contract compiled successfully. If the two contracts were in two different files and not one…how do I go about compiling them?
If there are dependencies, they all need to be part of the same file.
@samrit how did you make it work with the supply chain demo app, which creates all separate contracts? thanks.
@samrit I would also be curious to know more about the restrictions
E.g., is it possible that “dependencies” you mean abstract types. I tried to upload two files were one was an abstract definition and the other was the actual implementation, but the upload did not work, since the smart contract could not be compiled.