mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
18 lines
435 B
Plaintext
18 lines
435 B
Plaintext
|
object "MyContract" {
|
||
|
code {
|
||
|
// this is the constructor.
|
||
|
// store the creator in the first storage slot
|
||
|
sstore(0, caller())
|
||
|
// now return the runtime code using the special functions
|
||
|
datacopy(0, dataoffset("Runtime"), datasize("Runtime"))
|
||
|
return(0, datasize("Runtime"))
|
||
|
}
|
||
|
object "Runtime" {
|
||
|
code {
|
||
|
// runtime - just return the creator
|
||
|
mstore(0, sload(0))
|
||
|
return(0, 0x20)
|
||
|
}
|
||
|
}
|
||
|
}
|