Linking my account tolak on GitHub with my address 5En54NcpvxWur5BVk59Lw9ynwHnMA8Dr5zLeQfMtgs7HGAvs on Substrate in mycryptoprofile.io, and the challenge code is: 809a437cf6776ced2bc9b08a9184ed04. #LitentryVerifyMyAddress
View index-sdk-draft.ts
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, | |
} |
View transfer_pha_to_evm_by_wanbridge.js
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', { |
View gist:59fc93019e54ddc7748ff2dc04638617
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 |
View kovan-dai-to-parachain.js
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)); |
View transfer-pha-from-ethereum-to-khala.js
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; |
View transfer-pha-from-ethereum-to-karura.js
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; |
View get-deposit-record.js
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); | |
} |