Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed merge conflicts
  • Loading branch information
sumitsnk committed Feb 23, 2022
commit 7f8b6f491c3430caa59b2491e4be7d4780ced990
19 changes: 9 additions & 10 deletions src/config-local.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
SNOWBRIDGE_EXPLORER_URL: 'https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A11144#/explorer',

PERMITTED_ETH_NETWORK: 'private',
PERMITTED_ETH_NETWORK_ID: '0x???',
PERMITTED_ETH_NETWORK_ID: '0xf',

BASIC_CHANNEL_ID: 0,
INCENTIVIZED_CHANNEL_ID: 1,
Expand All @@ -53,13 +53,12 @@ export default {
//Key required for connection with walletconnect
INFURA_KEY: process.env.REACT_APP_INFURA_KEY,
PARACHAIN_LIST : [
{ "parachainName":'Snowbridge', "parachainId": 0, 'isDisabled':false },
{ "parachainName":'Snowbridge-test', "parachainId": 1001,'isDisabled':false },
{ "parachainName":'Acala (coming soon...)', "parachainId": 0,'isDisabled':true },
{ "parachainName":'Moonbeam (coming soon...)', "parachainId": 0,'isDisabled':true },
{ "parachainName":'Bifrost (coming soon...)', "parachainId": 0,'isDisabled':true },
{ "parachainName":'Kusama (coming soon...)', "parachainId": 0, 'isDisabled':true },
{ "parachainName":'Snowbridge (coming soon...)', "parachainId": 0,'isDisabled':true }
],
TRANSACTION_FEES:'0'
{ "parachainName":'Snowbridge', "parachainId": 0, 'isDisabled':false, 'transactionFee': 0 },
{ "parachainName":'Snowbridge-test', "parachainId": 1001,'isDisabled':false, 'transactionFee': 4000000 },
{ "parachainName":'Acala (coming soon...)', "parachainId": 0,'isDisabled':true, 'transactionFee': 0 },
{ "parachainName":'Moonbeam (coming soon...)', "parachainId": 0,'isDisabled':true, 'transactionFee': 0 },
{ "parachainName":'Bifrost (coming soon...)', "parachainId": 0,'isDisabled':true, 'transactionFee': 0 },
{ "parachainName":'Kusama (coming soon...)', "parachainId": 0, 'isDisabled':true, 'transactionFee': 0 },
{ "parachainName":'Snowbridge (coming soon...)', "parachainId": 0,'isDisabled':true, 'transactionFee': 0 }
]
};
17 changes: 8 additions & 9 deletions src/config-staging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ export default {
//Key required for connection with walletconnect
INFURA_KEY: process.env.REACT_APP_INFURA_KEY,
PARACHAIN_LIST : [
{ "parachainName":'Snowbridge', "parachainId": 0, 'isDisabled':false },
{ "parachainName":'Snowbridge-test', "parachainId": 1001,'isDisabled':false },
{ "parachainName":'Acala (coming soon...)', "parachainId": 0,'isDisabled':true },
{ "parachainName":'Moonbeam (coming soon...)', "parachainId": 0,'isDisabled':true },
{ "parachainName":'Bifrost (coming soon...)', "parachainId": 0,'isDisabled':true },
{ "parachainName":'Kusama (coming soon...)', "parachainId": 0, 'isDisabled':true },
{ "parachainName":'Snowbridge (coming soon...)', "parachainId": 0,'isDisabled':true }
],
TRANSACTION_FEES:'0'
{ "parachainName":'Snowbridge', "parachainId": 0, 'isDisabled':false, 'transactionFee': 0 },
{ "parachainName":'Snowbridge-test', "parachainId": 1001,'isDisabled':false, 'transactionFee': 4000000 },
{ "parachainName":'Acala (coming soon...)', "parachainId": 0,'isDisabled':true, 'transactionFee': 0 },
{ "parachainName":'Moonbeam (coming soon...)', "parachainId": 0,'isDisabled':true, 'transactionFee': 0 },
{ "parachainName":'Bifrost (coming soon...)', "parachainId": 0,'isDisabled':true, 'transactionFee': 0 },
{ "parachainName":'Kusama (coming soon...)', "parachainId": 0, 'isDisabled':true, 'transactionFee': 0 },
{ "parachainName":'Snowbridge (coming soon...)', "parachainId": 0,'isDisabled':true, 'transactionFee': 0 }
]
};
9 changes: 4 additions & 5 deletions src/net/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import Onboard from 'bnc-onboard'
// Import Contracts
import {
PERMITTED_ETH_NETWORK_ID,
INFURA_KEY,
INCENTIVIZED_OUTBOUND_CHANNEL_CONTRACT_ADDRESS,
TRANSACTION_FEES
INFURA_KEY,
CONTRACT_ADDRESS
} from '../config';

