Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix serialize error #936

Open
wants to merge 2 commits into
base: feat-zkcards
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ num_enum = { version = "0.5.4", default-features = false }
slices = "0.2.0"
config = { path = "../../../../../config" }
num = { version = "0.3", features = ["alloc"] }
starknet-curve = { git = "https://github.com/geometryresearch/proof-toolbox.git" }
barnett-smart-card-protocol = { git = "https://github.com/HarryLiIsMe/mental-poker.git", branch = "mercury-fix" }
starknet-curve = { git = "https://github.com/geometryresearch/proof-toolbox.git", branch = "fix/schnorr_affine" }
barnett-smart-card-protocol = { git = "https://github.com/FindoraNetwork/mental-poker.git", branch = "mercury-serialize-error-fix" }
ark-serialize = "0.3.0"
proof-essentials = { git = "https://github.com/FindoraNetwork/proof-toolbox.git", branch = "findora" }
proof-essentials = { git = "https://github.com/HarryLiIsMe/findora-proof-toolbox.git", branch = "findora" }
ark-ec = "0.3.0"
rand = "0.8"
ark-std = { version = "0.3.0", features = ["std"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use evm_precompile_utils::{
use module_evm::precompile::{FinState, Precompile, PrecompileId, PrecompileResult};
use num::Zero;
use rand::thread_rng;
use slices::u8_slice;
// use slices::u8_slice;
use std::vec;
use tracing::debug;

Expand Down Expand Up @@ -56,31 +56,6 @@ type CRevealProof = ProofB<CCurve>;
type CProof = ProofC<CCurve>;
type CCard = Card<CCurve>;

/// ZkCard transfer event selector, Keccak256("Transfer(address,address,uint256)")
///
/// event Transfer(address indexed from, address indexed to, uint256 value);
pub const TRANSFER_EVENT_SELECTOR: &[u8; 32] =
u8_slice!("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef");

/// ZkCard approval event selector, Keccak256("Approval(address,address,uint256)")
///
/// event Approval(address indexed owner, address indexed spender, uint256 value);
pub const APPROVAL_EVENT_SELECTOR: &[u8; 32] =
u8_slice!("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925");

/// b"Findora"
pub const ZKCARD_NAME: &[u8; 96] = u8_slice!(
"0x00000000000000000000000000000000000000000000000000000000000000200000000000000\
00000000000000000000000000000000000000000000000000746696e646f7261000000000000000\
00000000000000000000000000000000000"
);

/// b"FRA"
pub const ZKCARD_SYMBOL: &[u8; 96] = u8_slice!(
"0x00000000000000000000000000000000000000000000000000000000000000200000000000000\
00000000000000000000000000000000000000000000000000346524100000000000000000000000\
00000000000000000000000000000000000"
);

// The gas used value is obtained according to the standard erc20 call.
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.2/contracts/token/ERC20/ERC20.sol
Expand Down
Loading