Preliminary BurgerGov for governance token#3
Preliminary BurgerGov for governance token#3Hecate2 wants to merge 34 commits intoneoburger:mainfrom
Conversation
BurgerGov.cs
Outdated
| // DO NOT USE the prefix 0x14, because this is the key prefix for NEP-17 token account balance | ||
| [InitialValue("Nb2CHYY5wTh2ac58mTue5S3wpG6bQv5hSY", ContractParameterType.Hash160)] | ||
| private static readonly UInt160 DEFAULT_OWNER = default; | ||
| private static readonly byte PREFIX_OWNER = 0xff; |
There was a problem hiding this comment.
then PREFIX_OWNER is not necessary
BurgerGov.cs
Outdated
| [ManifestExtra("Description", "NeoBurger Governance Token")] | ||
| [SupportedStandards("NEP-17")] | ||
| [ContractPermission("*", "*")] | ||
| public class BurgerGov : Nep17Token |
There was a problem hiding this comment.
the name can be NeoBurgerGovernanceToken and the filename can be NeoBurgerGovernanceToken.cs
BurgerGov.cs
Outdated
| private static readonly byte PREFIX_VOTE = 0xc1; | ||
|
|
||
| public override byte Decimals() => 8; | ||
| public override string Symbol() => "bNEOg"; |
There was a problem hiding this comment.
the symbol can be NOBUG ("NEOBURGER".remove("er"))
BurgerGov.cs
Outdated
|
|
||
| public override byte Decimals() => 8; | ||
| public override string Symbol() => "bNEOg"; | ||
| public static UInt160 Owner() => (UInt160)Storage.Get(Storage.CurrentContext, new byte[] { PREFIX_OWNER }); |
There was a problem hiding this comment.
then Owner is not necessary
BurgerGov.cs
Outdated
|
|
||
| public static void _deploy(object data, bool update) | ||
| { | ||
| if (!update) |
There was a problem hiding this comment.
no need to add if (!update) imo
BurgerGov.cs
Outdated
|
|
||
| public static void Update(ByteString nefFile, string manifest) | ||
| { | ||
| ExecutionEngine.Assert(Runtime.CheckWitness(Owner())); |
There was a problem hiding this comment.
check witness of the dao itself
BurgerGov.cs
Outdated
|
|
||
| public static void OnNEP17Payment(UInt160 from, BigInteger amount, object data) | ||
| { | ||
| throw new System.Exception("Not implemented for now"); |
There was a problem hiding this comment.
remove this line to accept airdrop
|
readonly method can be placed above like below in public static UInt160 Strategist() => (UInt160)Storage.Get(Storage.CurrentContext, new byte[] { PREFIXSTRATEGIST }); |
|
Then we need another method in BurgerNeoGovernanceToken to check the voting result of proposals and execute the proposal? |
remove `if (!update)`; allow NEP17Payment; on-line readonly methods
i think so |
NeoBurgerGovernanceToken.cs
Outdated
| [ContractPermission("*", "*")] | ||
| public class NeoBurgerGovernanceToken : Nep17Token | ||
| { | ||
| // DO NOT USE the prefix 0x14, because this is the key prefix for NEP-17 token account balance |
There was a problem hiding this comment.
imo all the comments can be removed
|
The method |
…ed || I have invalid delegate but default delegate voted
|
Ready for further complete tests |
|
Stored proposal attributes as structs in commit f17807c. Unit-tested. |
NeoBurgerGovernanceToken.cs
Outdated
| private static readonly byte PREFIX_DEFAULT_DELEGATE = 0x82; | ||
| private static readonly byte PREFIX_DELEGATE_THRESHOLD = 0x83; | ||
| private static readonly byte PREFIX_VOTE = 0xc1; | ||
| private static readonly byte PREFIX_VOTING_PERIOD = 0xc2; |
There was a problem hiding this comment.
we can mark this one constant and upgrade the contract if needed
No description provided.