Skip to content

Commit b57e856

Browse files
committed
Adjust documentation.
1 parent 0a9d752 commit b57e856

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/yul.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,11 @@ regular strings in native encoding. For code,
11241124
11251125
Above, ``Block`` refers to ``Block`` in the Yul code grammar explained in the previous chapter.
11261126

1127+
.. note::
1128+
1129+
An object with a name that ends in ``_deployed`` is treated as deployed code by the Yul optimizer.
1130+
The only consequence of this is a different gas cost heuristic in the optimizer.
1131+
11271132
.. note::
11281133

11291134
Data objects or sub-objects whose names contain a ``.`` can be defined
@@ -1172,17 +1177,17 @@ An example Yul Object is shown below:
11721177
11731178
// now return the runtime object (the currently
11741179
// executing code is the constructor code)
1175-
size := datasize("runtime")
1180+
size := datasize("Contract1_deployed")
11761181
offset := allocate(size)
11771182
// This will turn into a memory->memory copy for Ewasm and
11781183
// a codecopy for EVM
1179-
datacopy(offset, dataoffset("runtime"), size)
1184+
datacopy(offset, dataoffset("Contract1_deployed"), size)
11801185
return(offset, size)
11811186
}
11821187
11831188
data "Table2" hex"4123"
11841189
1185-
object "runtime" {
1190+
object "Contract1_deployed" {
11861191
code {
11871192
function allocate(size) -> ptr {
11881193
ptr := mload(0x40)
@@ -1204,7 +1209,7 @@ An example Yul Object is shown below:
12041209
// code here ...
12051210
}
12061211
1207-
object "runtime" {
1212+
object "Contract2_deployed" {
12081213
code {
12091214
// code here ...
12101215
}

0 commit comments

Comments
 (0)