stratisproject / StratisBitcoinFullNode

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

Feature Request - Return Contract Hash #4184

Closed mrtpain closed 4 years ago

mrtpain commented 4 years ago

When hitting /api/SmartContracts/code it would be nice to also return the hash alongside the bytecode for the contract.

Example use case A frontend app that only allows whitelisted contracts for security purposes. Better to check against a whitelist of hashes hashes rather than bytecode.

Specific use case Stratis Swap pulls in contract addresses for orders from an orderbook (smart contract) that anyone can publish a record too. When the orderbook is pulled in, it will validate the orders and make sure their bytecode (hopefully soon hash) is whitelisted. This protects traders from making trades against potential malicious contracts in the orderbook that have a matching interface to the Stratis Swap order contracts.