Linking my account tolak on GitHub with my address 5En54NcpvxWur5BVk59Lw9ynwHnMA8Dr5zLeQfMtgs7HGAvs on Substrate in mycryptoprofile.io, and the challenge code is: 809a437cf6776ced2bc9b08a9184ed04. #LitentryVerifyMyAddress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ethers } from "ethers"; | |
import { ApiPromise, WsProvider } from "@polkadot/api"; | |
export type Address = string; | |
export enum ChainType { | |
Evm, | |
Sub, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config(); | |
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api'); | |
const { blake2AsU8a } = require('@polkadot/util-crypto'); | |
const BN = require('bn.js'); | |
const bn1e12 = new BN(10).pow(new BN(12)); | |
function getPhaAssetId(khalaApi) { | |
return khalaApi.createType('XcmV1MultiassetAssetId', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This gist is owned by address: 0x7804e66ec9eea3d8daf6273ffbe0a8af25a8879cf43f14d0ebbb30941f578242 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config(); | |
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api'); | |
const { blake2AsU8a } = require('@polkadot/util-crypto'); | |
const BN = require('bn.js'); | |
const ethers = require('ethers'); | |
const BridgeJson = require('./Bridge.json'); | |
const bn1e9 = new BN(10).pow(new BN(9)); | |
const bn1e12 = new BN(10).pow(new BN(12)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config(); | |
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api'); | |
const { blake2AsU8a } = require('@polkadot/util-crypto'); | |
const BN = require('bn.js'); | |
const ethers = require('ethers'); | |
const BridgeJson = require('./Bridge.json'); | |
const bn1e18 = new BN(10).pow(new BN(18)); | |
const khalaParaId = 2004; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config(); | |
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api'); | |
const { blake2AsU8a } = require('@polkadot/util-crypto'); | |
const BN = require('bn.js'); | |
const ethers = require('ethers'); | |
const BridgeJson = require('./Bridge.json'); | |
const bn1e18 = new BN(10).pow(new BN(18)); | |
const khalaParaId = 2004; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers'); | |
const ERC20HandlerJson = require('../build/contracts/ERC20Handler.json'); | |
async function main() { | |
const handlerAddress = '0xDf2E83f33dB8A9CcF3a00FCe18C3F509b974353D'; | |
const provider = new ethers.providers.JsonRpcProvider('https://kovan.infura.io/v3/6d61e7957c1c489ea8141e947447405b'); | |
const handler = new ethers.Contract(handlerAddress, ERC20HandlerJson.abi, provider); | |
const depositRecord = await handler.getDepositRecord(50, 1); | |
console.log(depositRecord); | |
} |