Programmable smart contracts