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

adding separate flag for MultiESDTNFTTransferAndExecuteByUserFlag #858

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this flag should be also added on L43, as part of allFlags slice

return false
}

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