Skip to content

Refactor native token transfers to use deposited transactions instead of withdrawals - #58

Merged
phearnot merged 93 commits into
mainfrom
native-token-transfers-deposits-2
Oct 21, 2025
Merged

phearnot merged 93 commits into
mainfrom
native-token-transfers-deposits-2

Conversation

@vladimirlogachev

@vladimirlogachev vladimirlogachev commented May 16, 2025 •

Copy link
Copy Markdown
Contributor
  • Refactor native token transfers to use deposited transactions instead of withdrawals
  • Add test for scale
  • Increase chain contract fee for local-network, because it tends to grow again and again

Comment thread contracts/eth/src/StandardBridge.sol
Comment thread src/main/scala/units/el/StandardBridge.scala Outdated
Comment thread src/main/scala/units/el/StandardBridge.scala Outdated
Comment thread src/main/scala/units/el/StandardBridge.scala Outdated

@goodmai goodmai left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@vladimirlogachev
vladimirlogachev marked this pull request as ready for review June 10, 2025 13:54
@vladimirlogachev
vladimirlogachev force-pushed the native-token-transfers-deposits-2 branch from 9e79ca8 to 621c6a1 Compare June 18, 2025 11:29
Comment thread local-network/deploy/deploy.py
Comment thread src/main/scala/units/ELUpdater.scala Outdated
Comment thread src/main/scala/units/ELUpdater.scala Outdated
Comment thread src/main/scala/units/el/StandardBridge.scala Outdated
Comment thread src/main/scala/units/el/StandardBridge.scala Outdated
Comment thread src/test/scala/units/C2ETransfersTestSuite.scala Outdated
@vladimirlogachev
vladimirlogachev force-pushed the native-token-transfers-deposits-2 branch from 59eb7d5 to 701551f Compare July 2, 2025 06:27

import com.wavesplatform.transaction.TxHelpers
import com.wavesplatform.state.IntegerDataEntry
import org.web3j.crypto.Credentials

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never used

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, fixed

val e2cWavesTxn = standardBridge.sendBridgeErc20(elSender, WWavesAddress, clRecipient.toAddress, wavesE2CAmount, nextNonce)

chainContract.waitForEpoch(waves1.api.height() + 1) // Bypass rollbacks
val e2cReceipts = List(e2cIssuedTxn, e2cIssuedTxn, e2cWavesTxn).map { txn =>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e2cIssuedTxn appointed twice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, fixed

@vladimirlogachev
vladimirlogachev force-pushed the native-token-transfers-deposits-2 branch from 0a2b9fb to ab9939f Compare July 8, 2025 07:45
Comment thread consensus-client-it/src/test/scala/units/BlockValidationTestSuite.scala Outdated
Comment thread consensus-client-it/src/test/scala/units/docker/WavesNodeContainer.scala Outdated
Comment thread consensus-client-it/src/test/scala/units/TestNetworkClient.scala Outdated
Comment thread consensus-client-it/src/test/scala/units/TestNetworkClient.scala Outdated
Comment thread consensus-client-it/src/test/scala/units/docker/WavesNodeContainer.scala Outdated
Comment thread consensus-client-it/src/test/scala/units/docker/WavesNodeContainer.scala Outdated
Comment thread consensus-client-it/src/test/scala/units/docker/WavesNodeContainer.scala Outdated
Comment thread src/main/scala/units/ELUpdater.scala Outdated
Comment thread consensus-client-it/src/test/scala/units/BaseBlockValidationSuite.scala Outdated
Comment thread consensus-client-it/src/test/scala/units/BaseBlockValidationSuite.scala Outdated
val (nativeTransfers, assetTransfers) = transfers.partitionMap {
case x: ContractTransfer.Native => x.asLeft
case x: ContractTransfer.Asset => x.asRight
val nativeTransfersViaWithdrawals = transfers.flatMap {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val nativeTransfersViaWithdrawals = transfers.flatMap {
val nativeTransfersViaWithdrawals = transfers.collect {
case x: ContractTransfer.NativeViaWithdrawal => x
}

@phearnot
phearnot merged commit c0c6dea into main Oct 21, 2025
4 checks passed
@phearnot
phearnot deleted the native-token-transfers-deposits-2 branch October 21, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants