Skip to content

Commit

Permalink
TVM Upgrade 2024.04 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusarich authored Jun 9, 2024
1 parent 1031802 commit 3297390
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- All new opcodes from TVM Upgrade `2023.07`: PR [#7](https://github.com/tact-lang/ton-opcode/pull/7)
- All new opcodes from TVM Upgrade `2024.04`: PR [#12](https://github.com/tact-lang/ton-opcode/pull/12)

## [0.0.14] - 2023-09-05

Expand Down
26 changes: 25 additions & 1 deletion reference/opcodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -780,4 +780,28 @@ opcodes:
RUNVMX:

# Sending messages
SENDMSG:
SENDMSG:

# TVM Upgrade 2024.04
# Opcodes to work with new c7 values
UNPACKEDCONFIGTUPLE:
DUEPAYMENT:
# GLOBALID:
# SENDMSG:

# Opcodes to process config parameters
# GETGASFEE:
GETSTORAGEFEE:
# GETFORWARDFEE:
GETPRECOMPILEDGAS:
GETORIGINALFWDFEE:
GETGASFEESIMPLE:
GETFORWARDFEESIMPLE:

# Cell level operations
CLEVEL:
CLEVELMASK:
CHASHI: ["int"]
CDEPTHI: ["int"]
CHASHIX:
CDEPTHIX:
17 changes: 15 additions & 2 deletions src/codepage/opcodes.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ export type OpCodeWithArgs =
| { code: 'DEBUG', args: [number] }
| { code: 'DEBUGSTR', args: [string] }
| { code: 'SETCP', args: [number] }
| { code: 'RUNVM', args: [number] };
| { code: 'RUNVM', args: [number] }
| { code: 'CHASHI', args: [number] }
| { code: 'CDEPTHI', args: [number] };

export function isOpCodeWithArgs(op: OpCode): op is OpCodeWithArgs {
return Array.isArray((op as any).args) && ((op as any).args.length > 0);
Expand Down Expand Up @@ -663,6 +665,17 @@ export type OpCodeNoArgs =
| { code: 'BLS_PAIRING' }
| { code: 'BLS_PUSHR' }
| { code: 'RUNVMX' }
| { code: 'SENDMSG' };
| { code: 'SENDMSG' }
| { code: 'UNPACKEDCONFIGTUPLE' }
| { code: 'DUEPAYMENT' }
| { code: 'GETSTORAGEFEE' }
| { code: 'GETPRECOMPILEDGAS' }
| { code: 'GETORIGINALFWDFEE' }
| { code: 'GETGASFEESIMPLE' }
| { code: 'GETFORWARDFEESIMPLE' }
| { code: 'CLEVEL' }
| { code: 'CLEVELMASK' }
| { code: 'CHASHIX' }
| { code: 'CDEPTHIX' };

export type OpCode = OpCodeWithArgs | OpCodeNoArgs;
17 changes: 17 additions & 0 deletions src/codepage/opcodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,18 @@ CP0Auto.insertHex('d762', 16, { code: 'LDSAME' });
// 14115584 (DUMMY)
CP0Auto.insertHex('d764', 16, { code: 'SDEPTH' });
CP0Auto.insertHex('d765', 16, { code: 'CDEPTH' });
CP0Auto.insertHex('d766', 16, { code: 'CLEVEL' });
CP0Auto.insertHex('d767', 16, { code: 'CLEVELMASK' });
CP0Auto.insertHex('d76a', 16, (slice) => {
let i = slice.loadUint(2);
return { code: 'CHASHI', args: [i] };
});
CP0Auto.insertHex('d76e', 16, (slice) => {
let i = slice.loadUint(2);
return { code: 'CDEPTHI', args: [i] };
});
CP0Auto.insertHex('d770', 16, { code: 'CHASHIX' });
CP0Auto.insertHex('d771', 16, { code: 'CDEPTHIX' });
// 14116352 (DUMMY)
CP0Auto.insertHex('d8', 8, { code: 'EXECUTE' });
CP0Auto.insertHex('d9', 8, { code: 'JMPX' });
Expand Down Expand Up @@ -1131,6 +1143,11 @@ CP0Auto.insertHex('f833', 16, { code: 'CONFIGOPTPARAM' });
CP0Auto.insertHex('F83400', 24, { code: 'PREVMCBLOCKS' });
CP0Auto.insertHex('F83401', 24, { code: 'PREVKEYBLOCK' });
CP0Auto.insertHex('F835', 16, { code: 'GLOBALID' });
CP0Auto.insertHex('F837', 16, { code: 'GETSTORAGEFEE' });
CP0Auto.insertHex('F839', 16, { code: 'GETPRECOMPILEDGAS' });
CP0Auto.insertHex('F83A', 16, { code: 'GETORIGINALFWDFEE' });
CP0Auto.insertHex('F83B', 16, { code: 'GETGASFEESIMPLE' });
CP0Auto.insertHex('F83C', 16, { code: 'GETFORWARDFEESIMPLE' });
CP0Auto.insertHex('f841', 11, (slice) => {
let i = slice.loadUint(5);
return { code: `GETGLOBVAR`, args: [i] };
Expand Down

0 comments on commit 3297390

Please sign in to comment.