Skip to content

Commit

Permalink
Merge pull request #475 from skalenetwork/develop
Browse files Browse the repository at this point in the history
Minor fixes in transfer functions
  • Loading branch information
dmytrotkk authored Mar 5, 2025
2 parents d836950 + 7cb8621 commit 8e85d9f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions config/legacy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const METAPORT_CONFIG: types.mp.Config = {
openOnLoad: true,
openButton: true,
debug: false,
mainnetEndpoint: 'https://ethereum-holesky-rpc.publicnode.com',
chains: [
'mainnet',
'these-long-sadalsuud', // europa
Expand Down
10 changes: 5 additions & 5 deletions packages/metaport/src/core/actions/erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ export class TransferERC20M2S extends Action {

const tx = await sendTransaction(
mainnet.signer,
erc20MConnected.deposit,
[this.chainName2, this.token.keyname, amountWei, { address: this.address }],
`${this.chainName1}:erc20:deposit`
erc20MConnected.depositERC20,
[this.chainName2, this.token.address, amountWei, { address: this.address }],
`${this.chainName1}:erc20:depositERC20`
)

const block = await mainnet.provider.getBlock(tx.response.blockNumber)
Expand Down Expand Up @@ -329,9 +329,9 @@ export class TransferERC20S2M extends Action {

const tx = await sendTransaction(
sChain.signer,
erc20SConnected.withdraw,
erc20SConnected.exitToMainERC20,
[this.originAddress, amountWei, { address: this.address }],
`${this.chainName1}:erc20:withdraw`
`${this.chainName1}:erc20:exitToMainERC20`
)

const block = await sChain.provider.getBlock(tx.response.blockNumber)
Expand Down
4 changes: 2 additions & 2 deletions packages/metaport/src/core/actions/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export class TransferEthS2M extends Action {

const tx = await sendTransaction(
sChain.signer,
ethS.withdraw,
ethS.exitToMain,
[amountWei, { address: this.address }],
'mainnet:eth:withdraw'
'mainnet:eth:exitToMain'
)

const block = await this.sChain1.provider.getBlock(tx.response.blockNumber)
Expand Down
10 changes: 5 additions & 5 deletions packages/metaport/src/core/community_pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function getCommunityPoolData(
const communityPool = await mainnet.communityPool()
const communityLocker = await sChain.communityLocker()

const balanceWei = await communityPool.balance(address, chainName1)
const balanceWei = await communityPool.getBalance(address, chainName1)
const accountBalanceWei = await mainnet.ethBalance(address)
const activeS = await communityLocker.activeUsers(address)
const chainHash = ethers.id(chainName1)
Expand Down Expand Up @@ -132,9 +132,9 @@ export async function withdraw(

await sendTransaction(
signer,
communityPool.withdraw,
communityPool.withdrawFunds,
[chainName, amount, { address: address, customGasLimit: COMMUNITY_POOL_WITHDRAW_GAS_LIMIT }],
'mainnet:communityPool:withdraw'
'mainnet:communityPool:withdrawFunds'
)

setLoading(false)
Expand Down Expand Up @@ -177,13 +177,13 @@ export async function recharge(

sendTransaction(
signer,
communityPool.recharge,
communityPool.rechargeUserWallet,
[
chainName,
address,
{ address: address, value: units.toWei(amount, constants.DEFAULT_ERC20_DECIMALS) }
],
'mainnet:communityPool:recharge'
'mainnet:communityPool:rechargeUserWallet'
)

setLoading('activate')
Expand Down

0 comments on commit 8e85d9f

Please sign in to comment.