@layerzerolabs/onesig-core 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -75,14 +75,16 @@ function encodeLeafHeader({ targetOneSigAddress, oneSigId, nonce }) {
|
|
|
75
75
|
if (targetOneSigAddress.byteLength !== 32) {
|
|
76
76
|
throw new Error("Contract address must be 32 bytes");
|
|
77
77
|
}
|
|
78
|
-
const storage = Buffer.alloc(
|
|
78
|
+
const storage = Buffer.alloc(73);
|
|
79
79
|
storage[0] = 1;
|
|
80
|
-
const idStr = oneSigId.toString(16).padStart(
|
|
80
|
+
const idStr = oneSigId.toString(16).padStart(16, "0");
|
|
81
81
|
const nonceStr = nonce.toString(16).padStart(64, "0");
|
|
82
82
|
for (let i = 0; i < 32; i++) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
if (i < 8) {
|
|
84
|
+
storage[i + 1] = readByteFromHex(idStr, i);
|
|
85
|
+
}
|
|
86
|
+
storage[i + 9] = targetOneSigAddress[i];
|
|
87
|
+
storage[i + 41] = readByteFromHex(nonceStr, i);
|
|
86
88
|
}
|
|
87
89
|
return storage;
|
|
88
90
|
}
|