mirror of
https://github.com/vacp2p/de-mls.git
synced 2026-01-09 07:08:02 -05:00
chore(sc_keystore): add interface of smart contract (#9)
* fix: makefile * chore: add interface * fix: foundry.toml * fix: add getAvailableKeyPackage
This commit is contained in:
committed by
GitHub
parent
b5683dc759
commit
c14b0a1a9f
15
Makefile
15
Makefile
@@ -1,3 +1,12 @@
|
||||
deps:
|
||||
# for the contracts
|
||||
git submodule update --init --recursive
|
||||
## ref: https://gist.github.com/enil/e4af160c745057809053329df4ba1dc2
|
||||
|
||||
GIT=git
|
||||
GIT_SUBMODULES=$(shell sed -nE 's/path = +(.+)/\1\/.git/ p' .gitmodules | paste -s -)
|
||||
|
||||
.PHONY: deps
|
||||
deps: $(GIT_SUBMODULES)
|
||||
|
||||
$(GIT_SUBMODULES): %/.git: .gitmodules
|
||||
$(GIT) submodule init
|
||||
$(GIT) submodule update $*
|
||||
@touch $@
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
optimizer_runs = 10_000
|
||||
out = "out"
|
||||
script = "script"
|
||||
solc = "0.8.19"
|
||||
solc = "0.8.24"
|
||||
src = "src"
|
||||
test = "test"
|
||||
|
||||
|
||||
20
contracts/src/IScKeystore.sol
Normal file
20
contracts/src/IScKeystore.sol
Normal file
@@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.24;
|
||||
|
||||
struct KeyPackage {
|
||||
// store serialized onchain
|
||||
bytes[] data;
|
||||
}
|
||||
|
||||
struct UserInfo {
|
||||
KeyPackage[] keyPackages;
|
||||
bytes signaturePubKey;
|
||||
}
|
||||
|
||||
interface IScKeystore {
|
||||
function userExists(address user) external view returns (bool);
|
||||
function addUser(UserInfo calldata userInfo) external;
|
||||
function getUser(address user) external view returns (UserInfo memory);
|
||||
function addKeyPackage(KeyPackage calldata) external;
|
||||
function getAvailableKeyPackage(address user) external view returns (KeyPackage memory);
|
||||
}
|
||||
Reference in New Issue
Block a user