Skip to content

Commit

Permalink
adding separate flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sasurobert committed Jul 26, 2024
1 parent c4890f3 commit 9001fca
Show file tree
Hide file tree
Showing 2 changed files with 7 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"
)
4 changes: 4 additions & 0 deletions vmhost/hostCore/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,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 9001fca

Please sign in to comment.