guys i have a gist file here, will appreciate your contributions.

https://gist.github.com/OnahProsperity/7d678d308a6ae47dc149d755054f20f9.

basically i declare an enum in my interface this way.
interface interEnum {
enum SIDE {
buy,
sell
}
}

then i used it this way:
contract B is interEnum {

function bEnum(SIDE side) external {
// do something with here
}
}

the question is when i want to use the contract here:
contract A {
B b;
enum NUM {
buy,
sell
}
function bEnum(NUM num) external {
// i cant pass in an enum from here.
// invalid explicit conversion from uint256 to Enum when i tried it this way
// b.bEnum(uint256(num);

// b
// invalid explicit conversion from enum to enum....
// b.bEnum(num);

}
}

Nov 29, 2021, 8:29 PM

© 2024 Draquery.com All rights reserved.