kinda new to the development side of Ethereum. Been searching around for days but can't seem to find an answer for my specific case. I'm trying this challenge here.
The problem is that I can't seem to access the variable in the Stamp contract using address(stamp).id()
when trying to check if the var Id exists as I get "TypeError: Member 'id' not found or not visible after argument-dependent lookup in address."
Referencing the validator file, I can't create new contracts via the 'new' keyword to check that Id() exists as the validator is the one creating the contract at the particular address. As such, I need some way of accessing the variable of the external contract without using low level calls. This is why I haven't found answers on similar threads because in this instance, I can't modify the original Stamp or NotStamp contract.
Any pointers greatly appreciated. My attempt below. Thanks
pragma solidity ^0.5.0;
interface IStampCollector {
function isCollected(address stamp) external returns (bool);
function collectStamp(address stamp) external;
}
contract Stamp { bytes32 public id; uint public rarity;
constructor(bytes32 _id, uint _rarity) public {
id = _id;
rarity = _rarity; }
}
contract NotStamp { bytes32 public notId; uint public notRarity;
constructor(bytes32 _id, uint _rarity) public {
notId = _id;
notRarity = _rarity; }
}
contract StampCollector is IStampCollector, Stamp, NotStamp {
bool public genuine;
function isCollected(address stamp) public returns (bool) {
require(address(stamp).id());
genuine = true;
}
function collectStamp(address stamp) public {
}
}