Skip to content

Commit

Permalink
example: add fork targets
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Nov 23, 2024
1 parent 3474954 commit 91709ed
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions example/4788asm.eas
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
;;; buflen to the timestamp's index in the first ring buffer. The sum will be
;;; the storage slot in the second ring buffer where it is stored.

#pragma fork "cancun"

;;; -----------------------------------------------------------------------------
;;; MACROS ----------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion example/4788asm_ctor.eas
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
;;; /_/ /_/\____/\____/\__,_/____/_/ /_/ /_/
;;;
;;; constructor code


#pragma fork "cancun"

push @.end - @.start ; [size]
dup1 ; [size, size]
push @.start ; [start, size, size]
Expand Down
2 changes: 2 additions & 0 deletions example/erc20/erc20.eas
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
;;; balance(address) => 0x000000000000000000000000 || address
;;; allowance(owner, spender) => keccak(owner || spender)

#pragma fork "constantinople"

#define %match(candidate, label) { ; [selector]
dup1 ; [selector, selector]
push $candidate ; [candidate, selector, selector]
Expand Down
2 changes: 2 additions & 0 deletions example/erc20/erc20_ctor.eas
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
;;; ERC20 - constructor
;;;

#pragma fork "constantinople"

pc ; [0]

;; give deployer initial supply
Expand Down

0 comments on commit 91709ed

Please sign in to comment.