Skip to content

Commit

Permalink
fix(site): rename address constants
Browse files Browse the repository at this point in the history
  • Loading branch information
cor committed Oct 18, 2023
1 parent 640156b commit 44c6e16
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions site/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import ibcAbi from '$lib/abi/ibc.json';

export const UNION_CHAIN_ID = 'union-testnet-3';
export const MUNO_ERC20_ADDRESS = '0x4bbca3a0360476a8a4f8482b8558c919e0663485';
export const IBC_ADDRESS = '0x100E44E3DD0349a60AB8C154Add0bE31a76C2CC7';
export const UCS01_RELAY_CONTRACT =
export const UCS01_EVM_ADDRESS = '0x100E44E3DD0349a60AB8C154Add0bE31a76C2CC7';
export const UCS01_UNION_ADDRESS =
'union15d0ne205wynlf33r44a2awtk74f5llgup25x69564h9964ysurds60xnjw';

export const ERC20_CONTRACT_ABI = erc20abi.abi;
Expand Down
4 changes: 2 additions & 2 deletions site/src/lib/transferDemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';
import {
UNION_CHAIN_ID,
ERC20_CONTRACT_ABI,
UCS01_RELAY_CONTRACT,
UCS01_UNION_ADDRESS,
MUNO_ERC20_ADDRESS
} from './constants';

Expand Down Expand Up @@ -183,7 +183,7 @@ export const sendUnoToEthereum = async () => {

return cwClient.execute(
uAccount.address,
UCS01_RELAY_CONTRACT,
UCS01_UNION_ADDRESS,
{
transfer: {
channel: 'channel-12',
Expand Down
11 changes: 8 additions & 3 deletions site/src/lib/transferFromSepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ import {

import { ethers } from 'ethers';
import { get } from 'svelte/store';
import { MUNO_ERC20_ADDRESS, ERC20_CONTRACT_ABI, IBC_ADDRESS, IBC_CONTRACT_ABI } from './constants';
import {
MUNO_ERC20_ADDRESS,
ERC20_CONTRACT_ABI,
UCS01_EVM_ADDRESS,
IBC_CONTRACT_ABI
} from './constants';

export const approveUnoTransferToUnion = async () => {
const eProvider = get(ethersProvider);
const eSigner = get(ethersSigner);
const eAddress = get(ethereumAddress);
const contract = new ethers.Contract(MUNO_ERC20_ADDRESS, ERC20_CONTRACT_ABI, eSigner);

const tx = await contract.approve(IBC_ADDRESS, 100000);
const tx = await contract.approve(UCS01_EVM_ADDRESS, 100000);
await tx.wait();
};

Expand All @@ -41,7 +46,7 @@ export const sendUnoToUnion = async () => {
const erc20balance = await contract.balanceOf(eAddress);
console.log(erc20balance);

const ibcContract = new ethers.Contract(IBC_ADDRESS, IBC_CONTRACT_ABI, eSigner);
const ibcContract = new ethers.Contract(UCS01_EVM_ADDRESS, IBC_CONTRACT_ABI, eSigner);

// string calldata portId,
// string calldata channelId,
Expand Down

0 comments on commit 44c6e16

Please sign in to comment.