-
Notifications
You must be signed in to change notification settings - Fork 198
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
ESDT system SC correct initialization at end-of-epoch #2986
Conversation
vm/systemSmartContracts/esdt.go
Outdated
@@ -762,7 +769,8 @@ func (e *esdt) togglePause(args *vmcommon.ContractCallInput, builtInFunc string) | |||
} | |||
|
|||
func (e *esdt) configChange(args *vmcommon.ContractCallInput) vmcommon.ReturnCode { | |||
if !bytes.Equal(args.CallerAddr, e.ownerAddress) { | |||
icCorrectCaller := bytes.Equal(args.CallerAddr, e.ownerAddress) || bytes.Equal(args.CallerAddr, e.endOfEpochSCAddress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isCorrectCaller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
vm/errors.go
Outdated
@@ -83,12 +83,12 @@ var ErrNilMessageSignVerifier = errors.New("nil message sign verifier") | |||
// ErrNilStakingSmartContractAddress signals that staking smart contract address is nil | |||
var ErrNilStakingSmartContractAddress = errors.New("nil staking smart contract address") | |||
|
|||
// ErrNilEndOfEpochSmartContractAddress signals that the end of epoch smart contract address is nil | |||
var ErrNilEndOfEpochSmartContractAddress = errors.New("nil end of epoch contract address") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nil end of epoch smart contract address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
a7ab63f
configChange
will work as expected.Testing scenario: launch a testnet, wait until ESDT feature becomes active (epoch 4) and try issue an ESDT with a base issuing value less than 5 eGLD. The transaction should fail. When trying to issue an ESDT with 5 eGLD, it should work. Use the
erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c
address (pem file is located in elrond-go/cmd/node/testKeys/esdtWalletKey.pem) to send a transaction with the following parameters:Meaning: "change the ESDT configuration: set the owner to 486d8467f546377388006adf5891389d16431e3e8d91a0281bb185cab41dde1f which is erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c, set the base issuing cost to 0.05 eGLD and set the minimum and maximum name lengths to 10 and 20 respectively"
The transaction should succeed.
Now, try issuing a new ESDT token with 0.05eGLD. The token should be issued (transaction succeeded).