forked from neo-project/neo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow smart contract verification (neo-project#1800)
* Allow sc verify * Create DeployedContract * Fix fee * Fix * Change to exceptions * Allow static variables during verification * Simplify DeployedContract * Change verify call flags * Change to ReadOnly * Add error description * Allow cosigners in makeTransaction * Verify as APPCALL * Fix fee * Revert "Fix fee" This reverts commit e8d59a9. * Revert "Verify as APPCALL" This reverts commit d8bf588. * Auto stash before revert of "Allow cosigners in makeTransaction" * None * Add comment * Fix CustomGroups * Fix UT * Update DeployedContract.cs * Optimize MakeTransaction() * Update Wallet.cs * Fix * Fix fee calculation * Optimize CalculateNetworkFee() * Try sc verification when the account it's null * Update Wallet.cs * Update Wallet.cs * Add true verify test * Update Wallet.cs * Remove check account in wallet * Fix UT Co-authored-by: erikzhang <erik@neo.org>
- Loading branch information
1 parent
d257a95
commit feb2a8e
Showing
9 changed files
with
166 additions
and
79 deletions.
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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Neo.Ledger; | ||
using Neo.SmartContract.Manifest; | ||
using System; | ||
using System.Linq; | ||
|
||
namespace Neo.SmartContract | ||
{ | ||
public class DeployedContract : Contract | ||
{ | ||
public override UInt160 ScriptHash { get; } | ||
|
||
public DeployedContract(ContractState contract) | ||
{ | ||
if (contract is null) throw new ArgumentNullException(nameof(contract)); | ||
|
||
Script = null; | ||
ScriptHash = contract.ScriptHash; | ||
ContractMethodDescriptor descriptor = contract.Manifest.Abi.GetMethod("verify"); | ||
if (descriptor is null) throw new NotSupportedException("The smart contract haven't got verify method."); | ||
|
||
ParameterList = descriptor.Parameters.Select(u => u.Type).ToArray(); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.