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.
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.