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
I am particularly interested in the line: 2. S -> (A) -> (B)
My Smart Contract (StorageContainer) looks like:
pragma solidity ^0.4.19;
import "./SimpleStorage.sol";
contract StorageContainer {
uint constant ADD_STORAGE = 1;
mapping(uint => address) storages;
function addStorageContract(address storageContract) public {
storages[ADD_STORAGE] = storageContract;
}
function setForAddStorage(uint value) public {
SimpleStorage instance = SimpleStorage(storages[ADD_STORAGE]);
instance.set(value);
}
function getFromAddStorage() public constant returns(uint value) {
SimpleStorage instance = SimpleStorage(storages[ADD_STORAGE]);
return instance.get();
}
}
Smart Contract (SimpleStorage.sol) is same as (simplestorage.sol) in quorum-examples
So. I deploy (with truffle v4.1.3) StorageContainer as normal public contract.
But i deploy SimpleStorage as private Contract (with value for example : 45) for nedes 1 and 2 from 7nodes example
On node 1 i can properly add SimpleStorage-contract to StorageContainer and also i can get private value 45 from it. On node 7 or 4 i get value 0. So all works properly. In truffle-console it look like:
(Note: I have tried the same with truffle v4.1.7 and solc v0.4.23 and it seems not to work. (but nevermid))
After that i tried to call setForAddStorage: truffle(development)> storageContainer.setForAddStorage(35, {privateFor: ['QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc=']});
The transaction will be executed but if i call:
I see the same 45 and not 35.
After I call (without privateFor): truffle(development)> storageContainer.setForAddStorage(35); I see also 45 and not 35.
It means i send private transaction to public contract and this is not allowed. So i will send private transaction from public contract to private contract but i do not know how to do it.
It is this line 2. S -> (A) -> (B) so i think it is supported.
Can you help me with it?
Thank you in advance for your response.
The text was updated successfully, but these errors were encountered:
I have found some another strage things 馃槂 .
With different versions of truffle I get different reuslts. It seems the problem is Solidity Compiler (solc), spacially version of it. Different truffle versions have different solc versions .
With truffle@4.1.3 (solc@0.4.19) I can send private transaction
to private contract StorageContainer (this contract is deployed as private for node 1 and 2 yet) and this contract can call SimpleStorage. and I can see 35 calling storageContainer.getFromAddStorage();
With truffle@4.1.5 (solc@0.4.21) the same scenario above works not more
I can see value 45 (default value that was deployed with contract) calling storageContainer.getFromAddStorage();
but if I try to send transaction as above I see only 45 and not 35.
With truffle@4.1.7(solc@0.4.23) nothing works. I can not see 45 as well.
@tzaika the S in 2. S -> (A) -> (B) refers to the sending account(An externally owned account with an ether balance. All external accounts in Quorum are public). This means that a public account S can create a private transaction/contract (A) and (A) can interact or create another private transaction/Contract B. Given the separation of private and public states in Quorum, the only permitted operation between the private state and the public state is the ability to read the public state from a private state S -> (A) -> [B -> C].
I am not sure about the truffle issues, they shouldn't be related. We do have a few open issues on different solidity versions that we are debugging.
Hi Guys once more 馃槂 .
I am trying quorum and read the documentation.
You have written that such behavior is possible:
Link : Private/Public State
I am particularly interested in the line:
2. S -> (A) -> (B)
My Smart Contract (StorageContainer) looks like:
Smart Contract (SimpleStorage.sol) is same as (simplestorage.sol) in quorum-examples
So. I deploy (with truffle v4.1.3)
StorageContainer
as normal public contract.But i deploy
SimpleStorage
as private Contract (with value for example : 45) for nedes 1 and 2 from 7nodes exampleOn node 1 i can properly add
SimpleStorage
-contract toStorageContainer
and also i can get private value 45 from it. On node 7 or 4 i get value 0. So all works properly. Intruffle-console
it look like:(Note: I have tried the same with truffle v4.1.7 and solc v0.4.23 and it seems not to work. (but nevermid))
After that i tried to call
setForAddStorage
:truffle(development)> storageContainer.setForAddStorage(35, {privateFor: ['QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc=']});
The transaction will be executed but if i call:
I see the same 45 and not 35.
After I call (without privateFor):
truffle(development)> storageContainer.setForAddStorage(35);
I see also 45 and not 35.It means i send private transaction to public contract and this is not allowed. So i will send private transaction from public contract to private contract but i do not know how to do it.
It is this line
2. S -> (A) -> (B)
so i think it is supported.Can you help me with it?
Thank you in advance for your response.
The text was updated successfully, but these errors were encountered: