AlphaWallet / AlphaWallet/Web3E

Error calling smart contract functions with parameters

Đang mở
#26 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
152
Fork
45
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi!

Thanks for your awesome work, your library is great and has saved me lots of time and headaches.

I am using it with an ESP32 WROOM and I've been able to: 1) Send transaction to address 2) Call smart contract functions 3) Send transactions to smart contract functions **without parameters**.

However, I get an error every time I try to send a transaction to a smart contract function that contains some arguments. Here is an example:

## Working
### C++ code
```
string param = contract.SetupContractData("modifyNumber()");
string result = contract.SendTransaction(nonceVal, gasPriceVal, gasLimitVal, &contractAddrStr, &callValue, ¶m);
```

### Solidity code

```
contract Test {

uint8 public number = 20;

function modifyNumber() public {
number = 100;
}

}
```

## Not working
### C++ code
```
uint8_t newNum = 100;
string param = contract.SetupContractData("modifyNumber(uint8)", &newNum);
string result = contract.SendTransaction(nonceVal, gasPriceVal, gasLimitVal, &contractAddrStr, &callValue, ¶m);
```

### Solidity code

```
contract Test {

uint8 public number = 20;

function modifyNumber(uint8 newNum) public {
number = newNum;
}

}
```

## Error
The error occurs in `contract.SetupContractData(...)`, whenever the provided function contains some parameters.
The output error is of type:
`Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled`

Thank you in advance!

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.