mirror of
https://github.com/vacp2p/de-mls.git
synced 2026-01-09 15:18:00 -05:00
fix(contract): convert to acl (#25)
* fix(contract): make implementation only an ACL * chore: bindings
This commit is contained in:
committed by
GitHub
parent
f819a58493
commit
d473de2f11
@@ -1,14 +1,10 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.24;
|
||||
|
||||
struct UserInfo {
|
||||
bytes signaturePubKey;
|
||||
}
|
||||
|
||||
interface IScKeystore {
|
||||
function userExists(address user) external view returns (bool);
|
||||
|
||||
function addUser(address user, bytes calldata signaturePubKey) external;
|
||||
function addUser(address user) external;
|
||||
|
||||
function getUser(address user) external view returns (UserInfo memory);
|
||||
function removeUser(address user) external;
|
||||
}
|
||||
|
||||
@@ -2,33 +2,34 @@
|
||||
pragma solidity 0.8.24;
|
||||
|
||||
import { Ownable } from "Openzeppelin/access/Ownable.sol";
|
||||
import { IScKeystore, UserInfo } from "./IScKeystore.sol";
|
||||
import { IScKeystore } from "./IScKeystore.sol";
|
||||
|
||||
error UserAlreadyExists();
|
||||
error MalformedUserInfo();
|
||||
error UserDoesNotExist();
|
||||
|
||||
contract ScKeystore is Ownable, IScKeystore {
|
||||
event UserAdded(address user, bytes signaturePubKey);
|
||||
event UserAdded(address user);
|
||||
event UserRemoved(address user);
|
||||
|
||||
mapping(address user => UserInfo userInfo) private users;
|
||||
mapping(address user => bool exists) private users;
|
||||
|
||||
constructor(address initialOwner) Ownable(initialOwner) { }
|
||||
|
||||
function userExists(address user) public view returns (bool) {
|
||||
return users[user].signaturePubKey.length > 0;
|
||||
}
|
||||
|
||||
function addUser(address user, bytes calldata signaturePubKey) external onlyOwner {
|
||||
if (signaturePubKey.length == 0) revert MalformedUserInfo();
|
||||
if (userExists(user)) revert UserAlreadyExists();
|
||||
|
||||
users[user] = UserInfo(signaturePubKey);
|
||||
|
||||
emit UserAdded(user, signaturePubKey);
|
||||
}
|
||||
|
||||
function getUser(address user) external view returns (UserInfo memory) {
|
||||
return users[user];
|
||||
}
|
||||
|
||||
function addUser(address user) external onlyOwner {
|
||||
if (userExists(user)) revert UserAlreadyExists();
|
||||
|
||||
users[user] = true;
|
||||
|
||||
emit UserAdded(user);
|
||||
}
|
||||
|
||||
function removeUser(address user) external onlyOwner {
|
||||
if (!userExists(user)) revert UserDoesNotExist();
|
||||
users[user] == false;
|
||||
emit UserRemoved(user);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ contract ScKeystoreTest is Test {
|
||||
}
|
||||
|
||||
function addUser() internal {
|
||||
s.addUser(address(this), "0x");
|
||||
s.addUser(address(this));
|
||||
}
|
||||
|
||||
function test__owner() public view {
|
||||
@@ -29,11 +29,6 @@ contract ScKeystoreTest is Test {
|
||||
assert(!s.userExists(address(this)));
|
||||
}
|
||||
|
||||
function test__addUser__reverts__whenUserInfoIsMalformed() public {
|
||||
vm.expectRevert(MalformedUserInfo.selector);
|
||||
s.addUser(address(this), "");
|
||||
}
|
||||
|
||||
function test__addUser__reverts__whenUserAlreadyExists() public {
|
||||
addUser();
|
||||
vm.expectRevert(UserAlreadyExists.selector);
|
||||
@@ -52,9 +47,13 @@ contract ScKeystoreTest is Test {
|
||||
vm.stopPrank();
|
||||
}
|
||||
|
||||
function test__getUser__returnsUserInfo__whenUserExists() public {
|
||||
function test__removeUser__reverts__whenUserDoesNotExist() public {
|
||||
vm.expectRevert();
|
||||
s.removeUser(address(0));
|
||||
}
|
||||
|
||||
function test__removeUser() public {
|
||||
addUser();
|
||||
UserInfo memory userInfo = s.getUser(address(this));
|
||||
assert(userInfo.signaturePubKey.length == 2);
|
||||
s.removeUser(address(this));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ pub mod Context {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -29,7 +28,6 @@ pub mod Context {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -114,7 +114,6 @@ pub mod DeploymentConfig {
|
||||
///0x6080604052600c805462ff00ff19166201000117905534801561002157600080fd5b50604051610223380380610223833981016040819052610040916100f0565b6001600160a01b0381166100675760405163201616d160e21b815260040160405180910390fd5b600e80546001600160a01b0319166001600160a01b03831617905546617a69036100cb57604080516020808201835260009091528151908101909152600e546001600160a01b031690819052600d80546001600160a01b03191690911790556100ea565b604051630b13dbff60e01b815246600482015260240160405180910390fd5b50610120565b60006020828403121561010257600080fd5b81516001600160a01b038116811461011957600080fd5b9392505050565b60f58061012e6000396000f3fe6080604052348015600f57600080fd5b506004361060465760003560e01c806312900da814604b578063d7b6574514608f578063f8a8fd6d1460d2578063f8ccbf471460d4575b600080fd5b6040805160208082018352600090915281518082018352600e5473ffffffffffffffffffffffffffffffffffffffff16908190529151918252015b60405180910390f35b600d5460ae9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016086565b005b600c5460e69062010000900460ff1681565b6040519015158152602001608656
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"`\x80`@R`\x0C\x80Tb\xFF\0\xFF\x19\x16b\x01\0\x01\x17\x90U4\x80\x15a\0!W`\0\x80\xFD[P`@Qa\x02#8\x03\x80a\x02#\x839\x81\x01`@\x81\x90Ra\0@\x91a\0\xF0V[`\x01`\x01`\xA0\x1B\x03\x81\x16a\0gW`@Qc \x16\x16\xD1`\xE2\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[`\x0E\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x83\x16\x17\x90UFazi\x03a\0\xCBW`@\x80Q` \x80\x82\x01\x83R`\0\x90\x91R\x81Q\x90\x81\x01\x90\x91R`\x0ET`\x01`\x01`\xA0\x1B\x03\x16\x90\x81\x90R`\r\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16\x90\x91\x17\x90Ua\0\xEAV[`@Qc\x0B\x13\xDB\xFF`\xE0\x1B\x81RF`\x04\x82\x01R`$\x01`@Q\x80\x91\x03\x90\xFD[Pa\x01 V[`\0` \x82\x84\x03\x12\x15a\x01\x02W`\0\x80\xFD[\x81Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x01\x19W`\0\x80\xFD[\x93\x92PPPV[`\xF5\x80a\x01.`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`FW`\x005`\xE0\x1C\x80c\x12\x90\r\xA8\x14`KW\x80c\xD7\xB6WE\x14`\x8FW\x80c\xF8\xA8\xFDm\x14`\xD2W\x80c\xF8\xCC\xBFG\x14`\xD4W[`\0\x80\xFD[`@\x80Q` \x80\x82\x01\x83R`\0\x90\x91R\x81Q\x80\x82\x01\x83R`\x0ETs\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x16\x90\x81\x90R\x91Q\x91\x82R\x01[`@Q\x80\x91\x03\x90\xF3[`\rT`\xAE\x90s\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x16\x81V[`@Qs\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x90\x91\x16\x81R` \x01`\x86V[\0[`\x0CT`\xE6\x90b\x01\0\0\x90\x04`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01`\x86V",
|
||||
);
|
||||
@@ -124,7 +123,6 @@ pub mod DeploymentConfig {
|
||||
///0x6080604052348015600f57600080fd5b506004361060465760003560e01c806312900da814604b578063d7b6574514608f578063f8a8fd6d1460d2578063f8ccbf471460d4575b600080fd5b6040805160208082018352600090915281518082018352600e5473ffffffffffffffffffffffffffffffffffffffff16908190529151918252015b60405180910390f35b600d5460ae9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016086565b005b600c5460e69062010000900460ff1681565b6040519015158152602001608656
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`FW`\x005`\xE0\x1C\x80c\x12\x90\r\xA8\x14`KW\x80c\xD7\xB6WE\x14`\x8FW\x80c\xF8\xA8\xFDm\x14`\xD2W\x80c\xF8\xCC\xBFG\x14`\xD4W[`\0\x80\xFD[`@\x80Q` \x80\x82\x01\x83R`\0\x90\x91R\x81Q\x80\x82\x01\x83R`\x0ETs\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x16\x90\x81\x90R\x91Q\x91\x82R\x01[`@Q\x80\x91\x03\x90\xF3[`\rT`\xAE\x90s\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x16\x81V[`@Qs\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x90\x91\x16\x81R` \x01`\x86V[\0[`\x0CT`\xE6\x90b\x01\0\0\x90\x04`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01`\x86V",
|
||||
);
|
||||
@@ -184,9 +182,6 @@ struct NetworkConfig { address deployer; }
|
||||
}
|
||||
#[inline]
|
||||
fn stv_abi_encoded_size(&self) -> usize {
|
||||
if let Some(size) = <Self as alloy_sol_types::SolType>::ENCODED_SIZE {
|
||||
return size;
|
||||
}
|
||||
let tuple = <UnderlyingRustTuple<
|
||||
'_,
|
||||
> as ::core::convert::From<Self>>::from(self.clone());
|
||||
@@ -210,18 +205,6 @@ struct NetworkConfig { address deployer; }
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::abi_encode_packed_to(&tuple, out)
|
||||
}
|
||||
#[inline]
|
||||
fn stv_abi_packed_encoded_size(&self) -> usize {
|
||||
if let Some(size) = <Self as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE {
|
||||
return size;
|
||||
}
|
||||
let tuple = <UnderlyingRustTuple<
|
||||
'_,
|
||||
> as ::core::convert::From<Self>>::from(self.clone());
|
||||
<UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::abi_packed_encoded_size(&tuple)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::SolType for NetworkConfig {
|
||||
@@ -233,9 +216,6 @@ struct NetworkConfig { address deployer; }
|
||||
const ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::ENCODED_SIZE;
|
||||
const PACKED_ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE;
|
||||
#[inline]
|
||||
fn valid_token(token: &Self::Token<'_>) -> bool {
|
||||
<UnderlyingSolTuple<'_> as alloy_sol_types::SolType>::valid_token(token)
|
||||
|
||||
@@ -41,7 +41,6 @@ pub mod Foo {
|
||||
///0x6080604052348015600f57600080fd5b5060658061001e6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80637d3c40c814602d575b600080fd5b603b6038366004604d565b90565b60405190815260200160405180910390f35b600060208284031215605e57600080fd5b503591905056
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`e\x80a\0\x1E`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`(W`\x005`\xE0\x1C\x80c}<@\xC8\x14`-W[`\0\x80\xFD[`;`86`\x04`MV[\x90V[`@Q\x90\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`\0` \x82\x84\x03\x12\x15`^W`\0\x80\xFD[P5\x91\x90PV",
|
||||
);
|
||||
@@ -51,7 +50,6 @@ pub mod Foo {
|
||||
///0x6080604052348015600f57600080fd5b506004361060285760003560e01c80637d3c40c814602d575b600080fd5b603b6038366004604d565b90565b60405190815260200160405180910390f35b600060208284031215605e57600080fd5b503591905056
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`(W`\x005`\xE0\x1C\x80c}<@\xC8\x14`-W[`\0\x80\xFD[`;`86`\x04`MV[\x90V[`@Q\x90\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`\0` \x82\x84\x03\x12\x15`^W`\0\x80\xFD[P5\x91\x90PV",
|
||||
);
|
||||
|
||||
@@ -41,7 +41,6 @@ pub mod IERC165 {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -51,7 +50,6 @@ pub mod IERC165 {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
|
||||
@@ -255,7 +255,6 @@ pub mod IERC20 {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -265,7 +264,6 @@ pub mod IERC20 {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -377,20 +375,15 @@ event Approval(address indexed owner, address indexed spender, uint256 value);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for Approval {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&Approval> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &Approval) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -502,20 +495,15 @@ event Transfer(address indexed from, address indexed to, uint256 value);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for Transfer {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&Transfer> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &Transfer) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2055,29 +2043,6 @@ function transferFrom(address from, address to, uint256 amount) external returns
|
||||
}
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for IERC20Events {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::Approval(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
Self::Transfer(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::Approval(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
Self::Transfer(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
use alloy::contract as alloy_contract;
|
||||
/**Creates a new wrapper around an on-chain [`IERC20`](self) contract instance.
|
||||
|
||||
|
||||
@@ -320,7 +320,6 @@ pub mod IERC721 {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -330,7 +329,6 @@ pub mod IERC721 {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -447,20 +445,15 @@ event Approval(address indexed _owner, address indexed _approved, uint256 indexe
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for Approval {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&Approval> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &Approval) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -576,20 +569,15 @@ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _ap
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for ApprovalForAll {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&ApprovalForAll> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &ApprovalForAll) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -706,20 +694,15 @@ event Transfer(address indexed _from, address indexed _to, uint256 indexed _toke
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for Transfer {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&Transfer> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &Transfer) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2554,35 +2537,6 @@ function transferFrom(address _from, address _to, uint256 _tokenId) external pay
|
||||
}
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for IERC721Events {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::Approval(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
Self::ApprovalForAll(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
Self::Transfer(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::Approval(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
Self::ApprovalForAll(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
Self::Transfer(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
use alloy::contract as alloy_contract;
|
||||
/**Creates a new wrapper around an on-chain [`IERC721`](self) contract instance.
|
||||
|
||||
|
||||
@@ -379,7 +379,6 @@ pub mod IERC721Enumerable {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -389,7 +388,6 @@ pub mod IERC721Enumerable {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -506,20 +504,15 @@ event Approval(address indexed _owner, address indexed _approved, uint256 indexe
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for Approval {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&Approval> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &Approval) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -635,20 +628,15 @@ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _ap
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for ApprovalForAll {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&ApprovalForAll> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &ApprovalForAll) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -765,20 +753,15 @@ event Transfer(address indexed _from, address indexed _to, uint256 indexed _toke
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for Transfer {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&Transfer> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &Transfer) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -3071,35 +3054,6 @@ function transferFrom(address _from, address _to, uint256 _tokenId) external pay
|
||||
}
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for IERC721EnumerableEvents {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::Approval(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
Self::ApprovalForAll(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
Self::Transfer(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::Approval(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
Self::ApprovalForAll(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
Self::Transfer(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
use alloy::contract as alloy_contract;
|
||||
/**Creates a new wrapper around an on-chain [`IERC721Enumerable`](self) contract instance.
|
||||
|
||||
|
||||
@@ -368,7 +368,6 @@ pub mod IERC721Metadata {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -378,7 +377,6 @@ pub mod IERC721Metadata {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -495,20 +493,15 @@ event Approval(address indexed _owner, address indexed _approved, uint256 indexe
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for Approval {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&Approval> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &Approval) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -624,20 +617,15 @@ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _ap
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for ApprovalForAll {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&ApprovalForAll> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &ApprovalForAll) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -754,20 +742,15 @@ event Transfer(address indexed _from, address indexed _to, uint256 indexed _toke
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for Transfer {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&Transfer> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &Transfer) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -3016,35 +2999,6 @@ function transferFrom(address _from, address _to, uint256 _tokenId) external pay
|
||||
}
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for IERC721MetadataEvents {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::Approval(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
Self::ApprovalForAll(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
Self::Transfer(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::Approval(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
Self::ApprovalForAll(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
Self::Transfer(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
use alloy::contract as alloy_contract;
|
||||
/**Creates a new wrapper around an on-chain [`IERC721Metadata`](self) contract instance.
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ pub mod IERC721TokenReceiver {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -66,7 +65,6 @@ pub mod IERC721TokenReceiver {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
|
||||
@@ -3,12 +3,8 @@
|
||||
Generated by the following Solidity interface...
|
||||
```solidity
|
||||
interface IScKeystore {
|
||||
struct UserInfo {
|
||||
bytes signaturePubKey;
|
||||
}
|
||||
|
||||
function addUser(address user, bytes memory signaturePubKey) external;
|
||||
function getUser(address user) external view returns (UserInfo memory);
|
||||
function addUser(address user) external;
|
||||
function removeUser(address user) external;
|
||||
function userExists(address user) external view returns (bool);
|
||||
}
|
||||
```
|
||||
@@ -24,11 +20,6 @@ interface IScKeystore {
|
||||
"name": "user",
|
||||
"type": "address",
|
||||
"internalType": "address"
|
||||
},
|
||||
{
|
||||
"name": "signaturePubKey",
|
||||
"type": "bytes",
|
||||
"internalType": "bytes"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
@@ -36,7 +27,7 @@ interface IScKeystore {
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"name": "getUser",
|
||||
"name": "removeUser",
|
||||
"inputs": [
|
||||
{
|
||||
"name": "user",
|
||||
@@ -44,21 +35,8 @@ interface IScKeystore {
|
||||
"internalType": "address"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "tuple",
|
||||
"internalType": "struct UserInfo",
|
||||
"components": [
|
||||
{
|
||||
"name": "signaturePubKey",
|
||||
"type": "bytes",
|
||||
"internalType": "bytes"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stateMutability": "view"
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable"
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
@@ -91,7 +69,6 @@ pub mod IScKeystore {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -101,206 +78,19 @@ pub mod IScKeystore {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
/**```solidity
|
||||
struct UserInfo { bytes signaturePubKey; }
|
||||
```*/
|
||||
#[allow(non_camel_case_types, non_snake_case)]
|
||||
#[derive(Clone)]
|
||||
pub struct UserInfo {
|
||||
pub signaturePubKey: alloy::sol_types::private::Bytes,
|
||||
}
|
||||
#[allow(non_camel_case_types, non_snake_case, clippy::style)]
|
||||
const _: () = {
|
||||
use alloy::sol_types as alloy_sol_types;
|
||||
#[doc(hidden)]
|
||||
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bytes,);
|
||||
#[doc(hidden)]
|
||||
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Bytes,);
|
||||
#[cfg(test)]
|
||||
#[allow(dead_code, unreachable_patterns)]
|
||||
fn _type_assertion(
|
||||
_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
|
||||
) {
|
||||
match _t {
|
||||
alloy_sol_types::private::AssertTypeEq::<
|
||||
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
|
||||
>(_) => {}
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[doc(hidden)]
|
||||
impl ::core::convert::From<UserInfo> for UnderlyingRustTuple<'_> {
|
||||
fn from(value: UserInfo) -> Self {
|
||||
(value.signaturePubKey,)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[doc(hidden)]
|
||||
impl ::core::convert::From<UnderlyingRustTuple<'_>> for UserInfo {
|
||||
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
|
||||
Self { signaturePubKey: tuple.0 }
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::SolValue for UserInfo {
|
||||
type SolType = Self;
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::SolTypeValue<Self> for UserInfo {
|
||||
#[inline]
|
||||
fn stv_to_tokens(&self) -> <Self as alloy_sol_types::SolType>::Token<'_> {
|
||||
(
|
||||
<alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
|
||||
&self.signaturePubKey,
|
||||
),
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
fn stv_abi_encoded_size(&self) -> usize {
|
||||
if let Some(size) = <Self as alloy_sol_types::SolType>::ENCODED_SIZE {
|
||||
return size;
|
||||
}
|
||||
let tuple = <UnderlyingRustTuple<
|
||||
'_,
|
||||
> as ::core::convert::From<Self>>::from(self.clone());
|
||||
<UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::abi_encoded_size(&tuple)
|
||||
}
|
||||
#[inline]
|
||||
fn stv_eip712_data_word(&self) -> alloy_sol_types::Word {
|
||||
<Self as alloy_sol_types::SolStruct>::eip712_hash_struct(self)
|
||||
}
|
||||
#[inline]
|
||||
fn stv_abi_encode_packed_to(
|
||||
&self,
|
||||
out: &mut alloy_sol_types::private::Vec<u8>,
|
||||
) {
|
||||
let tuple = <UnderlyingRustTuple<
|
||||
'_,
|
||||
> as ::core::convert::From<Self>>::from(self.clone());
|
||||
<UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::abi_encode_packed_to(&tuple, out)
|
||||
}
|
||||
#[inline]
|
||||
fn stv_abi_packed_encoded_size(&self) -> usize {
|
||||
if let Some(size) = <Self as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE {
|
||||
return size;
|
||||
}
|
||||
let tuple = <UnderlyingRustTuple<
|
||||
'_,
|
||||
> as ::core::convert::From<Self>>::from(self.clone());
|
||||
<UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::abi_packed_encoded_size(&tuple)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::SolType for UserInfo {
|
||||
type RustType = Self;
|
||||
type Token<'a> = <UnderlyingSolTuple<
|
||||
'a,
|
||||
> as alloy_sol_types::SolType>::Token<'a>;
|
||||
const SOL_NAME: &'static str = <Self as alloy_sol_types::SolStruct>::NAME;
|
||||
const ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::ENCODED_SIZE;
|
||||
const PACKED_ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE;
|
||||
#[inline]
|
||||
fn valid_token(token: &Self::Token<'_>) -> bool {
|
||||
<UnderlyingSolTuple<'_> as alloy_sol_types::SolType>::valid_token(token)
|
||||
}
|
||||
#[inline]
|
||||
fn detokenize(token: Self::Token<'_>) -> Self::RustType {
|
||||
let tuple = <UnderlyingSolTuple<
|
||||
'_,
|
||||
> as alloy_sol_types::SolType>::detokenize(token);
|
||||
<Self as ::core::convert::From<UnderlyingRustTuple<'_>>>::from(tuple)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::SolStruct for UserInfo {
|
||||
const NAME: &'static str = "UserInfo";
|
||||
#[inline]
|
||||
fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> {
|
||||
alloy_sol_types::private::Cow::Borrowed(
|
||||
"UserInfo(bytes signaturePubKey)",
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
fn eip712_components() -> alloy_sol_types::private::Vec<
|
||||
alloy_sol_types::private::Cow<'static, str>,
|
||||
> {
|
||||
alloy_sol_types::private::Vec::new()
|
||||
}
|
||||
#[inline]
|
||||
fn eip712_encode_type() -> alloy_sol_types::private::Cow<'static, str> {
|
||||
<Self as alloy_sol_types::SolStruct>::eip712_root_type()
|
||||
}
|
||||
#[inline]
|
||||
fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec<u8> {
|
||||
<alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::eip712_data_word(
|
||||
&self.signaturePubKey,
|
||||
)
|
||||
.0
|
||||
.to_vec()
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::EventTopic for UserInfo {
|
||||
#[inline]
|
||||
fn topic_preimage_length(rust: &Self::RustType) -> usize {
|
||||
0usize
|
||||
+ <alloy::sol_types::sol_data::Bytes as alloy_sol_types::EventTopic>::topic_preimage_length(
|
||||
&rust.signaturePubKey,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
fn encode_topic_preimage(
|
||||
rust: &Self::RustType,
|
||||
out: &mut alloy_sol_types::private::Vec<u8>,
|
||||
) {
|
||||
out.reserve(
|
||||
<Self as alloy_sol_types::EventTopic>::topic_preimage_length(rust),
|
||||
);
|
||||
<alloy::sol_types::sol_data::Bytes as alloy_sol_types::EventTopic>::encode_topic_preimage(
|
||||
&rust.signaturePubKey,
|
||||
out,
|
||||
);
|
||||
}
|
||||
#[inline]
|
||||
fn encode_topic(
|
||||
rust: &Self::RustType,
|
||||
) -> alloy_sol_types::abi::token::WordToken {
|
||||
let mut out = alloy_sol_types::private::Vec::new();
|
||||
<Self as alloy_sol_types::EventTopic>::encode_topic_preimage(
|
||||
rust,
|
||||
&mut out,
|
||||
);
|
||||
alloy_sol_types::abi::token::WordToken(
|
||||
alloy_sol_types::private::keccak256(out),
|
||||
)
|
||||
}
|
||||
}
|
||||
};
|
||||
/**Function with signature `addUser(address,bytes)` and selector `0xe3eccd10`.
|
||||
/**Function with signature `addUser(address)` and selector `0x421b2d8b`.
|
||||
```solidity
|
||||
function addUser(address user, bytes memory signaturePubKey) external;
|
||||
function addUser(address user) external;
|
||||
```*/
|
||||
#[allow(non_camel_case_types, non_snake_case)]
|
||||
#[derive(Clone)]
|
||||
pub struct addUserCall {
|
||||
pub user: alloy::sol_types::private::Address,
|
||||
pub signaturePubKey: alloy::sol_types::private::Bytes,
|
||||
}
|
||||
///Container type for the return parameters of the [`addUser(address,bytes)`](addUserCall) function.
|
||||
///Container type for the return parameters of the [`addUser(address)`](addUserCall) function.
|
||||
#[allow(non_camel_case_types, non_snake_case)]
|
||||
#[derive(Clone)]
|
||||
pub struct addUserReturn {}
|
||||
@@ -309,15 +99,9 @@ function addUser(address user, bytes memory signaturePubKey) external;
|
||||
use alloy::sol_types as alloy_sol_types;
|
||||
{
|
||||
#[doc(hidden)]
|
||||
type UnderlyingSolTuple<'a> = (
|
||||
alloy::sol_types::sol_data::Address,
|
||||
alloy::sol_types::sol_data::Bytes,
|
||||
);
|
||||
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
|
||||
#[doc(hidden)]
|
||||
type UnderlyingRustTuple<'a> = (
|
||||
alloy::sol_types::private::Address,
|
||||
alloy::sol_types::private::Bytes,
|
||||
);
|
||||
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
|
||||
#[cfg(test)]
|
||||
#[allow(dead_code, unreachable_patterns)]
|
||||
fn _type_assertion(
|
||||
@@ -333,17 +117,14 @@ function addUser(address user, bytes memory signaturePubKey) external;
|
||||
#[doc(hidden)]
|
||||
impl ::core::convert::From<addUserCall> for UnderlyingRustTuple<'_> {
|
||||
fn from(value: addUserCall) -> Self {
|
||||
(value.user, value.signaturePubKey)
|
||||
(value.user,)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[doc(hidden)]
|
||||
impl ::core::convert::From<UnderlyingRustTuple<'_>> for addUserCall {
|
||||
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
|
||||
Self {
|
||||
user: tuple.0,
|
||||
signaturePubKey: tuple.1,
|
||||
}
|
||||
Self { user: tuple.0 }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -380,10 +161,7 @@ function addUser(address user, bytes memory signaturePubKey) external;
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::SolCall for addUserCall {
|
||||
type Parameters<'a> = (
|
||||
alloy::sol_types::sol_data::Address,
|
||||
alloy::sol_types::sol_data::Bytes,
|
||||
);
|
||||
type Parameters<'a> = (alloy::sol_types::sol_data::Address,);
|
||||
type Token<'a> = <Self::Parameters<
|
||||
'a,
|
||||
> as alloy_sol_types::SolType>::Token<'a>;
|
||||
@@ -392,8 +170,8 @@ function addUser(address user, bytes memory signaturePubKey) external;
|
||||
type ReturnToken<'a> = <Self::ReturnTuple<
|
||||
'a,
|
||||
> as alloy_sol_types::SolType>::Token<'a>;
|
||||
const SIGNATURE: &'static str = "addUser(address,bytes)";
|
||||
const SELECTOR: [u8; 4] = [227u8, 236u8, 205u8, 16u8];
|
||||
const SIGNATURE: &'static str = "addUser(address)";
|
||||
const SELECTOR: [u8; 4] = [66u8, 27u8, 45u8, 139u8];
|
||||
#[inline]
|
||||
fn new<'a>(
|
||||
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
|
||||
@@ -406,9 +184,6 @@ function addUser(address user, bytes memory signaturePubKey) external;
|
||||
<alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
|
||||
&self.user,
|
||||
),
|
||||
<alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
|
||||
&self.signaturePubKey,
|
||||
),
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
@@ -423,21 +198,19 @@ function addUser(address user, bytes memory signaturePubKey) external;
|
||||
}
|
||||
}
|
||||
};
|
||||
/**Function with signature `getUser(address)` and selector `0x6f77926b`.
|
||||
/**Function with signature `removeUser(address)` and selector `0x98575188`.
|
||||
```solidity
|
||||
function getUser(address user) external view returns (UserInfo memory);
|
||||
function removeUser(address user) external;
|
||||
```*/
|
||||
#[allow(non_camel_case_types, non_snake_case)]
|
||||
#[derive(Clone)]
|
||||
pub struct getUserCall {
|
||||
pub struct removeUserCall {
|
||||
pub user: alloy::sol_types::private::Address,
|
||||
}
|
||||
///Container type for the return parameters of the [`getUser(address)`](getUserCall) function.
|
||||
///Container type for the return parameters of the [`removeUser(address)`](removeUserCall) function.
|
||||
#[allow(non_camel_case_types, non_snake_case)]
|
||||
#[derive(Clone)]
|
||||
pub struct getUserReturn {
|
||||
pub _0: <UserInfo as alloy::sol_types::SolType>::RustType,
|
||||
}
|
||||
pub struct removeUserReturn {}
|
||||
#[allow(non_camel_case_types, non_snake_case, clippy::style)]
|
||||
const _: () = {
|
||||
use alloy::sol_types as alloy_sol_types;
|
||||
@@ -459,14 +232,14 @@ function getUser(address user) external view returns (UserInfo memory);
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[doc(hidden)]
|
||||
impl ::core::convert::From<getUserCall> for UnderlyingRustTuple<'_> {
|
||||
fn from(value: getUserCall) -> Self {
|
||||
impl ::core::convert::From<removeUserCall> for UnderlyingRustTuple<'_> {
|
||||
fn from(value: removeUserCall) -> Self {
|
||||
(value.user,)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[doc(hidden)]
|
||||
impl ::core::convert::From<UnderlyingRustTuple<'_>> for getUserCall {
|
||||
impl ::core::convert::From<UnderlyingRustTuple<'_>> for removeUserCall {
|
||||
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
|
||||
Self { user: tuple.0 }
|
||||
}
|
||||
@@ -474,11 +247,9 @@ function getUser(address user) external view returns (UserInfo memory);
|
||||
}
|
||||
{
|
||||
#[doc(hidden)]
|
||||
type UnderlyingSolTuple<'a> = (UserInfo,);
|
||||
type UnderlyingSolTuple<'a> = ();
|
||||
#[doc(hidden)]
|
||||
type UnderlyingRustTuple<'a> = (
|
||||
<UserInfo as alloy::sol_types::SolType>::RustType,
|
||||
);
|
||||
type UnderlyingRustTuple<'a> = ();
|
||||
#[cfg(test)]
|
||||
#[allow(dead_code, unreachable_patterns)]
|
||||
fn _type_assertion(
|
||||
@@ -492,32 +263,32 @@ function getUser(address user) external view returns (UserInfo memory);
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[doc(hidden)]
|
||||
impl ::core::convert::From<getUserReturn> for UnderlyingRustTuple<'_> {
|
||||
fn from(value: getUserReturn) -> Self {
|
||||
(value._0,)
|
||||
impl ::core::convert::From<removeUserReturn> for UnderlyingRustTuple<'_> {
|
||||
fn from(value: removeUserReturn) -> Self {
|
||||
()
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[doc(hidden)]
|
||||
impl ::core::convert::From<UnderlyingRustTuple<'_>> for getUserReturn {
|
||||
impl ::core::convert::From<UnderlyingRustTuple<'_>> for removeUserReturn {
|
||||
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
|
||||
Self { _0: tuple.0 }
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::SolCall for getUserCall {
|
||||
impl alloy_sol_types::SolCall for removeUserCall {
|
||||
type Parameters<'a> = (alloy::sol_types::sol_data::Address,);
|
||||
type Token<'a> = <Self::Parameters<
|
||||
'a,
|
||||
> as alloy_sol_types::SolType>::Token<'a>;
|
||||
type Return = getUserReturn;
|
||||
type ReturnTuple<'a> = (UserInfo,);
|
||||
type Return = removeUserReturn;
|
||||
type ReturnTuple<'a> = ();
|
||||
type ReturnToken<'a> = <Self::ReturnTuple<
|
||||
'a,
|
||||
> as alloy_sol_types::SolType>::Token<'a>;
|
||||
const SIGNATURE: &'static str = "getUser(address)";
|
||||
const SELECTOR: [u8; 4] = [111u8, 119u8, 146u8, 107u8];
|
||||
const SIGNATURE: &'static str = "removeUser(address)";
|
||||
const SELECTOR: [u8; 4] = [152u8, 87u8, 81u8, 136u8];
|
||||
#[inline]
|
||||
fn new<'a>(
|
||||
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
|
||||
@@ -666,7 +437,7 @@ function userExists(address user) external view returns (bool);
|
||||
///Container for all the [`IScKeystore`](self) function calls.
|
||||
pub enum IScKeystoreCalls {
|
||||
addUser(addUserCall),
|
||||
getUser(getUserCall),
|
||||
removeUser(removeUserCall),
|
||||
userExists(userExistsCall),
|
||||
}
|
||||
#[automatically_derived]
|
||||
@@ -679,8 +450,8 @@ function userExists(address user) external view returns (bool);
|
||||
/// Prefer using `SolInterface` methods instead.
|
||||
pub const SELECTORS: &'static [[u8; 4usize]] = &[
|
||||
[14u8, 102u8, 110u8, 73u8],
|
||||
[111u8, 119u8, 146u8, 107u8],
|
||||
[227u8, 236u8, 205u8, 16u8],
|
||||
[66u8, 27u8, 45u8, 139u8],
|
||||
[152u8, 87u8, 81u8, 136u8],
|
||||
];
|
||||
}
|
||||
#[automatically_derived]
|
||||
@@ -692,7 +463,9 @@ function userExists(address user) external view returns (bool);
|
||||
fn selector(&self) -> [u8; 4] {
|
||||
match self {
|
||||
Self::addUser(_) => <addUserCall as alloy_sol_types::SolCall>::SELECTOR,
|
||||
Self::getUser(_) => <getUserCall as alloy_sol_types::SolCall>::SELECTOR,
|
||||
Self::removeUser(_) => {
|
||||
<removeUserCall as alloy_sol_types::SolCall>::SELECTOR
|
||||
}
|
||||
Self::userExists(_) => {
|
||||
<userExistsCall as alloy_sol_types::SolCall>::SELECTOR
|
||||
}
|
||||
@@ -730,19 +503,6 @@ function userExists(address user) external view returns (bool);
|
||||
}
|
||||
userExists
|
||||
},
|
||||
{
|
||||
fn getUser(
|
||||
data: &[u8],
|
||||
validate: bool,
|
||||
) -> alloy_sol_types::Result<IScKeystoreCalls> {
|
||||
<getUserCall as alloy_sol_types::SolCall>::abi_decode_raw(
|
||||
data,
|
||||
validate,
|
||||
)
|
||||
.map(IScKeystoreCalls::getUser)
|
||||
}
|
||||
getUser
|
||||
},
|
||||
{
|
||||
fn addUser(
|
||||
data: &[u8],
|
||||
@@ -756,6 +516,19 @@ function userExists(address user) external view returns (bool);
|
||||
}
|
||||
addUser
|
||||
},
|
||||
{
|
||||
fn removeUser(
|
||||
data: &[u8],
|
||||
validate: bool,
|
||||
) -> alloy_sol_types::Result<IScKeystoreCalls> {
|
||||
<removeUserCall as alloy_sol_types::SolCall>::abi_decode_raw(
|
||||
data,
|
||||
validate,
|
||||
)
|
||||
.map(IScKeystoreCalls::removeUser)
|
||||
}
|
||||
removeUser
|
||||
},
|
||||
];
|
||||
let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
|
||||
return Err(
|
||||
@@ -773,8 +546,8 @@ function userExists(address user) external view returns (bool);
|
||||
Self::addUser(inner) => {
|
||||
<addUserCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
|
||||
}
|
||||
Self::getUser(inner) => {
|
||||
<getUserCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
|
||||
Self::removeUser(inner) => {
|
||||
<removeUserCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
|
||||
}
|
||||
Self::userExists(inner) => {
|
||||
<userExistsCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
|
||||
@@ -787,8 +560,11 @@ function userExists(address user) external view returns (bool);
|
||||
Self::addUser(inner) => {
|
||||
<addUserCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
|
||||
}
|
||||
Self::getUser(inner) => {
|
||||
<getUserCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
|
||||
Self::removeUser(inner) => {
|
||||
<removeUserCall as alloy_sol_types::SolCall>::abi_encode_raw(
|
||||
inner,
|
||||
out,
|
||||
)
|
||||
}
|
||||
Self::userExists(inner) => {
|
||||
<userExistsCall as alloy_sol_types::SolCall>::abi_encode_raw(
|
||||
@@ -967,21 +743,15 @@ the bytecode concatenated with the constructor's ABI-encoded arguments.*/
|
||||
pub fn addUser(
|
||||
&self,
|
||||
user: alloy::sol_types::private::Address,
|
||||
signaturePubKey: alloy::sol_types::private::Bytes,
|
||||
) -> alloy_contract::SolCallBuilder<T, &P, addUserCall, N> {
|
||||
self.call_builder(
|
||||
&addUserCall {
|
||||
user,
|
||||
signaturePubKey,
|
||||
},
|
||||
)
|
||||
self.call_builder(&addUserCall { user })
|
||||
}
|
||||
///Creates a new call builder for the [`getUser`] function.
|
||||
pub fn getUser(
|
||||
///Creates a new call builder for the [`removeUser`] function.
|
||||
pub fn removeUser(
|
||||
&self,
|
||||
user: alloy::sol_types::private::Address,
|
||||
) -> alloy_contract::SolCallBuilder<T, &P, getUserCall, N> {
|
||||
self.call_builder(&getUserCall { user })
|
||||
) -> alloy_contract::SolCallBuilder<T, &P, removeUserCall, N> {
|
||||
self.call_builder(&removeUserCall { user })
|
||||
}
|
||||
///Creates a new call builder for the [`userExists`] function.
|
||||
pub fn userExists(
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -103,7 +103,6 @@ pub mod Ownable {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -113,7 +112,6 @@ pub mod Ownable {
|
||||
///0x
|
||||
/// ```
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
|
||||
b"",
|
||||
);
|
||||
@@ -354,20 +352,15 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for OwnershipTransferred {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
From::from(self)
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
From::from(&self)
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl From<&OwnershipTransferred> for alloy_sol_types::private::LogData {
|
||||
#[inline]
|
||||
fn from(this: &OwnershipTransferred) -> alloy_sol_types::private::LogData {
|
||||
alloy_sol_types::SolEvent::encode_log_data(this)
|
||||
let topics = alloy_sol_types::SolEvent::encode_topics(this)
|
||||
.into_iter()
|
||||
.map(|t| t.into())
|
||||
.collect();
|
||||
let data = alloy_sol_types::SolEvent::encode_data(this).into();
|
||||
alloy_sol_types::private::LogData::new_unchecked(topics, data)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1071,23 +1064,6 @@ function transferOwnership(address newOwner) external;
|
||||
}
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl alloy_sol_types::private::IntoLogData for OwnableEvents {
|
||||
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::OwnershipTransferred(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::to_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
fn into_log_data(self) -> alloy_sol_types::private::LogData {
|
||||
match self {
|
||||
Self::OwnershipTransferred(inner) => {
|
||||
alloy_sol_types::private::IntoLogData::into_log_data(inner)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
use alloy::contract as alloy_contract;
|
||||
/**Creates a new wrapper around an on-chain [`Ownable`](self) contract instance.
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user