Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate new contracts 2024.08.12 #319

Merged
merged 7 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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.
Loading