Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call function in contract #178

Open
developeremi opened this issue Jun 14, 2023 · 0 comments
Open

How to call function in contract #178

developeremi opened this issue Jun 14, 2023 · 0 comments

Comments

@developeremi
Copy link

developeremi commented Jun 14, 2023

I have an error in the calling function of my contract.


    $fullNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.shasta.trongrid.io');
    $solidityNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.shasta.trongrid.io');
    $eventServer = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.shasta.trongrid.io');

    try {
        $tron = new \IEXBase\TronAPI\Tron($fullNode, $solidityNode, $eventServer);
    } catch (\IEXBase\TronAPI\Exception\TronException $e) {
        exit($e->getMessage());
    }

    $contractAddress = 'TWEv92whv1kDW3JqgNn5HHVhbfbnfhmQxC';
    $contract = $tron->contract($contractAddress, '[{"entrys":[{"stateMutability":"Nonpayable","type":"Constructor"},{"inputs":[{"indexed":true,"name":"user","type":"address"},{"name":"amount","type":"uint256"}],"name":"Deposit","type":"Event"},{"inputs":[{"indexed":true,"name":"user","type":"address"},{"name":"amount","type":"uint256"}],"name":"Withdrawal","type":"Event"},{"inputs":[{"indexed":true,"name":"user","type":"address"},{"name":"amount","type":"uint256"}],"name":"WithdrawalApproval","type":"Event"},{"inputs":[{"indexed":true,"name":"user","type":"address"},{"name":"amount","type":"uint256"}],"name":"WithdrawalRejection","type":"Event"},{"inputs":[{"indexed":true,"name":"user","type":"address"},{"name":"amount","type":"uint256"}],"name":"WithdrawalRequest","type":"Event"},{"outputs":[{"type":"uint256"}],"name":"MAX_WITHDRAWAL_AMOUNT","stateMutability":"View","type":"Function"},{"outputs":[{"type":"uint256"}],"name":"WITHDRAWAL_COOLDOWN","stateMutability":"View","type":"Function"},{"inputs":[{"name":"user","type":"address"}],"name":"approveWithdrawal","stateMutability":"Nonpayable","type":"Function"},{"outputs":[{"type":"uint256"}],"inputs":[{"type":"address"}],"name":"balances","stateMutability":"View","type":"Function"},{"name":"deposit","stateMutability":"Payable","type":"Function"},{"outputs":[{"type":"uint256"}],"name":"fee","stateMutability":"View","type":"Function"},{"outputs":[{"type":"uint256"}],"inputs":[{"type":"address"}],"name":"lastWithdrawalTime","stateMutability":"View","type":"Function"},{"outputs":[{"type":"address"}],"name":"owner","stateMutability":"View","type":"Function"},{"name":"pause","stateMutability":"Nonpayable","type":"Function"},{"outputs":[{"type":"bool"}],"name":"paused","stateMutability":"View","type":"Function"},{"inputs":[{"name":"user","type":"address"}],"name":"rejectWithdrawal","stateMutability":"Nonpayable","type":"Function"},{"inputs":[{"name":"amount","type":"uint256"}],"name":"requestWithdrawal","stateMutability":"Nonpayable","type":"Function"},{"name":"unpause","stateMutability":"Nonpayable","type":"Function"},{"inputs":[{"name":"amount","type":"uint256"}],"name":"withdraw","stateMutability":"Nonpayable","type":"Function"},{"outputs":[{"type":"uint256"}],"inputs":[{"type":"address"}],"name":"withdrawalRequests","stateMutability":"View","type":"Function"}]}]');

    $contract = $contract->paused()->call();

Call to undefined method IEXBase\TronAPI\TRC20Contract::paused()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant