0

I want to make an XVM call from an ink! contract that is deployed to the Shibuya Wasm environment to a Solidity EVM contract that is deployed to the Shibuya EVM environment.

To deploy the Solidity EVM contract I want to use Truffle, so I followed the official Astar instructions here https://docs.astar.network/docs/build/builder-guides/astar_features/truffle/ where it says to use from: "0x(your Shibuya account address)" in my Truffle configuration file truffle-config.js, but none of the Shibuya account addresses that I have generated work when I try to migrate the EVM smart contract by running truffle migrate --reset --compile-all --network shibuya. The Truffle documentation here says that the from field is for "From address used during migrations. Defaults to the first available account provided by your Ethereum client."

The steps I took to try to resolve it so far include the following. All the code that I've mentioned is published here https://github.com/ltfschoen/XCMTemplate/pull/25 and I was using endpoint wss://shibuya.public.blastapi.io:

  1. Created a Shibuya address using Subkey using Docker by running docker run -it --pull=always docker.io/parity/subkey:latest generate --network astar, which output the following, except I haven't shown the mnemonic phrase and private key below, then I used a faucet to give that address a 10 SBY account balance, which I verified here https://shibuya.subscan.io/account/XXyzohKoEwDWXvpo7CS8unT7rjU6KoiaRm8iE1eWSXMpf3i:
  Account ID:        0x46b03bc771e0799dcbc20302e3054b7f34d17e442189bd4acabc822f318afc6d
  Public key (SS58): XXyzohKoEwDWXvpo7CS8unT7rjU6KoiaRm8iE1eWSXMpf3i
  1. Updated Truffle configuration file truffle-config.js to use that Account ID,
from: "0x46b03bc771e0799dcbc20302e3054b7f34d17e442189bd4acabc822f318afc6d"
  1. Ran truffle migrate --reset --compile-all --network shibuya to migrate the Solidity EVM contract to Shibuya network using Truffle, but it gave the following error:
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


Starting migrations...
======================
> Network name:    'shibuya'
> Network id:      81
> Block gas limit: 15000000 (0xe4e1c0)


1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------
 *** Deployment Failed ***

"Migrations" -- Provided address 0x46b03bc771e0799dcbc20302e3054b7f34d17e442189bd4acabc822f318afc6d is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted..


Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.


Error:  *** Deployment Failed ***

"Migrations" -- Provided address 0x46b03bc771e0799dcbc20302e3054b7f34d17e442189bd4acabc822f318afc6d is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted..

    at /Users/luke/.nvm/versions/node/v16.18.1/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:330:1
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Truffle v5.11.0 (core: 5.11.0)
Node v16.18.1
  1. Went to https://shibuya.subscan.io/tools/format_transform?input=XXyzohKoEwDWXvpo7CS8unT7rjU6KoiaRm8iE1eWSXMpf3i&type=All to see what other addresses the Public key (SS58) value of XXyzohKoEwDWXvpo7CS8unT7rjU6KoiaRm8iE1eWSXMpf3i that was generated by Subkey would transform into, and it displayed:
Public Key
0x46b03bc771e0799dcbc20302e3054b7f34d17e442189bd4acabc822f318afc6d

H160
0x46b03Bc771e0799dcBc20302e3054b7f34d17E44
  1. I used the H160 address that was shown for the value of the from field instead:
from: "0x46b03Bc771e0799dcBc20302e3054b7f34d17E44"

But when I ran truffle migrate --reset --compile-all --network shibuya it gave error:

"Migrations" -- Unknown address - unable to sign transaction for this address: "0x46b03bc771e0799dcbc20302e3054b7f34d17e44".
  1. Then I tried doing the following in truffle-config.js, but it appears to output a seemlingly unrelated address 0xe234aaD61a482eBB5f737ffFd4b868d829eAc455 for the privateKeyShibuya that I provided that was generated by Subkey, and it said it had no funds (since I only used the faucet to get SBY tokens for the account that was actually generated by Subkey).
const { Web3 } = require('web3');
let providerInstance = new Web3.providers.WebsocketProvider(
   process.env.SHIBUYA_ENDPOINT, {}, { delay: 500, autoReconnect: true, maxAttempts: 100 });
let web3 = new Web3(providerInstance);
const accounts = web3.eth.accounts.privateKeyToAccount(privateKeyShibuya);
console.log('accounts:', accounts);

outputs

accounts: {
  address: '0xe234aaD61a482eBB5f737ffFd4b868d829eAc455',
  privateKey: '...',
  ....
  1. Then I tried the suggestion here https://stackoverflow.com/questions/68823402/provided-address-is-invalid-the-capitalization-checksum-test-failed by adding the following to truffle-config.js. I made the assumption that I needed to use the H160 address 0x46b03Bc771e0799dcBc20302e3054b7f34d17E44:
...
const accountAddress = "0x46b03Bc771e0799dcBc20302e3054b7f34d17E44";

async function checksumShibuyaAccountAddress(_shibuyaAccountAddress) {
   let providerInstance = await new Web3.providers.WebsocketProvider(
      process.env.SHIBUYA_ENDPOINT, {}, { delay: 500, autoReconnect: true, maxAttempts: 100 });
   let web3 = await new Web3(providerInstance);
   console.log('web3.currentProvider: ', web3.currentProvider);
   let checksumShibuyaAccountAddress = web3.utils.toChecksumAddress(_shibuyaAccountAddress);
   return checksumShibuyaAccountAddress;
}

...

module.exports = {
...
   networks: {
      shibuya: {
         provider: () => {
         from: async () => {
            let from = await checksumShibuyaAccountAddress(accountAddress);
            console.log('checksumShibuyaAccountAddress from: ', from)
            return from;
         },

However, that outputs the same error as I got earlier:

... is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted..

0

Your Answer

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

Browse other questions tagged or ask your own question.