-
Notifications
You must be signed in to change notification settings - Fork 103
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 code assist for native contract. #289
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,128 @@ | ||
using System.Numerics; | ||
|
||
namespace Neo.SmartContract.Framework.Services.Neo | ||
{ | ||
public class Native | ||
{ | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern object NEO(string method, object[] arguments); | ||
public class NEO | ||
{ | ||
/// <param name="method">Please input "name"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern string Name(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "symbol"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern string Symbol(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "decimals"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern int Decimals(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "totalSupply"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern BigInteger TotalSupply(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "BalanceOf"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern BigInteger BalanceOf(string method, byte[] scriptHash); | ||
|
||
/// <param name="method">Please input "Transfer"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern bool Transfer(string method, byte[] from, byte[] to, BigInteger amount); | ||
|
||
/// <param name="method">Please input "RegisterCandidate"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern bool RegisterCandidate(string method, byte[] publicKey); | ||
|
||
/// <param name="method">Please input "UnregisterCandidate"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern bool UnregisterCandidate(string method, byte[] publicKey); | ||
|
||
/// <param name="method">Please input "Vote"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern bool Vote(string method, byte[] scriptHash, byte[][] candidatePublicKey); | ||
|
||
/// <param name="method">Please input "GetValidators"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern byte[][] GetValidators(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "GetCandidates"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern byte[][] GetCandidates(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "GetCommittee"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern byte[][] GetCommittee(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "GetNextBlockValidators"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern byte[][] GetNextBlockValidators(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "UnclaimedGas"</param> | ||
[Appcall("0xde5f57d430d3dece511cf975a8d37848cb9e0525")] | ||
public static extern BigInteger UnclaimedGas(string method, byte[] scriptHash, uint endBlockIndex); | ||
} | ||
|
||
public class GAS | ||
{ | ||
/// <param name="method">Please input "name"</param> | ||
[Appcall("0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc")] | ||
public static extern string Name(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "symbol"</param> | ||
[Appcall("0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc")] | ||
public static extern string Symbol(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "decimals"</param> | ||
[Appcall("0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc")] | ||
public static extern int Decimals(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "totalSupply"</param> | ||
[Appcall("0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc")] | ||
public static extern BigInteger TotalSupply(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "BalanceOf"</param> | ||
[Appcall("0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc")] | ||
public static extern BigInteger BalanceOf(string method, byte[] scriptHash); | ||
|
||
/// <param name="method">Please input "Transfer"</param> | ||
[Appcall("0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc")] | ||
public static extern bool Transfer(string method, byte[] from, byte[] to, BigInteger amount); | ||
} | ||
|
||
public class Policy | ||
{ | ||
/// <param name="method">Please input "GetMaxTransactionsPerBlock"</param> | ||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern BigInteger GetMaxTransactionsPerBlock(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "deGetFeePerBytecimals"</param> | ||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern BigInteger GetFeePerByte(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "GetBlockedAccounts"</param> | ||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern byte[][] GetBlockedAccounts(string method, object[] arguments); | ||
|
||
/// <param name="method">Please input "SetMaxBlockSize"</param> | ||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern bool SetMaxBlockSize(string method, BigInteger maxBlockSize); | ||
|
||
/// <param name="method">Please input "SetMaxTransactionsPerBlock"</param> | ||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern bool SetMaxTransactionsPerBlock(string method, BigInteger maxTransactionsPerBlock); | ||
|
||
/// <param name="method">Please input "SetFeePerByte"</param> | ||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern bool SetFeePerByte(string method, BigInteger feePerByte); | ||
|
||
[Appcall("0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc")] | ||
public static extern object GAS(string method, object[] arguments); | ||
/// <param name="method">Please input "BlockAccount"</param> | ||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern bool BlockAccount(string method, byte[] scriptHash); | ||
|
||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern object Policy(string method, object[] arguments); | ||
/// <param name="method">Please input "UnblockAccount"</param> | ||
[Appcall("0xce06595079cd69583126dbfd1d2e25cca74cffe9")] | ||
public static extern bool UnblockAccount(string method, byte[] scriptHash); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add descriptions please