cll-sim icon indicating copy to clipboard operation
cll-sim copied to clipboard

Examples cannot work!

Open yuzhangiot opened this issue 10 years ago • 3 comments

For example: when I am trying to ./run.py examples/escrow.py there are some errors: sim INFO RUN Test insufficient fee: sim WARNING Stopped: Insufficient fee Traceback (most recent call last): File "./run.py", line 44, in main(args.script) File "./run.py", line 38, in main simulation.run_all() File "./lib/sim.py", line 218, in run_all method() File "examples/escrow.py", line 87, in test_insufficient_fee self.run(tx, contract) File "./lib/sim.py", line 244, in run totalgas = gas.calculate_gas(contract) File "./lib/sim.py", line 387, in calculate_gas code_lines = contract.closure.split('\n') AttributeError: 'Escrow' object has no attribute 'closure'

Looks like I miss some libraries?

yuzhangiot avatar Jun 05 '15 12:06 yuzhangiot

The contracts and libraries are deprecated. The CLL language has since change into Serpent 2.0 (there is a Serpent 3.0 in the works): https://github.com/ethereum/wiki/wiki/Serpent

jorisbontje avatar Jun 05 '15 13:06 jorisbontje

Thank you very much! Although I found some mistake in version 2.0 wiki. For example: serpent get_prefix double Unknown command Usage: serpent command input Where input -s for from stdin, a file, or interpreted as serpent code if does not exist as file.where command: parse: Just parses and returns s-expression code. rewrite: Parse, use rewrite rules print s-expressions of result. compile: Return resulting compiled EVM code in hex. assemble: Return result from step before compilation.

在 2015年6月5日,下午9:59,Joris Bontje [email protected] 写道:

The contracts and libraries are deprecated. The CLL language has since change into Serpent 2.0 (there is a Serpent 3.0 in the works): https://github.com/ethereum/wiki/wiki/Serpent https://github.com/ethereum/wiki/wiki/Serpent — Reply to this email directly or view it on GitHub https://github.com/jorisbontje/cll-sim/issues/18#issuecomment-109302366.

yuzhangiot avatar Jun 06 '15 02:06 yuzhangiot

Joris, I watched your youtube video with Joel Dietz on "My first Ethereum contract: coding of escrow-multisig contract". Thanks and great work! I have a bit of a different situation for "escrow". I think escrow can also be defined as a situation where money is put up into an "escrow account" and certain conditions have to be met before it's paid out.

Let's say we have the following situation:

  • buyer and seller meet on an internet platform where you can trade patents (IP = Intellectual Property)
  • buyer agrees to purchase a patent the seller has put on the platform for price x.
  • however, before money can be exchanged, the patent office has to execute a transfer of the IP rights from the selling party to the buying party (so the seller isn't "shipping" anything to the buyer).
  • the buyer - while waiting for the patent office to do this - puts up the price of the patent with the party running the platform (in your program, this would sort of be like the "Verifier"). This is the escrow.
  • ideally, the patent office would be involved in this process and trigger that the transfer has happened (or one would program some kind of "oracle" that checks via an API what the patent office has done, if such an API exists), but let's say that the "Verifier" (party running the platform) receives this information and then triggers the next step.
  • if IP rights have been reassigned, the "Verifier" would acknowledge that and this would trigger the release of the money put up by the buyer to the seller (minus a fee to the party running the platform, i.e. the "Verifier").
  • of course, if the patent office refused the reassignment of IP rights, the "Verifier" would nullify the transaction and the buyer would get his funds back. I guess a certain time frame could be added in which this would have to happen, and if it doesn't, the whole transaction is stopped and the buyer gets his money back.

Is this something for which a smart contract can be written in Ethereum?

Thanks Chris

inventtory avatar Dec 27 '15 23:12 inventtory