Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Greybeard
momiji-public-monorepo
Commits
a266b32d
Commit
a266b32d
authored
10 months ago
by
John Doe
Browse files
Options
Download
Email Patches
Plain Diff
monorepo.
parent
85ec022c
Changes
544
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1104 additions
and
0 deletions
+1104
-0
frontend/momiji-helpers/circuits/recursion/target/vk_fields.json
...d/momiji-helpers/circuits/recursion/target/vk_fields.json
+1
-0
frontend/momiji-helpers/circuits/transaction/Nargo.toml
frontend/momiji-helpers/circuits/transaction/Nargo.toml
+8
-0
frontend/momiji-helpers/circuits/transaction/Prover.toml
frontend/momiji-helpers/circuits/transaction/Prover.toml
+0
-0
frontend/momiji-helpers/circuits/transaction/Verifier.toml
frontend/momiji-helpers/circuits/transaction/Verifier.toml
+0
-0
frontend/momiji-helpers/circuits/transaction/src/main.nr
frontend/momiji-helpers/circuits/transaction/src/main.nr
+91
-0
frontend/momiji-helpers/circuits/transaction_wrapper/Nargo.toml
...nd/momiji-helpers/circuits/transaction_wrapper/Nargo.toml
+8
-0
frontend/momiji-helpers/circuits/transaction_wrapper/Prover.toml
...d/momiji-helpers/circuits/transaction_wrapper/Prover.toml
+0
-0
frontend/momiji-helpers/circuits/transaction_wrapper/Verifier.toml
...momiji-helpers/circuits/transaction_wrapper/Verifier.toml
+0
-0
frontend/momiji-helpers/circuits/transaction_wrapper/src/main.nr
...d/momiji-helpers/circuits/transaction_wrapper/src/main.nr
+20
-0
frontend/momiji-helpers/contracts/.deps/npm/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol
...ink/contracts/src/v0.8/interfaces/AggregatorInterface.sol
+18
-0
frontend/momiji-helpers/contracts/.deps/npm/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol
...contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol
+7
-0
frontend/momiji-helpers/contracts/.deps/npm/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol
...k/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol
+19
-0
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
...pelin/contracts-upgradeable/access/OwnableUpgradeable.sol
+119
-0
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
...pelin/contracts-upgradeable/proxy/utils/Initializable.sol
+228
-0
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol
...lin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol
+153
-0
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
...ppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
+34
-0
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol
...pelin/contracts-upgradeable/utils/PausableUpgradeable.sol
+140
-0
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol
...acts-upgradeable/utils/cryptography/EIP712Upgradeable.sol
+210
-0
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts/interfaces/IERC5267.sol
....deps/npm/@openzeppelin/contracts/interfaces/IERC5267.sol
+28
-0
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts/interfaces/draft-IERC1822.sol
...npm/@openzeppelin/contracts/interfaces/draft-IERC1822.sol
+20
-0
No files found.
frontend/momiji-helpers/circuits/recursion/target/vk_fields.json
0 → 100644
View file @
a266b32d
[
"0x1727d9cce8edf8b1d7228edf940be5ab221dc023f0e21785e634f5dcf9718007"
,
"0x26125da10a0ed06327508aba06d1e303ac616632dbed349f53422da953337857"
,
"0x0000000000000000000000000000000000000000000000000000000000100000"
,
"0x0000000000000000000000000000000000000000000000000000000000000005"
,
"0x0000000000000000000000000000000000000000000000000000000000100000"
,
"0x0000000000000000000000000000000000000000000000000000000000000011"
,
"0x0000000000000000000000000000000000000000000000000000000000000001"
,
"0x0000000000000000000000000000000000000000000000000000000000000001"
,
"0x0000000000000000000000000000000000000000000000000000000000000002"
,
"0x0000000000000000000000000000000000000000000000000000000000000003"
,
"0x0000000000000000000000000000000000000000000000000000000000000004"
,
"0x0000000000000000000000000000000000000000000000000000000000000005"
,
"0x0000000000000000000000000000000000000000000000000000000000000006"
,
"0x0000000000000000000000000000000000000000000000000000000000000007"
,
"0x0000000000000000000000000000000000000000000000000000000000000008"
,
"0x0000000000000000000000000000000000000000000000000000000000000009"
,
"0x000000000000000000000000000000000000000000000000000000000000000a"
,
"0x000000000000000000000000000000000000000000000000000000000000000b"
,
"0x000000000000000000000000000000000000000000000000000000000000000c"
,
"0x000000000000000000000000000000000000000000000000000000000000000d"
,
"0x000000000000000000000000000000000000000000000000000000000000000e"
,
"0x000000000000000000000000000000000000000000000000000000000000000f"
,
"0x0000000000000000000000000000000000000000000000000000000000000010"
,
"0x0000000000000000000000000000001ed8a02482426d263a4ecb0ef896ce89aa"
,
"0x00000000000000000000000000000000002dd82b96a445a3d48db46e78fd1fe5"
,
"0x0000000000000000000000000000001a810690ec0eb9e6cb49dd68aed57b9a2c"
,
"0x00000000000000000000000000000000002979d0f3b9cbc56e6a5eed0176979c"
,
"0x000000000000000000000000000000ece4843dd3e3cb41a29ffcc72d49376ac5"
,
"0x000000000000000000000000000000000013f586937d9e92ad01910eaf7267fe"
,
"0x000000000000000000000000000000832de083f2aea887e5b0b3e07195bf3369"
,
"0x0000000000000000000000000000000000020d7d6640cc6909b63450357223cd"
,
"0x0000000000000000000000000000001a1e30f8051c1e84c165acf80086e8dfca"
,
"0x00000000000000000000000000000000002c77a04e17e8644f9b7053b4bb08fa"
,
"0x000000000000000000000000000000accbe6a903bb7bfaf1909074da32f28e74"
,
"0x000000000000000000000000000000000010ef1c64b5aa796d3218d20cfdb0a4"
,
"0x000000000000000000000000000000cbc1cc027a33d219526471449d9049146a"
,
"0x00000000000000000000000000000000000735dd552cfe8a4cf17f17049626d0"
,
"0x000000000000000000000000000000f3576e636ff3ebaff43f0d1c8294b67a8c"
,
"0x00000000000000000000000000000000001bb99e027a879809200c2f3e9992da"
,
"0x00000000000000000000000000000004f1b4950d8b0919092c8b596a63e9396e"
,
"0x00000000000000000000000000000000001e031462c21a2937998d8ab726051a"
,
"0x000000000000000000000000000000618474ad492a93435a82a433a1ae1b5c04"
,
"0x00000000000000000000000000000000001beb3c3937fc9ff20499d59cc4665e"
,
"0x000000000000000000000000000000053a4799f326db1157b41ba75481ac65ce"
,
"0x00000000000000000000000000000000002a6cafad02233a289b5ee0dac52d24"
,
"0x00000000000000000000000000000029b0e33ec90e9b6e7c0c774b2a394f5c90"
,
"0x00000000000000000000000000000000000ff63c1bf54473c34651e117d63bbb"
,
"0x000000000000000000000000000000a0098ac613ba3629b0421d7894f0bc65d8"
,
"0x00000000000000000000000000000000001f58e2dbf833ed8c21a5ac822a390e"
,
"0x000000000000000000000000000000ad30140ddc344a8ac7a49d29b0b600d888"
,
"0x000000000000000000000000000000000000b0088164d522367583c90f73bcd7"
,
"0x0000000000000000000000000000004a05d497f585103d826b8a133761cc79ef"
,
"0x000000000000000000000000000000000011888c79e6b006e1a7d293898b9842"
,
"0x00000000000000000000000000000039b41a3dfe9e948d33fd4a759e9e8a7b30"
,
"0x00000000000000000000000000000000000427be5203eb43e160d9635925f64a"
,
"0x000000000000000000000000000000c0b125470d496d55ec3d8678b1efcc0b14"
,
"0x00000000000000000000000000000000000a346d061bfa2ad56a322a81a8be06"
,
"0x000000000000000000000000000000e36f8d9132dccbddbcbc4eca6bdb70583a"
,
"0x000000000000000000000000000000000006e53484e1a4f26129c00c5afdf4d4"
,
"0x000000000000000000000000000000d56ff07f6c8d054cf78d713a5f4399313b"
,
"0x000000000000000000000000000000000009fa75fa397a889177953777b32ad7"
,
"0x000000000000000000000000000000a9eba193f17a0cbcfd5cd786e8fc93e044"
,
"0x0000000000000000000000000000000000231e1180c41ca9fcad8207beb4aeb2"
,
"0x000000000000000000000000000000439f7eb6e39f8ef36735fde1563efc018c"
,
"0x0000000000000000000000000000000000131bb8b31246156eac5a9632b1c44c"
,
"0x000000000000000000000000000000ff14d910386a5d634a00deb8432bd230bd"
,
"0x0000000000000000000000000000000000032cf0e4f77b2c32b39804b2e836a1"
,
"0x00000000000000000000000000000059d45db08da921eb51ee629b37eaac3804"
,
"0x00000000000000000000000000000000001351c4d6ee97e5a13968cd8b575376"
,
"0x000000000000000000000000000000a1fef20a9e9baae03c66b387855786961c"
,
"0x00000000000000000000000000000000000087e919ca347c14bae58f2a007979"
,
"0x00000000000000000000000000000068c2dee24bf49f48ca91a9b31cf489100a"
,
"0x00000000000000000000000000000000002ebbec213fd5e638e763bf574db1dd"
,
"0x000000000000000000000000000000405686bb9661ab548fc6490de8273991c1"
,
"0x00000000000000000000000000000000000f55573e8cc6debc7e4ad36f55f0a3"
,
"0x00000000000000000000000000000016c8911d3abcc99956cfafd2469e57d352"
,
"0x000000000000000000000000000000000023987c17049de9e6e90534922b068d"
,
"0x000000000000000000000000000000310a00459798915e70bb5f6c0d93950c61"
,
"0x0000000000000000000000000000000000190404b6761da87bbb58c68adf9c07"
,
"0x0000000000000000000000000000007003780317cc6fecafa2529793ea4d856a"
,
"0x00000000000000000000000000000000000c49e1acc2e2a5ed2523a68e13bcc7"
,
"0x0000000000000000000000000000004564d9adecd904030f441c500bea3a54e8"
,
"0x0000000000000000000000000000000000118e887dc7827a303ae4efd884289f"
,
"0x00000000000000000000000000000055bcb8484f4bfca2d81c1a7a08f92dcc1e"
,
"0x0000000000000000000000000000000000192d66138ef5fb5cbd60d25910fa8b"
,
"0x0000000000000000000000000000006ce36390303806bf1667cac7fd3a0a911f"
,
"0x000000000000000000000000000000000025719fd7b4f27bd77387d4580c46ef"
,
"0x000000000000000000000000000000e15e5e8edb26147b877fd483a9be1ee557"
,
"0x00000000000000000000000000000000000d4744317ff703c20132134b9af145"
,
"0x00000000000000000000000000000097931bbb683b832edaedfb84ae020a3e6c"
,
"0x000000000000000000000000000000000024e913db937478f592ff958369c33b"
,
"0x000000000000000000000000000000aad0edb65a7896339ad92cb7bdda5bc0cb"
,
"0x00000000000000000000000000000000001f13f1759e514b1f053da73837b9bf"
,
"0x000000000000000000000000000000b5928facba6909a6cb9d3f99b451dbb0da"
,
"0x0000000000000000000000000000000000140e3a61cbd87e23e9f59c0c8a5f92"
,
"0x0000000000000000000000000000000c542c4e643211a206a43e3c82940ce012"
,
"0x0000000000000000000000000000000000073ab903217225282916b264ffbd6f"
,
"0x000000000000000000000000000000362a93230a711f6dff86b1a347c978b220"
,
"0x00000000000000000000000000000000001a14bd51e9dc0b4b973e46910d2b6f"
,
"0x000000000000000000000000000000e13a606550f2c61830bf9da814621581ee"
,
"0x00000000000000000000000000000000001297f1e111cc1ea7a2221affb5eecd"
,
"0x00000000000000000000000000000000aa60b3f6dc00be97871878c40d04a293"
,
"0x000000000000000000000000000000000007f762063f0123fba74c4cd66e7559"
,
"0x000000000000000000000000000000541c1db7e3c80a294ea50b24011999fe4e"
,
"0x00000000000000000000000000000000002e238e496f9533c8fe3a9342fcf1f6"
,
"0x000000000000000000000000000000f65f2ad1025c0ec713b29b2db4c57e83d6"
,
"0x000000000000000000000000000000000013ff20a10295d07fd0b16253a6775a"
,
"0x00000000000000000000000000000026d344ed7a87caa6087967171876052349"
,
"0x00000000000000000000000000000000002626bea2de7026dd6dd4e1df614a65"
,
"0x000000000000000000000000000000b264d3a3a6bb7a41d57f96e6877e5bb37d"
,
"0x0000000000000000000000000000000000275f1c996d71439acf76f03932c52c"
,
"0x000000000000000000000000000000c8b2af388b1f0b0832ca8f2a0154be54ce"
,
"0x00000000000000000000000000000000003020cfd271da8c447e2ccff6908c3a"
,
"0x00000000000000000000000000000008e8f770eef342595ebce4b42811af4966"
,
"0x000000000000000000000000000000000002ae8005a2c1cc97d4cdc896b54e70"
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/circuits/transaction/Nargo.toml
0 → 100644
View file @
a266b32d
[package]
name
=
"transaction"
type
=
"bin"
authors
=
[""]
compiler_version
=
">=0.19.2"
[dependencies]
helpers
=
{
path
=
"../helpers"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/circuits/transaction/Prover.toml
0 → 100644
View file @
a266b32d
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/circuits/transaction/Verifier.toml
0 → 100644
View file @
a266b32d
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/circuits/transaction/src/main.nr
0 → 100644
View file @
a266b32d
use dep::std;
use dep::helpers;
use dep::helpers::hash;
use dep::helpers::structs;
#[recursive]
fn main(
public_inputs_hash: pub Field,
public_inputs: structs::PublicInputs,
private_inputs: structs::PrivateInputs
) {
let tx_hash: Field = hash::hash_tx(public_inputs);
assert(tx_hash == public_inputs_hash);
let mut sum_in: Field = public_inputs.deposit_amount;
let mut sum_out: Field = public_inputs.withdrawals;
for i in 0..16 {
if (private_inputs.utxo_in[i].amount != helpers::ZERO_VALUE) {
let owner = hash::hash([private_inputs.secrets[i]]);
assert(owner == private_inputs.utxo_in[i].owner);
assert(public_inputs.nullifier_hashes[i] == hash::hash([private_inputs.secrets[i], private_inputs.secrets[i]]));
let commitment_in = hash::hash([private_inputs.utxo_in[i].owner, private_inputs.utxo_in[i].amount, private_inputs.utxo_in[i].asset_type]);
if (public_inputs.commitment_in[i] == helpers::ZERO_VALUE) {
let utxo_root = hash::compute_merkle_root(
commitment_in,
private_inputs.merkle_proofs[i].index_utxo,
private_inputs.merkle_proofs[i].path_utxo
);
let tx_root = hash::compute_merkle_root(
utxo_root,
private_inputs.merkle_proofs[i].index_tx,
private_inputs.merkle_proofs[i].path_tx
);
let leaf_batch = hash::hash([tx_root, private_inputs.oracle[i]]);
assert(private_inputs.oracle[i] == helpers::ZERO_VALUE);
let leaf_historic = hash::hash([leaf_batch, private_inputs.old_root_proof[i]]);
let historic_root = hash::compute_merkle_root(
leaf_historic,
private_inputs.merkle_proofs[i].index_historic,
private_inputs.merkle_proofs[i].path_historic
);
assert(historic_root == public_inputs.current_root);
} else {
assert(commitment_in == public_inputs.commitment_in[i]);
}
let sum_in_old: Field = sum_in;
sum_in += private_inputs.utxo_in[i].amount;
if (sum_in_old != sum_in) {
assert(sum_in_old.lt(sum_in));
}
}
}
for k in 0..16 {
if (public_inputs.commitment_out[k] != ZERO_VALUE) {
assert(private_inputs.utxo_out[k].amount.lt(sum_in + 1));
let sum_out_old: Field = sum_out;
sum_out += private_inputs.utxo_out[k].amount;
if (sum_out_old != sum_out) {
assert(sum_out_old.lt(sum_out));
}
let commitment_out_calc = hash::hash([private_inputs.utxo_out[k].owner, private_inputs.utxo_out[k].amount, private_inputs.utxo_out[k].asset_type]);
assert(commitment_out_calc == public_inputs.commitment_out[k]);
}
}
assert(sum_in == sum_out);
let utxo_root_calc: Field = hash::hash_tree_four(public_inputs.commitment_out);
assert(utxo_root_calc == public_inputs.utxo_root);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/circuits/transaction_wrapper/Nargo.toml
0 → 100644
View file @
a266b32d
[package]
name
=
"transaction_wrapper"
type
=
"bin"
authors
=
[""]
compiler_version
=
">=0.19.2"
[dependencies]
helpers
=
{
path
=
"../helpers"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/circuits/transaction_wrapper/Prover.toml
0 → 100644
View file @
a266b32d
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/circuits/transaction_wrapper/Verifier.toml
0 → 100644
View file @
a266b32d
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/circuits/transaction_wrapper/src/main.nr
0 → 100644
View file @
a266b32d
use dep::std;
use dep::helpers;
use dep::helpers::hash;
use dep::helpers::structs;
global tx_vkHash: Field = 0x2e592c2ade5527a4aaa1a68b75bdff97876a8bc89c8d41a704f1e2b23a82b698;
#[recursive]
fn main(
public_inputs_hash: pub Field,
transaction_verifier: structs::VerifierTx
) {
assert(transaction_verifier.key_hash == tx_vkHash);
std::verify_proof(
transaction_verifier.verification_key.as_slice(),
transaction_verifier.proof.as_slice(),
[public_inputs_hash].as_slice(),
transaction_verifier.key_hash
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
pragma
solidity
^
0.8
.
0
;
interface
AggregatorInterface
{
function
latestAnswer
()
external
view
returns
(
int256
);
function
latestTimestamp
()
external
view
returns
(
uint256
);
function
latestRound
()
external
view
returns
(
uint256
);
function
getAnswer
(
uint256
roundId
)
external
view
returns
(
int256
);
function
getTimestamp
(
uint256
roundId
)
external
view
returns
(
uint256
);
event
AnswerUpdated
(
int256
indexed
current
,
uint256
indexed
roundId
,
uint256
updatedAt
);
event
NewRound
(
uint256
indexed
roundId
,
address
indexed
startedBy
,
uint256
startedAt
);
}
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
pragma
solidity
^
0.8
.
0
;
import
"./AggregatorInterface.sol"
;
import
"./AggregatorV3Interface.sol"
;
interface
AggregatorV2V3Interface
is
AggregatorInterface
,
AggregatorV3Interface
{}
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
pragma
solidity
^
0.8
.
0
;
interface
AggregatorV3Interface
{
function
decimals
()
external
view
returns
(
uint8
);
function
description
()
external
view
returns
(
string
memory
);
function
version
()
external
view
returns
(
uint256
);
function
getRoundData
(
uint80
_roundId
)
external
view
returns
(
uint80
roundId
,
int256
answer
,
uint256
startedAt
,
uint256
updatedAt
,
uint80
answeredInRound
);
function
latestRoundData
()
external
view
returns
(
uint80
roundId
,
int256
answer
,
uint256
startedAt
,
uint256
updatedAt
,
uint80
answeredInRound
);
}
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma
solidity
^
0.8
.
20
;
import
{
ContextUpgradeable
}
from
"../utils/ContextUpgradeable.sol"
;
import
{
Initializable
}
from
"../proxy/utils/Initializable.sol"
;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract
contract
OwnableUpgradeable
is
Initializable
,
ContextUpgradeable
{
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct
OwnableStorage
{
address
_owner
;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32
private
constant
OwnableStorageLocation
=
0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300
;
function
_getOwnableStorage
()
private
pure
returns
(
OwnableStorage
storage
$
)
{
assembly
{
$
.
slot
:=
OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error
OwnableUnauthorizedAccount
(
address
account
);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error
OwnableInvalidOwner
(
address
owner
);
event
OwnershipTransferred
(
address
indexed
previousOwner
,
address
indexed
newOwner
);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function
__Ownable_init
(
address
initialOwner
)
internal
onlyInitializing
{
__Ownable_init_unchained
(
initialOwner
);
}
function
__Ownable_init_unchained
(
address
initialOwner
)
internal
onlyInitializing
{
if
(
initialOwner
==
address
(
0
))
{
revert
OwnableInvalidOwner
(
address
(
0
));
}
_transferOwnership
(
initialOwner
);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier
onlyOwner
()
{
_checkOwner
();
_
;
}
/**
* @dev Returns the address of the current owner.
*/
function
owner
()
public
view
virtual
returns
(
address
)
{
OwnableStorage
storage
$
=
_getOwnableStorage
();
return
$
.
_owner
;
}
/**
* @dev Throws if the sender is not the owner.
*/
function
_checkOwner
()
internal
view
virtual
{
if
(
owner
()
!=
_msgSender
())
{
revert
OwnableUnauthorizedAccount
(
_msgSender
());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function
renounceOwnership
()
public
virtual
onlyOwner
{
_transferOwnership
(
address
(
0
));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function
transferOwnership
(
address
newOwner
)
public
virtual
onlyOwner
{
if
(
newOwner
==
address
(
0
))
{
revert
OwnableInvalidOwner
(
address
(
0
));
}
_transferOwnership
(
newOwner
);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function
_transferOwnership
(
address
newOwner
)
internal
virtual
{
OwnableStorage
storage
$
=
_getOwnableStorage
();
address
oldOwner
=
$
.
_owner
;
$
.
_owner
=
newOwner
;
emit
OwnershipTransferred
(
oldOwner
,
newOwner
);
}
}
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma
solidity
^
0.8
.
20
;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract
contract
Initializable
{
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct
InitializableStorage
{
/**
* @dev Indicates that the contract has been initialized.
*/
uint64
_initialized
;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool
_initializing
;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32
private
constant
INITIALIZABLE_STORAGE
=
0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00
;
/**
* @dev The contract is already initialized.
*/
error
InvalidInitialization
();
/**
* @dev The contract is not initializing.
*/
error
NotInitializing
();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event
Initialized
(
uint64
version
);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier
initializer
()
{
// solhint-disable-next-line var-name-mixedcase
InitializableStorage
storage
$
=
_getInitializableStorage
();
// Cache values to avoid duplicated sloads
bool
isTopLevelCall
=
!
$
.
_initializing
;
uint64
initialized
=
$
.
_initialized
;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool
initialSetup
=
initialized
==
0
&&
isTopLevelCall
;
bool
construction
=
initialized
==
1
&&
address
(
this
).
code
.
length
==
0
;
if
(
!
initialSetup
&&
!
construction
)
{
revert
InvalidInitialization
();
}
$
.
_initialized
=
1
;
if
(
isTopLevelCall
)
{
$
.
_initializing
=
true
;
}
_
;
if
(
isTopLevelCall
)
{
$
.
_initializing
=
false
;
emit
Initialized
(
1
);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier
reinitializer
(
uint64
version
)
{
// solhint-disable-next-line var-name-mixedcase
InitializableStorage
storage
$
=
_getInitializableStorage
();
if
(
$
.
_initializing
||
$
.
_initialized
>=
version
)
{
revert
InvalidInitialization
();
}
$
.
_initialized
=
version
;
$
.
_initializing
=
true
;
_
;
$
.
_initializing
=
false
;
emit
Initialized
(
version
);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier
onlyInitializing
()
{
_checkInitializing
();
_
;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function
_checkInitializing
()
internal
view
virtual
{
if
(
!
_isInitializing
())
{
revert
NotInitializing
();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function
_disableInitializers
()
internal
virtual
{
// solhint-disable-next-line var-name-mixedcase
InitializableStorage
storage
$
=
_getInitializableStorage
();
if
(
$
.
_initializing
)
{
revert
InvalidInitialization
();
}
if
(
$
.
_initialized
!=
type
(
uint64
).
max
)
{
$
.
_initialized
=
type
(
uint64
).
max
;
emit
Initialized
(
type
(
uint64
).
max
);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function
_getInitializedVersion
()
internal
view
returns
(
uint64
)
{
return
_getInitializableStorage
().
_initialized
;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function
_isInitializing
()
internal
view
returns
(
bool
)
{
return
_getInitializableStorage
().
_initializing
;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function
_getInitializableStorage
()
private
pure
returns
(
InitializableStorage
storage
$
)
{
assembly
{
$
.
slot
:=
INITIALIZABLE_STORAGE
}
}
}
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)
pragma
solidity
^
0.8
.
20
;
import
{
IERC1822Proxiable
}
from
"@openzeppelin/contracts/interfaces/draft-IERC1822.sol"
;
import
{
ERC1967Utils
}
from
"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"
;
import
{
Initializable
}
from
"./Initializable.sol"
;
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*/
abstract
contract
UUPSUpgradeable
is
Initializable
,
IERC1822Proxiable
{
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address
private
immutable
__self
=
address
(
this
);
/**
* @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
* and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
* while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
* If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
* be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
* during an upgrade.
*/
string
public
constant
UPGRADE_INTERFACE_VERSION
=
"5.0.0"
;
/**
* @dev The call is from an unauthorized context.
*/
error
UUPSUnauthorizedCallContext
();
/**
* @dev The storage `slot` is unsupported as a UUID.
*/
error
UUPSUnsupportedProxiableUUID
(
bytes32
slot
);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier
onlyProxy
()
{
_checkProxy
();
_
;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier
notDelegated
()
{
_checkNotDelegated
();
_
;
}
function
__UUPSUpgradeable_init
()
internal
onlyInitializing
{
}
function
__UUPSUpgradeable_init_unchained
()
internal
onlyInitializing
{
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function
proxiableUUID
()
external
view
virtual
notDelegated
returns
(
bytes32
)
{
return
ERC1967Utils
.
IMPLEMENTATION_SLOT
;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function
upgradeToAndCall
(
address
newImplementation
,
bytes
memory
data
)
public
payable
virtual
onlyProxy
{
_authorizeUpgrade
(
newImplementation
);
_upgradeToAndCallUUPS
(
newImplementation
,
data
);
}
/**
* @dev Reverts if the execution is not performed via delegatecall or the execution
* context is not of a proxy with an ERC1967-compliant implementation pointing to self.
* See {_onlyProxy}.
*/
function
_checkProxy
()
internal
view
virtual
{
if
(
address
(
this
)
==
__self
||
// Must be called through delegatecall
ERC1967Utils
.
getImplementation
()
!=
__self
// Must be called through an active proxy
)
{
revert
UUPSUnauthorizedCallContext
();
}
}
/**
* @dev Reverts if the execution is performed via delegatecall.
* See {notDelegated}.
*/
function
_checkNotDelegated
()
internal
view
virtual
{
if
(
address
(
this
)
!=
__self
)
{
// Must not be called through delegatecall
revert
UUPSUnauthorizedCallContext
();
}
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal onlyOwner {}
* ```
*/
function
_authorizeUpgrade
(
address
newImplementation
)
internal
virtual
;
/**
* @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
*
* As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
* is expected to be the implementation slot in ERC1967.
*
* Emits an {IERC1967-Upgraded} event.
*/
function
_upgradeToAndCallUUPS
(
address
newImplementation
,
bytes
memory
data
)
private
{
try
IERC1822Proxiable
(
newImplementation
).
proxiableUUID
()
returns
(
bytes32
slot
)
{
if
(
slot
!=
ERC1967Utils
.
IMPLEMENTATION_SLOT
)
{
revert
UUPSUnsupportedProxiableUUID
(
slot
);
}
ERC1967Utils
.
upgradeToAndCall
(
newImplementation
,
data
);
}
catch
{
// The implementation is not UUPS
revert
ERC1967Utils
.
ERC1967InvalidImplementation
(
newImplementation
);
}
}
}
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma
solidity
^
0.8
.
20
;
import
{
Initializable
}
from
"../proxy/utils/Initializable.sol"
;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract
contract
ContextUpgradeable
is
Initializable
{
function
__Context_init
()
internal
onlyInitializing
{
}
function
__Context_init_unchained
()
internal
onlyInitializing
{
}
function
_msgSender
()
internal
view
virtual
returns
(
address
)
{
return
msg
.
sender
;
}
function
_msgData
()
internal
view
virtual
returns
(
bytes
calldata
)
{
return
msg
.
data
;
}
function
_contextSuffixLength
()
internal
view
virtual
returns
(
uint256
)
{
return
0
;
}
}
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol
0 → 100644
View file @
a266b32d
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol
0 → 100644
View file @
a266b32d
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts/interfaces/IERC5267.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)
pragma
solidity
^
0.8
.
20
;
interface
IERC5267
{
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event
EIP712DomainChanged
();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function
eip712Domain
()
external
view
returns
(
bytes1
fields
,
string
memory
name
,
string
memory
version
,
uint256
chainId
,
address
verifyingContract
,
bytes32
salt
,
uint256
[]
memory
extensions
);
}
This diff is collapsed.
Click to expand it.
frontend/momiji-helpers/contracts/.deps/npm/@openzeppelin/contracts/interfaces/draft-IERC1822.sol
0 → 100644
View file @
a266b32d
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)
pragma
solidity
^
0.8
.
20
;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface
IERC1822Proxiable
{
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function
proxiableUUID
()
external
view
returns
(
bytes32
);
}
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
6
7
…
28
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment