Skip to content

Commit

Permalink
Merge pull request #6314 from multiversx/proper_vm_integration
Browse files Browse the repository at this point in the history
Proper update of vm-go
  • Loading branch information
sstanculeanu authored Jul 16, 2024
2 parents 7d12600 + 8a18616 commit 1f0c028
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions process/smartContract/processorV2/vmInputV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func (sc *scProcessor) initializeVMInputFromTx(vmInput *vmcommon.VMInput, tx dat
vmInput.CallerAddr = tx.GetSndAddr()
vmInput.CallValue = new(big.Int).Set(tx.GetValue())
vmInput.GasPrice = tx.GetGasPrice()

relayedTx, isRelayed := isRelayedTx(tx)
if isRelayed {
vmInput.RelayerAddr = relayedTx.RelayerAddr
}

vmInput.GasProvided, err = sc.prepareGasProvided(tx)
if err != nil {
return err
Expand Down
6 changes: 6 additions & 0 deletions vm/systemSmartContracts/esdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const canTransferNFTCreateRole = "canTransferNFTCreateRole"
const upgradable = "canUpgrade"
const canCreateMultiShard = "canCreateMultiShard"
const upgradeProperties = "upgradeProperties"
const eGLD = "EGLD"

const conversionBase = 10

Expand Down Expand Up @@ -723,6 +724,11 @@ func isTokenNameHumanReadable(tokenName []byte) bool {
}

func (e *esdt) createNewTokenIdentifier(caller []byte, ticker []byte) ([]byte, error) {
if e.enableEpochsHandler.IsFlagEnabled(common.EGLDInESDTMultiTransferFlag) {
if bytes.Equal(ticker, []byte(eGLD)) {
return nil, vm.ErrCouldNotCreateNewTokenIdentifier
}
}
newRandomBase := append(caller, e.eei.BlockChainHook().CurrentRandomSeed()...)
newRandom := e.hasher.Compute(string(newRandomBase))
newRandomForTicker := newRandom[:tickerRandomSequenceLength]
Expand Down

0 comments on commit 1f0c028

Please sign in to comment.