Always validate configuration values and ensure production safety by avoiding hardcoded values, implementing proper defaults, and requiring explicit configuration for production-critical settings. Configuration should be validated at runtime to prevent deployment of incorrect values.
Always validate configuration values and ensure production safety by avoiding hardcoded values, implementing proper defaults, and requiring explicit configuration for production-critical settings. Configuration should be validated at runtime to prevent deployment of incorrect values.
Key practices:
$CONTRACT_ADDRESS
instead of specific addressespath
field in the packet must be zero for staking operations. The staked token must match the governance token configured for the channel”keccak256("wasm")
vs just "wasm"
are accurateExample:
// Bad - hardcoded production address
contract_addr: "union1m87a5scxnnk83wfwapxlufzm58qe2v65985exff70z95a2yr86yq7hl08h"
// Good - configurable with validation
contract_addr: env::var("CONTRACT_ADDRESS")
.expect("CONTRACT_ADDRESS must be set for production")
This prevents production footguns and ensures configurations are explicit, validated, and safe for deployment.
Enter the URL of a public GitHub repository