Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Lam committed Jul 18, 2024
1 parent 9a55aea commit de3132d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/src/TokenHome/ERC20TokenHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ contract ERC20TokenHome is IERC20TokenHome, TokenHome {
uint256 remainingAllowance = token.allowance(address(this), message.recipientContract);

// Reset the recipient contract allowance to 0.
// Use of {safeApprove} is okay to reset the allowance to 0.
// Use of {forceApprove} is okay to reset the allowance to 0.
SafeERC20.forceApprove(token, message.recipientContract, 0);

if (success) {
Expand Down
11 changes: 10 additions & 1 deletion tests/flows/transparent_proxy_upgradeability.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
erc20tokenremote "github.com/ava-labs/avalanche-interchain-token-transfer/abi-bindings/go/TokenRemote/ERC20TokenRemote"
"github.com/ava-labs/avalanche-interchain-token-transfer/tests/utils"
"github.com/ava-labs/subnet-evm/accounts/abi/bind"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/teleporter/tests/interfaces"
teleporterUtils "github.com/ava-labs/teleporter/tests/utils"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
. "github.com/onsi/gomega"
)

Expand Down Expand Up @@ -135,8 +137,15 @@ func TransparentUpgradeableProxy(network interfaces.Network) {

// Upgrade the TransparentUpgradeableProxy contract to use the new logic contract
tx, err = proxyAdmin.UpgradeAndCall(opts, erc20TokenHomeAddress, newLogic, []byte{})
// Expect(err).Should(BeNil())
// teleporterUtils.WaitForTransactionSuccess(ctx, cChainInfo, tx.Hash())
newHeads := make(chan *types.Header)
sub, err := cChainInfo.RPCClient.SubscribeNewHead(ctx, newHeads)
Expect(err).Should(BeNil())
teleporterUtils.WaitForTransactionSuccess(ctx, cChainInfo, tx.Hash())
defer sub.Unsubscribe()
header := <-newHeads
log.Debug("new head", "number", header.Number)
teleporterUtils.TraceTransactionAndExit(ctx, cChainInfo, header.TxHash)

// Send a transfer from Subnet A back to primary network
teleporterUtils.SendNativeTransfer(
Expand Down
2 changes: 1 addition & 1 deletion tests/local/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var _ = ginkgo.Describe("[Avalanche Interchain Token Transfer integration tests]
func() {
flows.RegistrationAndCollateralCheck(LocalNetworkInstance)
})
ginkgo.It("Transparent proxy upgrade",
ginkgo.FIt("Transparent proxy upgrade",
ginkgo.Label(erc20TokenHomeLabel, erc20TokenRemoteLabel, upgradabilityLabel),
func() {
flows.TransparentUpgradeableProxy(LocalNetworkInstance)
Expand Down

0 comments on commit de3132d

Please sign in to comment.