/* tslint:disable */
Expand Down Expand Up @@ -322,7 +321,7 @@ export default class Eth extends Api {
// call ether contract for ether
if (isEther(asset)) {
return ethContract.methods
.lock(polkadotRecipientBytes, channelId, parachainId,TRANSACTION_FEES)
.lock(polkadotRecipientBytes, channelId, parachainId,transactionFee)
.send({
from: sender,
gas: 500000,
Expand All @@ -338,7 +337,7 @@ export default class Eth extends Api {
amount,
channelId,
parachainId,
TRANSACTION_FEES
transactionFee
)
.send({
from: sender,
Expand Down
16 changes: 5 additions & 11 deletions src/redux/actions/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ import { ThunkAction, ThunkDispatch } from 'redux-thunk';
import { Contract } from 'web3-eth-contract';
import { PromiEvent } from 'web3-core';
import Web3 from 'web3';
import {
REQUIRED_ETH_CONFIRMATIONS,
BASIC_OUTBOUND_CHANNEL_CONTRACT_ADDRESS,
INCENTIVIZED_OUTBOUND_CHANNEL_CONTRACT_ADDRESS,
BASIC_INBOUND_CHANNEL_CONTRACT_ADDRESS,
INCENTIVIZED_INBOUND_CHANNEL_CONTRACT_ADDRESS
} from '../../config';
import { REQUIRED_ETH_CONFIRMATIONS, CONTRACT_ADDRESS } from '../../config';
import {
Asset,
decimals,
Expand Down Expand Up @@ -395,15 +389,15 @@ export function handleEthTxRecipt(receipt: any, dispatch: Dispatch<any>,
(receipt.logs).forEach((log: any) => {
const event = log;

if (event.address === BASIC_OUTBOUND_CHANNEL_CONTRACT_ADDRESS) {
if (event.address === CONTRACT_ADDRESS.BasicOutboundChannel) {
const decodedEvent = web3.eth.abi.decodeLog(
basicOutChannelLogFields,
event.data,
event.topics,
);
nonce = decodedEvent.nonce;
}
if (event.address === INCENTIVIZED_OUTBOUND_CHANNEL_CONTRACT_ADDRESS) {
if (event.address === CONTRACT_ADDRESS.IncentivizedOutboundChannel) {
const decodedEvent = web3.eth.abi.decodeLog(
incentivizedOutChannelLogFields,
event.data,
Expand Down Expand Up @@ -519,12 +513,12 @@ export const handleEthereumMissedEvents = (

const incentivizeInboundContract = new web3.eth.Contract(
IncentivizedInboundChannel.abi as any,
INCENTIVIZED_INBOUND_CHANNEL_CONTRACT_ADDRESS,
CONTRACT_ADDRESS.IncentivizedInboundChannel,
);

const basicInboundContract = new web3.eth.Contract(
BasicInboundChannel.abi as any,
BASIC_INBOUND_CHANNEL_CONTRACT_ADDRESS,
CONTRACT_ADDRESS.BasicInboundChannel,
);

const incentivizeInboundLatestNonce = Number(await incentivizeInboundContract.methods.nonce().call());
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.