solhint
solhint copied to clipboard
mark-callable-contracts notified when creating instances of a struct
I have a struct in a base class, eg MyStruct:
pragma solidity ^0.5.0;
contract BaseContract {
struct MyStruct {
string myField;
}
}
Which I want to construct in an inherited contract:
pragma solidity ^0.5.0;
import 'BaseContract.sol';
contract SubContract is BaseContract {
MyStruct private _data;
function initialize() public {
_data = MyStruct({myField: 'the data'});
}
}
Error:
contracts/SubContract.sol
10:13 error Explicitly mark all external contracts as trusted or untrusted mark-callable-contracts
NOTE: I also tested when the struct was in the same file:
pragma solidity ^0.5.0;
contract SubContract {
struct MyStruct {
string myField;
}
MyStruct private _data;
function initialize() public {
_data = MyStruct({myField: 'the data'});
}
}
Error:
contracts/base/SubContract.sol
12:13 error Explicitly mark all external contracts as trusted or untrusted mark-callable-contracts