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:
Aaryamann Challani
2024-06-26 15:26:02 +05:30
committed by GitHub
parent b5683dc759
commit c14b0a1a9f
3 changed files with 33 additions and 4 deletions

View File

@@ -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 $@

View File

@@ -13,7 +13,7 @@
optimizer_runs = 10_000
out = "out"
script = "script"
solc = "0.8.19"
solc = "0.8.24"
src = "src"
test = "test"

View 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);
}