-
Notifications
You must be signed in to change notification settings - Fork 118
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
Update arc-0200.md #253
Update arc-0200.md #253
Conversation
Fixed typo: bytes -> byte Propose changing arc200_decimals return type to uint64 for improved compatibility with reachc that may not have uint8 type exposed to smart contract developer.
* Update return type for transfer, transferFrom, approve
Describe what byte return value for non-readonly methods should be
Describe decimals method return value
Can you give more explanation on why you want to |
What does this mean?
uint8 is the ABI type. If you have a number between 0 and 255, you can use |
Three reasons:
1) The return value is trivial, on success it returns true otherwise fails
2) Simulator can be used desired result
3) Reach compiled contract does not allow return type of bool but instead
uses bytes between 0 and 1 (May be available later)
2023年10月24日(火) 2:49 Stéphane ***@***.***>:
… Seems to be some good improvement. Just, can you give more explanation on
why you want to Change return type of transfer, transferFrom, approve
from bool to void?
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQ4AW4OTZA26IX3ODDLDTTYA56JFAVCNFSM6AAAAAA6KLYD6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZWG44DOOJWGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Reach compiled smart contract does not allow for return type of uint8, only
uint64 and uint256. I assumed it would work but it appears it doesn't. This
may change in the near future.
If push comes to shove I might be able to experimentally modify the
resulting teal program to:
1) Update the selectors to include uint8 instead of uint64
2) Produce a uint8 from uint64
by hand
2023年10月24日(火) 6:52 John Jannotti ***@***.***>:
… What does this mean?
compiled smart contracts that do not have uint8 available
uint8 is the ABI type. If you have a number between 0 and 255, you can use itob;
extract 7 0 to produce a single byte as an ABI uint8.
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQ4AWYT3SD4YGVCF5X6LCTYA62YBAVCNFSM6AAAAAA6KLYD6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZXGE2DOMBVHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I may be able do the same things here as the case of uint8 but it would be
by hand
2023年10月24日(火) 2:49 Stéphane ***@***.***>:
… Seems to be some good improvement. Just, can you give more explanation on
why you want to Change return type of transfer, transferFrom, approve
from bool to void?
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQ4AW4OTZA26IX3ODDLDTTYA56JFAVCNFSM6AAAAAA6KLYD6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZWG44DOOJWGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sry this is outdated. I considered void but changed it to byte afterwords. My mistake for not noticing. |
It should be less than it equal to 256. This is because type uint256 is used. I’ll fix this mistake soon.
…Sent from my iPhone
On Oct 26, 2023, at 12:57 AM, Stéphane ***@***.***> wrote:
@SudoWeezy commented on this pull request.
In ARCs/arc-0200.md:
> The methods `arc200_transfer` and `arc200_transferFrom` MUST emit a `Transfer` event.
A `arc200_Transfer` event SHOULD be emitted, with `from` being the zero address, when a token is minted.
A `arc200_Transfer` event SHOULD be emitted, with `to` being the zero address, when a token is destroyed.
The `arc200_Approval` event MUST be emitted when an `arc200_approve` or `arc200_transferFrom` method is called successfully.
+The methods `arc200_transfer` `arc200_transferFrom`, and `arc200_approve` SHOULD return byte `1` on success and byte `0` on failure.
+
+The method `arc200_decimals` SHOULD return a value less than or greater than uint64 `256`
I don't understand this line. Why should it be Less OR Greater than uint64 256?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Fix description of decimals
For interoperability, I would keep bool & uint8. Changing the standard based on Reach implementation of things is not right. How do you handle https://github.com/ethereum/ercs/blob/master/ERCS/erc-20.md tokens? Do you also return bytes & uint64? |
Thank you for the advice. I may be able to use this. |
For sure. I'll figure something out. |
@SudoWeezy @jannotti I have retract proposed abi changes that will not move forward. Kindly accept changes in this PR as they address known issues, there is a type in the abi. Thx! |
Work great. Thanks for the tip! @jannotti |
@jannotti any tip on how I might return a
Last byte is 1 indicating success.
Use
|
I believe that will work. I think a single bool would be encoded exactly the same way a byte would be. |
Okay. I’ll give it a try. Thanks!
…Sent from my iPhone
On Oct 30, 2023, at 10:14 AM, John Jannotti ***@***.***> wrote:
I believe that will work. I think a single bool would be encoded exactly the same way a byte would be.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Thanks @jannotti it just works |
Lines 42, 45:
Fixed typo: bytes -> byte
Line 56:
Propose changing arc200_decimals return type to uint64 for improved compatibility with compiled smart contracts that do not have uint8 available
Change return type of transfer, transferFrom, approve from bool to byte
Describe what non-readonly methods return values should be.
Describe decimals return value