I'm dealing with inheritance and external calls of contract from within solidity. I have deployed my data structure and filled it at an address MapAdr
My code can me schemed as follow. In my DataStructure.sol I have:
interface Graph {
function getNeighbours(uint8 id) external view returns (uint8[8]);
function getOrder() external view returns (uint8);
function isNeighbour(uint8 strFrom, uint8 strTo) external view returns
(bool success);
}
contract DataStructure is Graph {
....code....
uint8 order;
constructor (uint8 size) {
order = size;
}
....code...
}
I deploy this contract and I save the address to MapAdr=0x1234567...
Now I go to my other contract
pragma solidity ^0.4.22;
import "./DataStructure.sol";
contract Data is Graph {
.....code....
DataStructure public data;
constructor(address MapAdr) public {
....code...
data = DataStructure(MapAdr);
....code...
}
.....code....
}
But then DataStructure is deployed but it's address is not MapAdr.
There is a way to have an instance of the deployed contract at that specific MadAdr (so with that exactly data inserted in that datastructure) so I can query it's storage ?
The idea is to deploy several DataStructure contracts with different data inserted and then referiing to one specific when deploying Data contract.