Skip to content

Commit

Permalink
feat: add cell and header uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
liyukun committed Nov 4, 2023
1 parent 3ae4ae2 commit b31197e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contracts/core/25-handler/CellEmitterHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ abstract contract CellEmitterHandler {
) external {
emit RemoveCellEmitterFilter(filter);
}

// FIXME: add authticate attribute
function upload_ckb_cell(CellEmitter.Cell calldata cell) external {
// TODO: call system contract
}

// FIXME: add authticate attribute
function upload_ckb_header(CellEmitter.Header calldata header) external {
// TODO: call system contract
}
}
19 changes: 19 additions & 0 deletions contracts/proto/CellEmitter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
pragma solidity ^0.8.9;

library CellEmitter {
struct Cell {
uint64 capacity;
bytes data;
Script lockScript;
Script[] typeScript;
}

struct Header {
uint32 version;
uint32 compactTarget;
uint64 timestamp;
uint64 number;
uint64 epoch;
bytes32 parentHash;
bytes32 extraHash;
bytes32 dao;
uint128 nonce;
}

struct SearchKey {
Script script;
ScriptType scriptType;
Expand Down

0 comments on commit b31197e

Please sign in to comment.