Smart contracts are one of the six core technologies of blockchain and an important cornerstone of future digital civilization. A smart contract based on blockchain takes the strangers’ social point-to-point technology as the trust environment, and can be automatically executed once the set conditions are met. When a smart contract in the virtual world interacts with subjects and things in the real society, the smart contract becomes a legal contract. However, as a string of codes, which are automatically executed by a computer system, smart contracts make traditional contract law facing huge challenges: smart contracts cannot be modified and terminated; anonymity, standard form of terms and computer language are not easy to identify, which may lead to inconsistent meaning and expression of the parties, and legal effect evaluation is also difficult to function; even though the smart contract is technically capable of “pre-prevention”, it is difficult to completely exclude the possibility that the smart contract is attacked and the rights of the parties are damaged, but rights ex post remedy cannot play a role. The basic logic to solve the conflict between the technical rules of the smart contract in virtual world and the legal system of the real society contract should be that the virtual world provides a technical platform for the implementation of the law of contract, and the legal system of contract should add the wings of technology into the virtual world.