Skip to content

Commit

Permalink
Merge branch 'cc@contract0.3.2' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
rueshyna committed Nov 2, 2023
2 parents 409fecb + c710882 commit cde0f57
Show file tree
Hide file tree
Showing 10 changed files with 1,617 additions and 726 deletions.
12 changes: 6 additions & 6 deletions context/generateLambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function generateFA2Michelson(
) {
if (params.length === 0) throw new Error("Empty fa2 params");

if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
return `{
DROP;
NIL operation ;
Expand Down Expand Up @@ -87,7 +87,7 @@ export function generateFA1_2ApproveMichelson(
version: version,
{ spenderAddress, amount, fa1_2Address }: approve
) {
if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
return `{
DROP ;
NIL operation ;
Expand Down Expand Up @@ -118,7 +118,7 @@ export function generateFA1_2TransferMichelson(
version: version,
{ walletAddress, targetAddress, amount, fa1_2Address }: transfer
) {
if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
return `{
DROP ;
NIL operation ;
Expand Down Expand Up @@ -154,7 +154,7 @@ export function generateExecuteContractMichelson(
michelsonEntrypoint = `%${entrypoint}`;
}

if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
return `{
DROP;
NIL operation ;
Expand Down Expand Up @@ -185,7 +185,7 @@ export function generateDelegateMichelson(
version: version,
{ bakerAddress }: { bakerAddress: string }
) {
if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
return `{
DROP ;
NIL operation ;
Expand All @@ -207,7 +207,7 @@ export function generateDelegateMichelson(
}

export function generateUndelegateMichelson(version: version) {
if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
return `{
DROP ;
NIL operation ;
Expand Down
3 changes: 3 additions & 0 deletions context/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const dispatch: { [key: string]: version } = {
"0.1.1": "0.1.1",
"0.3.0": "0.3.0",
"0.3.1": "0.3.1",
"0.3.2": "0.3.2",
};

// Those values are from tzkt api: /v1/contracts
Expand All @@ -32,6 +33,7 @@ const HASHES: { [k in version]: `${typeHash}:${codeHash}` | undefined } = {
"0.1.1": "-483287042:-426350137",
"0.3.0": "-933474574:1358594366",
"0.3.1": "1576695458:46756700",
"0.3.2": "66001562:-1892417854",
"unknown version": undefined,
};

Expand All @@ -42,6 +44,7 @@ const VERSION_HASH: { [k: `${typeHash}:${codeHash}`]: version } = {
[HASHES["0.1.1"]!]: "0.1.1",
[HASHES["0.3.0"]!]: "0.3.0",
[HASHES["0.3.1"]!]: "0.3.1",
[HASHES["0.3.2"]!]: "0.3.2",
};

async function fetchVersion(
Expand Down
2 changes: 1 addition & 1 deletion context/metadata_blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let meta = {
name: "TzSafe",
description:
"TzSafe is a multisig wallet aiming at providing better assurance of security and management of ownership than a traditional single-signed wallet",
version: "0.3.1",
version: "0.3.2",
license: {
name: "MIT",
},
Expand Down
6 changes: 3 additions & 3 deletions context/parseLambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const parseDelegate = (
):
| [true, LambdaType, { address: string } | undefined]
| [false, undefined, undefined] => {
if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
const delegate_instr_size = 6;

if (lambda.length != delegate_instr_size)
Expand Down Expand Up @@ -237,7 +237,7 @@ const parseUnDelegate = (
version: version,
lambda: Expr[]
): [true, LambdaType] | [false, undefined] => {
if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
const undelegate_instr_size = 5;

if (lambda.length != undelegate_instr_size) return [false, undefined];
Expand Down Expand Up @@ -335,7 +335,7 @@ export const parseLambda = (
}
}

if (version === "0.3.1") {
if (version === "0.3.1" || version === "0.3.2") {
const contract_execution_instr_size = 9;

if (lambda.length != contract_execution_instr_size)
Expand Down
Loading

0 comments on commit cde0f57

Please sign in to comment.