How smart contract functions *really* work