Skip to content

Commit

Permalink
Merge branch 'rc/v1.7.next1' of https://github.com/multiversx/mx-chai…
Browse files Browse the repository at this point in the history
…n-vm-go into rc/v1.7.2
  • Loading branch information
sstanculeanu committed Jul 30, 2024
2 parents 791c302 + 1a6d87a commit 75f5a5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vmhost/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ import "github.com/multiversx/mx-chain-core-go/core"
const (
// CryptoOpcodesV2Flag defines the flag that activates the new crypto APIs for RC1.7
CryptoOpcodesV2Flag core.EnableEpochFlag = "CryptoOpcodesV2Flag"

// MultiESDTNFTTransferAndExecuteByUserFlag defines the flag that activates the enshrined sovereign functions
MultiESDTNFTTransferAndExecuteByUserFlag core.EnableEpochFlag = "MultiESDTNFTTransferAndExecuteByUserFlag"
)
5 changes: 5 additions & 0 deletions vmhost/hostCore/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const internalVMErrors = "internalVMErrors"
// allFlags must have all flags used by mx-chain-vm-go in the current version
var allFlags = []core.EnableEpochFlag{
vmhost.CryptoOpcodesV2Flag,
vmhost.MultiESDTNFTTransferAndExecuteByUserFlag,
}

// vmHost implements HostContext interface.
Expand Down Expand Up @@ -544,6 +545,10 @@ func (host *vmHost) AreInSameShard(leftAddress []byte, rightAddress []byte) bool

// IsAllowedToExecute returns true if the special opcode is allowed to be run by the address
func (host *vmHost) IsAllowedToExecute(opcode string) bool {
if !host.enableEpochsHandler.IsFlagEnabled(vmhost.MultiESDTNFTTransferAndExecuteByUserFlag) {
return false
}

mapAddresses, ok := host.mapOpcodeAddressIsAllowed[opcode]
if !ok {
return false
Expand Down

0 comments on commit 75f5a5c

Please sign in to comment.