1

I have searched online about this, but I can't seem to find a real answer.

Say someone sends a smart contract to some address. What if the receiver does not want to accept that contract? How do they "deny" the contract or prevent it from executing?

For example, in financial derivatives, a trade for a call option is agreed upon between two parties. If the buyer initiates the contract with the wrong strike price, what stops the counterparty from being forced to accept that price?

2 Answers 2

2

You cannot "send a contract to someone". You can deploy a contract on the blockchain, but people have to interact with the contract from their account in order for the contract to affect them. The only thing you can do without the consent of the receiving party is to send them ether, but then you're just throwing away your money.

6
  • How does the receiver know that the data in the contract is correct before interacting with it?
    – Kevin K.
    Aug 31, 2017 at 14:38
  • If I'm not mistaken, you can actually override the default behaviour of payment and throw in a receiving contract to block a payment. Also, a contract can affect a user not party to it. I could write (if I knew how to write contracts) an ERC20 token contract representing shares in a real world organization and initialize a set of shareholders. An individual, named as an owner (via acnt) can, in theory, get a loan from someone using the tokens as collateral without interacting with the contract. You could even give a debt to a user in the token. Thus, I think 2/3 statements above aren't true.
    – lungj
    Aug 31, 2017 at 21:39
  • (Also, I realize the second example breaks out into the physical world, but it is a reason why one party might like to deny the validity of a contract without having interacted with it online)
    – lungj
    Aug 31, 2017 at 21:45
  • @lungj I was referring to user accounts as opposed to contracts. AFAIK you cannot prevent someone from sending ether to a personal account (i.e. an account that has no code associated to it.) Not that there would be any reason for you to do so. And sure, someone can assign you random ERC20 tokens, but if you don't act on it they are just going to sit there. You can prove you were never involved in them. And you certainly cannot "give a debt" to someone. My answer was intended to reassure the OP as I understood he was worried of being involved in some transactions against his will.
    – manuhalo
    Aug 31, 2017 at 22:12
  • I think you're right - you can't prevent someone from sending ether to an account. However, I can think of a reason for you to do so: if you have a strict KYC policy, you wouldn't want to accept ether from all users and you wouldn't want to pay for gas out of pocket to refund the amount. Upon rereading OP's question, I think your interpretation is better than the one I had before; I thought the recipient was being an aggressor, not a victim. (Also, you can give debt to someone via blckchn. You can do a lot of things in legal contracts. Whether or not they're enforceable is another question.)
    – lungj
    Aug 31, 2017 at 22:51
1

(I assume by "sends a smart contract to some address", you mean "calls a contract at some address") Suppose two accounts, A and B, both have 10 ether in them. If someone calls a function in a smart contract according to the rules of Ethereum that, say, moves 1 ether from account A to account B, then everyone who follows the Ethereum rules will agree that account A now has 9 ether and account B has 11. If someone were to ignore the function call making the transfer, they would still think that account A has 10 ether and account B has 10.

This is fundamentally no different from the owner of account A simply modifying their Ethereum client to credit account A with a million ether out of thin air. The result is that account A has a different subjective reality than everyone else.

Why does this matter? Imagine if I, alone, believed that Canadian dollars (CAD) were on par with US dollars (USD) and I went to a US restaurant and paid with CAD at par value. The result, as you'd expect, is that the restaurant wouldn't accept my payment. The result would be very different if the restaurant also believed USD=CAD. Then they'd accept my payment, but no one else would accept our CAD on par. So this is a strong disincentive for the restaurant to believe that USD=CAD -- that nobody other than me would have that belief. They are strongly motivated to go with whatever the majority of people believe because that, all else equal, gives them the most utility for their CAD and USD. For any bounded rational thinker, this is also true. Thus, you would expect everyone to converge on one unified belief in the value of USD and CAD out of selfish reasons. See also this question for why a particular value for CAD and USD can be converged upon.

3
  • So if account B ignores the function call, how does account A get notified that the function was not called? And how does the rest of the blockchain know that the function was not called by account B and that the funds were never transferred?
    – Kevin K.
    Aug 31, 2017 at 14:29
  • It's not an account that can decide to change the record of balance, it's the Ethereum nodes. In the above, I assume that the owner of each account runs their own node. Imagine that every node is a bookkeeper. I can yell out "transfer 1 ether from account A (which I control) to account B if account A has more than 3 ethers." That is a function call being broadcast to the network. And, because I, in this example, control account A, I have authorization to do this transfer.
    – lungj
    Aug 31, 2017 at 14:39
  • Sure, one bookkeeper could choose to ignore the fact that I yelled it out, but now that bookkeeper's books are wrong (when viewed from the perspective of everyone else). If I yelled out "add a million ether to account A", that is not permitted by the rules of Ethereum and only a corrupt bookkeeper (such as one that I control) would record that transaction. But if I tried to spend any of that (assuming I didn't already legitimately have a million ether), other bookkeepers would say, "hey, wait up! you can't do that!" And anyone asking their bookkeepers if they received payment would hear "no".
    – lungj
    Aug 31, 2017 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.