-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add OnPayment in OracleContract #2094
Conversation
#2095 is better |
[ContractMethod(0_00100000, CallFlags.None)] | ||
private void OnPayment(ApplicationEngine engine, UInt160 from, BigInteger amount) | ||
{ | ||
if (engine.CallingScriptHash != Hash) |
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.
So, it's like "Oracle" tokens? Maybe we need to fix GAS calls to go through CallFromNativeContract
? Although it's Mint
being called here...
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.
GAS.Mint
cann't be called by contract, so we cann't call it through CallFromNativeContract
.
[ContractMethod(0_00100000, CallFlags.None)] | ||
private void OnPayment(ApplicationEngine engine, UInt160 from, BigInteger amount) | ||
{ | ||
if (engine.CallingScriptHash != GAS.Hash) |
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.
The calling scripthash couldn't be GAS.Hash
.
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.
Change CallingScriptHash
after call CallFromNativeContract
?
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.
engine.CurrentContext.GetState<ExecutionContextState>().CallingScriptHash = GAS.Hash;
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.
Or load a GAS context before call it
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.
Maybe we add a MintWithoutCallingOnPayment()
method in GAS.
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.
Just remove PostTransfer
in Mint and Burn method?
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.
take a look to Tommo-L#21
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.
But it breaks the context, a little....
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.
Just remove PostTransfer in Mint and Burn method?
But you need to fire the Transfer
event.
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.
Please take a look to #2098
Close #2093