stratisproject / StratisBitcoinFullNode

Bitcoin full node in C#
https://stratisplatform.com
MIT License
788 stars 312 forks source link

Deployment of smart contract without mandatory parameters should fail #1413

Closed slugmandrew closed 6 years ago

slugmandrew commented 6 years ago

Error Report

Using the Auction.cs template I ran the following command, which omitted the constructor arguments (--params 10#20) at the end:

C:\Users\Drew\source\repos\StratisBitcoinFullNode\src\Stratis.SmartContracts.Tools.Sct>dotnet run -- deploy C:\Users\Drew\source\repos\SmartContract1\SmartContract1\SmartContract1\Auction.cs http://localhost:38220 -wallet slugmandrew -password slugpass -fee 0.002 -sender=moLVhp3UUV1pDUg58XJGapQc62knafaGew

This resulted in the following output:

Using launch settings from C:\Users\Drew\source\repos\StratisBitcoinFullNode\src\Stratis.SmartContracts.Tools.Sct\Properties\launchSettings.json...
Smart Contract Deployer
Reading C:\Users\Drew\source\repos\SmartContract1\SmartContract1\SmartContract1\Auction.cs
Read C:\Users\Drew\source\repos\SmartContract1\SmartContract1\SmartContract1\Auction.cs OK
Compiling...
Compilation OK
Building ModuleDefinition
ModuleDefinition built successfully
Validating file C:\Users\Drew\source\repos\SmartContract1\SmartContract1\SmartContract1\Auction.cs...
Deploying to node

Deployment Success!
Contract Address: n3T9jT4mekdGamXqEDGKN7ps14qJ2ofE8H

However, the smart contract has clearly not been created, as http://localhost:38220/api/SmartContracts/code?address=n3T9jT4mekdGamXqEDGKN7ps14qJ2ofE8H reports there is no code at this address.

When previously validating the smart contract before deployment, it passed OK.

Docs Suggestion

I would say this section of the docs could be made clearer, as the first chunk of code clearly shows the command lacking the --params bit at the end:

image

fassadlr commented 6 years ago

Thank you @slugmandrew! This issue is now resolved.