Skip to content

Commit

Permalink
Merge pull request #319 from multiversx/integrate-new-contracts-2024.…
Browse files Browse the repository at this point in the history
…08.12

Integrate new contracts 2024.08.12
  • Loading branch information
dragos-rebegea authored Aug 14, 2024
2 parents 4ded91d + 9f060fd commit c46c192
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 18 deletions.
36 changes: 19 additions & 17 deletions integrationTests/relayers/slowTests/framework/multiversxHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const (
stakeFunction = "stake"
unpauseFunction = "unpause"
unpauseEsdtSafeFunction = "unpauseEsdtSafe"
unpauseProxyFunction = "unpauseProxy"
pauseEsdtSafeFunction = "pauseEsdtSafe"
pauseFunction = "pause"
issueFunction = "issue"
Expand Down Expand Up @@ -174,12 +175,26 @@ func (handler *MultiversxHandler) DeployContracts(ctx context.Context) {
require.NotEqual(handler, emptyAddress, handler.SafeAddress)
log.Info("safe contract deployed", "address", handler.SafeAddress, "transaction hash", hash)

// deploy bridge proxy
handler.ScProxyAddress, hash, _ = handler.ChainSimulator.DeploySC(
ctx,
bridgeProxyContractPath,
handler.OwnerKeys.MvxSk,
deployGasLimit,
[]string{
multiTransferAddress.Hex(),
},
)
require.NotEqual(handler, emptyAddress, handler.ScProxyAddress)
log.Info("bridge proxy contract deployed", "address", handler.ScProxyAddress, "transaction hash", hash)

// deploy multisig
minRelayerStakeInt, _ := big.NewInt(0).SetString(minRelayerStake, 10)
minRelayerStakeHex := hex.EncodeToString(minRelayerStakeInt.Bytes())
params := []string{
handler.SafeAddress.Hex(),
multiTransferAddress.Hex(),
handler.ScProxyAddress.Hex(),
minRelayerStakeHex,
slashAmount,
handler.Quorum}
Expand All @@ -196,19 +211,6 @@ func (handler *MultiversxHandler) DeployContracts(ctx context.Context) {
require.NotEqual(handler, emptyAddress, handler.MultisigAddress)
log.Info("multisig contract deployed", "address", handler.MultisigAddress, "transaction hash", hash)

// deploy bridge proxy
handler.ScProxyAddress, hash, _ = handler.ChainSimulator.DeploySC(
ctx,
bridgeProxyContractPath,
handler.OwnerKeys.MvxSk,
deployGasLimit,
[]string{
multiTransferAddress.Hex(),
},
)
require.NotEqual(handler, emptyAddress, handler.ScProxyAddress)
log.Info("bridge proxy contract deployed", "address", handler.ScProxyAddress, "transaction hash", hash)

// deploy test-caller
handler.TestCallerAddress, hash, _ = handler.ChainSimulator.DeploySC(
ctx,
Expand Down Expand Up @@ -304,10 +306,6 @@ func (handler *MultiversxHandler) DeployContracts(ctx context.Context) {
)
log.Info("ChangeOwnerAddress for multi-transfer tx executed", "hash", hash, "status", txResult.Status)

// unpause sc proxy
hash, txResult = handler.callContractNoParams(ctx, handler.ScProxyAddress, unpauseFunction)
log.Info("unpaused sc proxy executed", "hash", hash, "status", txResult.Status)

// ChangeOwnerAddress for bridge proxy
hash, txResult = handler.ChainSimulator.ScCall(
ctx,
Expand All @@ -322,6 +320,10 @@ func (handler *MultiversxHandler) DeployContracts(ctx context.Context) {
)
log.Info("ChangeOwnerAddress for bridge proxy tx executed", "hash", hash, "status", txResult.Status)

// unpause sc proxy
hash, txResult = handler.callContractNoParams(ctx, handler.MultisigAddress, unpauseProxyFunction)
log.Info("unpaused sc proxy executed", "hash", hash, "status", txResult.Status)

// setEsdtSafeOnMultiTransfer
hash, txResult = handler.ChainSimulator.ScCall(
ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"name": "multi_transfer_sc_address",
"type": "Address"
},
{
"name": "proxy_sc_address",
"type": "Address"
},
{
"name": "required_stake",
"type": "BigUint"
Expand All @@ -56,7 +60,20 @@
"outputs": []
},
"upgradeConstructor": {
"inputs": [],
"inputs": [
{
"name": "esdt_safe_sc_address",
"type": "Address"
},
{
"name": "multi_transfer_sc_address",
"type": "Address"
},
{
"name": "proxy_sc_address",
"type": "Address"
}
],
"outputs": []
},
"endpoints": [
Expand Down Expand Up @@ -345,6 +362,20 @@
"inputs": [],
"outputs": []
},
{
"name": "pauseProxy",
"onlyOwner": true,
"mutability": "mutable",
"inputs": [],
"outputs": []
},
{
"name": "unpauseProxy",
"onlyOwner": true,
"mutability": "mutable",
"inputs": [],
"outputs": []
},
{
"name": "changeFeeEstimatorContractAddress",
"onlyOwner": true,
Expand Down Expand Up @@ -755,6 +786,16 @@
}
]
},
{
"name": "getProxyAddress",
"mutability": "readonly",
"inputs": [],
"outputs": [
{
"type": "Address"
}
]
},
{
"docs": [
"Returns the current EsdtSafe batch.",
Expand Down
Binary file not shown.

0 comments on commit c46c192

Please sign in to comment.