-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
What's changed: - Switch to the deployment information of Omnilock - args: append 00. It is the omni lock flag byte, which indicate there's no advanced omni lock features been used. - `WitnessArgs.lock` size: 65 to 85, this is the size of a `OmnilockWitnessLock` to only save a 65-byte signature. - witness: instead of storing the 65-byte signature directly into `WitnessArgs.lock`, pack it into a `OmnilockWitnessLock`. Omnilock Contract Error Codes For Reference: - 8: args format is wrong - 5: `WitnessArgs.lock` is not a valid `OmnilockWitnessLock` [An example deposit in testnet](https://pudge.explorer.nervos.org/transaction/0x7bc9bd9a60852bf85d7142041867fb3d92b44a0d5821835fef9b1978442e84c0) Omnilock info: | parameter | value | | ----------- | -------------------------------------------------------------------- | | `code_hash` | 0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb | | `hash_type` | `type` | | `tx_hash` | 0xff234bf2fb0ad2ab5b356ceda317d3dee3efb2c55b9427ef55d9dcbf6eecbf9f | | `index` | `0x0` | | `dep_type` | `code` | Related PRs: nervosnetwork/ckb-production-scripts#75 Closes #12
- Loading branch information
Showing
19 changed files
with
107 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -u | ||
[ -n "${DEBUG:-}" ] && set -x || true | ||
|
||
ckb-cli wallet transfer --skip-check-to-address --to-address "$1" --capacity 300000 --privkey-path specs/miner.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[[cells]] | ||
name = "omnilock" | ||
enable_type_id = true | ||
location = { file = "build/release/omnilock" } | ||
|
||
# The lock script set to output cells | ||
[lock] | ||
code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" | ||
args = "0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d7" | ||
hash_type = "type" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { blockchain } from "@ckb-lumos/base"; | ||
import { createFixedBytesCodec, molecule } from "@ckb-lumos/codec"; | ||
const { table } = molecule; | ||
const { BytesOpt } = blockchain; | ||
|
||
const NullCodec = createFixedBytesCodec({ | ||
pack: () => new Uint8Array(0), | ||
unpack: () => null, | ||
byteLength: 0, | ||
}); | ||
|
||
export const OmnilockWitnessLock = table( | ||
{ | ||
signature: BytesOpt, | ||
|
||
// Fields not used in PoC | ||
omniIdentity: NullCodec, | ||
preimage: NullCodec, | ||
}, | ||
["signature", "omniIdentity", "preimage"], | ||
); | ||
|
||
export function packOmnilockWitnessLock(signature) { | ||
return OmnilockWitnessLock.pack({ | ||
signature, | ||
omniIdentity: null, | ||
preimage: null, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters