Is there a way to get poolInfo[0] public array element value (represented by Struct) via call request by Web3py library (without writing getter function)?

Contract snippet:

struct PoolInfo {
        uint256 id;
        address poolAddress;
        uint256 poolType;
        address lpToken;
        address Rewards;
        uint256 FeePercentage;
        bool pauseDeposit;
        address[] RewardTokens;

PoolInfo[] public poolInfo;

1 Answer 1



pool_info = contract.functions.poolInfo(0).call()
print(pool_info) # You will get a tuple representing your object

Contract is an object that was created from w3.eth.contract

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.