Class: Simulacrum
- Inherits:
-
Object
show all
- Includes:
- Types
- Defined in:
- lib/soliscript/simulacrum.rb
Overview
make it an module - why? why not?
Defined Under Namespace
Classes: Block, Message, Receipt
Class Method Summary
collapse
Class Method Details
.block ⇒ Object
45
|
# File 'lib/soliscript/simulacrum.rb', line 45
def self.block() @block ||= Block.new; end
|
.msg ⇒ Object
44
|
# File 'lib/soliscript/simulacrum.rb', line 44
def self.msg() @msg ||= Message.new; end
|
.send_transaction(from:, to: Typed::ADDRESS_ZERO, data: [], value: 0) ⇒ Object
Also known as:
transact
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'lib/soliscript/simulacrum.rb', line 59
def self.send_transaction( from:,
to: Typed::ADDRESS_ZERO,
data: [],
value: 0 )
msg.sender = from
msg.value = value
Account[ from ].nonce += 1
if to == Typed::ADDRESS_ZERO && data.is_a?( Class )
klass = data
contract = klass.new
contract.constructor
Receipt.new( contract: contract )
else
contract = to
if data.empty?
contract.receive
Receipt.new
else
end
end
end
|