From fc0146316bd603e493ef464aea902a1e9429af70 Mon Sep 17 00:00:00 2001 From: Hamza Khalid Date: Mon, 15 Jun 2026 21:04:00 +0500 Subject: [PATCH 1/2] chore: rename token to FOLD --- crates/cli/src/ciphernode/license.rs | 4 +- crates/cli/src/ciphernode/lifecycle.rs | 4 +- crates/cli/src/ciphernode/mod.rs | 6 +- crates/cli/src/main.rs | 20 ++-- crates/evm-helpers/src/contracts.rs | 8 +- crates/sortition/Readme.md | 2 +- docs/pages/architecture-overview.mdx | 2 +- .../exits-and-slashing.mdx | 8 +- docs/pages/ciphernode-operators/index.mdx | 24 ++-- .../ciphernode-operators/registration.mdx | 20 ++-- docs/pages/ciphernode-operators/running.mdx | 2 +- .../tickets-and-sortition.mdx | 14 +-- docs/pages/tutorials/deploy-to-testnet.mdx | 4 +- docs/pages/tutorials/manage-tickets.mdx | 4 +- docs/pages/tutorials/using-the-dashboard.mdx | 2 +- examples/CRISP/interfold.config.yaml | 18 +-- .../packages/crisp-contracts/deploy/crisp.ts | 2 +- .../crisp-contracts/deployed_contracts.json | 103 ++++++------------ examples/CRISP/server/src/cli/commands.rs | 2 +- .../CRISP/server/src/server/routes/rounds.rs | 2 +- packages/interfold-contracts/README.md | 8 +- .../IBondingRegistry.json | 2 +- .../ICiphernodeRegistry.json | 2 +- .../interfaces/IInterfold.sol/IInterfold.json | 67 +++--------- .../ISlashingManager.json | 2 +- .../contracts/E3RefundManager.sol | 3 - .../contracts/Interfold.sol | 11 +- .../contracts/interfaces/IBondingRegistry.sol | 6 +- .../contracts/interfaces/IInterfold.sol | 25 ++--- .../contracts/registry/BondingRegistry.sol | 4 +- .../contracts/token/InterfoldTicketToken.sol | 6 +- .../contracts/token/InterfoldToken.sol | 10 +- .../scripts/deployInterfold.ts | 16 +-- .../interfold-contracts/tasks/ciphernode.ts | 54 ++++----- .../interfold-contracts/tasks/interfold.ts | 2 +- .../test/E3Lifecycle/E3Integration.spec.ts | 8 +- .../test/Interfold.spec.ts | 53 ++------- .../test/Registry/BondingRegistry.spec.ts | 14 +-- .../test/Slashing/CommitteeExpulsion.spec.ts | 8 +- .../test/Token/InterfoldToken.spec.ts | 2 +- .../test/fixtures/system.ts | 2 +- packages/interfold-sdk/src/events/types.ts | 3 +- templates/default/deploy/default.ts | 2 +- 43 files changed, 214 insertions(+), 347 deletions(-) diff --git a/crates/cli/src/ciphernode/license.rs b/crates/cli/src/ciphernode/license.rs index 680a118bd..8ad1b7047 100644 --- a/crates/cli/src/ciphernode/license.rs +++ b/crates/cli/src/ciphernode/license.rs @@ -34,7 +34,7 @@ pub(crate) async fn execute( .await?; log!( out, - "Queued {} INTF for exit (tx: {:#x})", + "Queued {} FOLD for exit (tx: {:#x})", amount, receipt.transaction_hash ); @@ -93,7 +93,7 @@ async fn bond_license(out: Console, ctx: &ChainContext, amount: &str) -> Result< .await?; log!( out, - "Bonded {} INTF (tx: {:#x})", + "Bonded {} FOLD (tx: {:#x})", amount, receipt.transaction_hash ); diff --git a/crates/cli/src/ciphernode/lifecycle.rs b/crates/cli/src/ciphernode/lifecycle.rs index bd4fe495c..a855e871a 100644 --- a/crates/cli/src/ciphernode/lifecycle.rs +++ b/crates/cli/src/ciphernode/lifecycle.rs @@ -92,7 +92,7 @@ pub(crate) async fn deactivate( .await?; log!( out, - "Queued {} INTF for exit (tx: {:#x})", + "Queued {} FOLD for exit (tx: {:#x})", amount, receipt.transaction_hash ); @@ -150,7 +150,7 @@ pub(crate) async fn status(out: Console, ctx: &ChainContext) -> Result<()> { ); log!( out, - " Requirements: minTickets={}, ticketPrice={} EKT, licenseBond={} INTF", + " Requirements: minTickets={}, ticketPrice={} EKT, licenseBond={} FOLD", format_amount(min_ticket_balance, ticket_decimals), format_amount(ticket_price, ticket_decimals), format_amount(license_required, license_decimals) diff --git a/crates/cli/src/ciphernode/mod.rs b/crates/cli/src/ciphernode/mod.rs index 52e26e139..4c96838da 100644 --- a/crates/cli/src/ciphernode/mod.rs +++ b/crates/cli/src/ciphernode/mod.rs @@ -51,7 +51,7 @@ pub enum CiphernodeCommands { #[arg(short='k', long, value_parser = ensure_hex_zeroizing)] private_key: Option>, }, - /// Manage INTF license tokens and bonding state + /// Manage FOLD license tokens and bonding state License { #[command(subcommand)] command: LicenseCommands, @@ -98,12 +98,12 @@ pub enum CiphernodeCommands { #[derive(Subcommand, Clone, Debug)] pub enum LicenseCommands { - /// Bond INTF into the bonding registry + /// Bond FOLD into the bonding registry Bond { #[arg(long = "amount")] amount: String, }, - /// Unbond INTF (moves stake to the exit queue) + /// Unbond FOLD (moves stake to the exit queue) Unbond { #[arg(long = "amount")] amount: String, diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index bc7958d61..f16a41664 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -46,17 +46,15 @@ mod wallet_get; mod wallet_set; const OWO: &str = r#" - ___ ___ ___ ___ ___ - /\__\ /\ \ /\__\ /\ \ ___ /\__\ - /:/ _/_ \:\ \ /:/ / /::\ \ /\ \ /:/ _/_ - /:/ /\__\ \:\ \ /:/ / /:/\:\ \ \:\ \ /:/ /\__\ - /:/ /:/ _/_ _____\:\ \ /:/ / ___ ___ ___ /:/ /::\ \ \:\ \ /:/ /:/ _/_ - /:/_/:/ /\__\ /::::::::\__\ /:/__/ /\__\ /\ \ /\__\ /:/_/:/\:\__\ ___ \:\__\ /:/_/:/ /\__\ - \:\/:/ /:/ / \:\~~\~~\/__/ \:\ \ /:/ / \:\ \ /:/ / \:\/:/ \/__/ /\ \ |:| | \:\/:/ /:/ / - \::/_/:/ / \:\ \ \:\ /:/ / \:\ /:/ / \::/__/ \:\ \|:| | \::/_/:/ / - \:\/:/ / \:\ \ \:\/:/ / \:\/:/ / \:\ \ \:\__|:|__| \:\/:/ / - \::/ / \:\__\ \::/ / \::/ / \:\__\ \::::/__/ \::/ / - \/__/ \/__/ \/__/ \/__/ \/__/ ~~~~ \/__/ +╔═════════════════════════════════════════════════════════════════════════════╗ + + ██╗███╗ ██╗████████╗███████╗██████╗ ███████╗ ██████╗ ██╗ ██████╗ + ██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗██╔════╝██╔═══██╗██║ ██╔══██╗ + ██║██╔██╗ ██║ ██║ █████╗ ██████╔╝█████╗ ██║ ██║██║ ██║ ██║ + ██║██║╚██╗██║ ██║ ██╔══╝ ██╔══██╗██╔══╝ ██║ ██║██║ ██║ ██║ + ██║██║ ╚████║ ██║ ███████╗██║ ██║██║ ╚██████╔╝███████╗██████╔╝ + ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚══════╝╚═════╝ +╚════════════════════════════[ I N T E R F O L D ]════════════════════════════╝ "#; diff --git a/crates/evm-helpers/src/contracts.rs b/crates/evm-helpers/src/contracts.rs index b6ed55cce..dd4e9d4db 100644 --- a/crates/evm-helpers/src/contracts.rs +++ b/crates/evm-helpers/src/contracts.rs @@ -124,7 +124,7 @@ sol! { uint256 public nexte3Id = 0; mapping(address e3Program => bool allowed) public e3Programs; function request(E3RequestParams calldata requestParams) external returns (uint256 e3Id, E3 memory e3); - function enableE3Program(address e3Program) public returns (bool success); + function registerE3Program(address e3Program) public; function publishCiphertextOutput(uint256 e3Id, bytes calldata ciphertextOutput, bytes calldata proof) external returns (bool success); function publishPlaintextOutput(uint256 e3Id, bytes calldata data, bytes calldata proof) external returns (bool success); function getE3(uint256 e3Id) external view returns (E3 memory e3); @@ -195,7 +195,7 @@ pub trait InterfoldWrite { ) -> Result<(TransactionReceipt, U256)>; /// Enable an E3 program - async fn enable_e3_program(&self, e3_program: Address) -> Result; + async fn register_e3_program(&self, e3_program: Address) -> Result; /// Publish ciphertext output with proof async fn publish_ciphertext_output( @@ -469,7 +469,7 @@ impl InterfoldWrite for InterfoldContract { Ok((receipt, e3_id)) } - async fn enable_e3_program(&self, e3_program: Address) -> Result { + async fn register_e3_program(&self, e3_program: Address) -> Result { let _guard = NONCE_LOCK.lock().await; let wallet_addr = self .wallet_address @@ -477,7 +477,7 @@ impl InterfoldWrite for InterfoldContract { let nonce = get_next_nonce(&*self.provider, wallet_addr).await?; let contract = Interfold::new(self.contract_address, &self.provider); - let builder = contract.enableE3Program(e3_program).nonce(nonce); + let builder = contract.registerE3Program(e3_program).nonce(nonce); let receipt = builder.send().await?.get_receipt().await?; Ok(receipt) diff --git a/crates/sortition/Readme.md b/crates/sortition/Readme.md index b61e13a66..253790cdd 100644 --- a/crates/sortition/Readme.md +++ b/crates/sortition/Readme.md @@ -36,7 +36,7 @@ sequenceDiagram Note over Operator,BondingRegistry: Phase 1: Operator Setup & Registration Operator->>BondingRegistry: bondLicense(amount) - BondingRegistry->>BondingRegistry: Transfer INTF tokens + BondingRegistry->>BondingRegistry: Transfer FOLD tokens BondingRegistry->>EventBus: LicenseBondUpdated Operator->>BondingRegistry: registerOperator() diff --git a/docs/pages/architecture-overview.mdx b/docs/pages/architecture-overview.mdx index d2df1b055..e8ce50e36 100644 --- a/docs/pages/architecture-overview.mdx +++ b/docs/pages/architecture-overview.mdx @@ -53,7 +53,7 @@ components and workflows involved in executing E3 computations. #### Bonding Registry Contract -- Manages operator license bonds (INTF tokens) and ticket balances (ITK) +- Manages operator license bonds (FOLD tokens) and ticket balances (tFOLD) - Handles operator registration and deregistration - Enforces minimum bond and ticket requirements for active status - Processes exit queues with configurable delay periods diff --git a/docs/pages/ciphernode-operators/exits-and-slashing.mdx b/docs/pages/ciphernode-operators/exits-and-slashing.mdx index dbb645fc5..7c03fa0df 100644 --- a/docs/pages/ciphernode-operators/exits-and-slashing.mdx +++ b/docs/pages/ciphernode-operators/exits-and-slashing.mdx @@ -58,7 +58,7 @@ Each slash reason has an associated policy: ```solidity struct SlashPolicy { uint256 ticketPenalty; // Tickets to burn - uint256 licensePenalty; // INTF to confiscate + uint256 licensePenalty; // FOLD to confiscate bool requiresProof; // Whether on-chain proof verification is needed address proofVerifier; // ISlashVerifier contract for proof validation bool banNode; // Whether to permanently ban the node @@ -86,8 +86,8 @@ struct SlashPolicy { | Penalty Type | Effect | | --------------- | ------------------------------------------------ | -| Ticket penalty | Burns ITK from your balance | -| License penalty | Confiscates INTF from your bond | +| Ticket penalty | Burns tFOLD from your balance | +| License penalty | Confiscates FOLD from your bond | | Ban | Prevents re-registration until governance clears | > Some policies have an `appealWindow` of 0, meaning execution is immediate with no appeal. Always @@ -112,7 +112,7 @@ Assets enter a queue with a delay period (7 days on Sepolia): | Asset | Behavior | | ------- | ------------------------------------- | | Tickets | Burned immediately, USDC enters queue | -| License | INTF enters exit queue | +| License | FOLD enters exit queue | Check your exit status: diff --git a/docs/pages/ciphernode-operators/index.mdx b/docs/pages/ciphernode-operators/index.mdx index 7cebaa66a..a8d17e1ab 100644 --- a/docs/pages/ciphernode-operators/index.mdx +++ b/docs/pages/ciphernode-operators/index.mdx @@ -27,15 +27,15 @@ malicious behavior. The Interfold protocol uses several contracts that work together: -| Contract | Purpose | -| ------------------------ | ------------------------------------------------------------------------------ | -| **Interfold** | Core coordinator that manages E3 requests and computation lifecycle | -| **CiphernodeRegistry** | Tracks registered operators and manages committee formation | -| **BondingRegistry** | Handles license bonds (INTF) and ticket balances (ITK) | -| **SlashingManager** | Processes slashing proposals, appeals, and ban enforcement | -| **E3RefundManager** | Calculates and distributes refunds when an E3 fails | -| **InterfoldToken** | INTF token used for license bonding | -| **InterfoldTicketToken** | Non-transferable ITK token representing ticket balances (backed by stablecoin) | +| Contract | Purpose | +| ------------------------ | -------------------------------------------------------------------------------- | +| **Interfold** | Core coordinator that manages E3 requests and computation lifecycle | +| **CiphernodeRegistry** | Tracks registered operators and manages committee formation | +| **BondingRegistry** | Handles license bonds (FOLD) and ticket balances (tFOLD) | +| **SlashingManager** | Processes slashing proposals, appeals, and ban enforcement | +| **E3RefundManager** | Calculates and distributes refunds when an E3 fails | +| **InterfoldToken** | FOLD token used for license bonding | +| **InterfoldTicketToken** | Non-transferable tFOLD token representing ticket balances (backed by stablecoin) | ### Sepolia Contract Addresses @@ -47,7 +47,7 @@ The Interfold protocol uses several contracts that work together: | SlashingManager | `0x0553387EE0992Fe339579728B6c777164fD1de40` | 10939868 | | E3RefundManager | `0xD327ec50C7a8909f90DE15fe53872e88B4948Ee0` | 10939876 | | InterfoldTicketToken | `0x2446f2AC9632f17af96053e48dEDff44b50711Ea` | 10939867 | -| InterfoldToken (INTF) | `0xbAb3220FD04a193a192F07879673597Cd695Cb03` | 10939866 | +| InterfoldToken (FOLD) | `0xbAb3220FD04a193a192F07879673597Cd695Cb03` | 10939866 | | MockUSDC (fee token) | `0x2721Cdf281d40744aD567cBf3e7100F60bcbAE79` | 10939865 | The DKG and decryption aggregator circuits are deployed as the sole on-chain verifiers for BFV @@ -86,7 +86,7 @@ stateDiagram-v2 | State | Description | | --------------- | ---------------------------------------------------------------------------------- | | **Unbonded** | No license bond deposited; cannot register | -| **Licensed** | INTF bonded but not yet registered in the registry | +| **Licensed** | FOLD bonded but not yet registered in the registry | | **Registered** | In the registry but lacking minimum ticket balance | | **Active** | Fully operational; eligible for committee selection via sortition | | **Inactive** | Registered but below minimum requirements (tickets or license bond) | @@ -98,7 +98,7 @@ Before operating a ciphernode, ensure you have: | Requirement | Details | | --------------- | ------------------------------------------------------------------------ | -| **INTF Tokens** | At least `100 INTF` for the license bond (check `licenseRequiredBond()`) | +| **FOLD Tokens** | At least `100 FOLD` for the license bond (check `licenseRequiredBond()`) | | **Stablecoin** | USDC (or configured fee token) for tickets; minimum 1 ticket worth | | **ETH** | Gas for transactions on your target network | | **Hardware** | Linux/macOS, 4+ cores, 16GB+ RAM, stable internet with open UDP port | diff --git a/docs/pages/ciphernode-operators/registration.mdx b/docs/pages/ciphernode-operators/registration.mdx index 3cca81e15..2a0f5ef3a 100644 --- a/docs/pages/ciphernode-operators/registration.mdx +++ b/docs/pages/ciphernode-operators/registration.mdx @@ -14,7 +14,7 @@ Before registering, ensure your wallet has: | Token | Amount Required | Purpose | | ----------------------- | ---------------------------------------- | ---------------------------- | -| **INTF** | ≥ 100 INTF (check `licenseRequiredBond`) | License bond collateral | +| **FOLD** | ≥ 100 FOLD (check `licenseRequiredBond`) | License bond collateral | | **USDC** (or fee token) | ≥ 10 USDC per ticket (minimum 1 ticket) | Ticket balance for sortition | | **ETH** | Sufficient for gas | Transaction fees | @@ -39,12 +39,12 @@ Ciphernode status on sepolia: Ticket balance: 0 (0 available) License bond: 0 Pending exits: tickets=0, license=0 - Requirements: minTickets=1, ticketPrice=10 ITK, licenseBond=100 INTF + Requirements: minTickets=1, ticketPrice=10 tFOLD, licenseBond=100 FOLD ``` ### Step 2: Bond Your License -Bond INTF tokens to meet the license requirement: +Bond FOLD tokens to meet the license requirement: ```bash interfold ciphernode license bond --amount 100 @@ -52,7 +52,7 @@ interfold ciphernode license bond --amount 100 This command: -- Approves the BondingRegistry to spend your INTF (if needed) +- Approves the BondingRegistry to spend your FOLD (if needed) - Calls `bondLicense(100e18)` on the BondingRegistry contract > You can bond more than the minimum for a buffer against slashing. The active license floor is 80% @@ -77,7 +77,7 @@ Purchase tickets by depositing the underlying stablecoin: interfold ciphernode tickets buy --amount 100 ``` -This deposits 100 USDC (or fee token units) and mints the equivalent in non-transferable ITK +This deposits 100 USDC (or fee token units) and mints the equivalent in non-transferable tFOLD (InterfoldTicketToken). The number of usable tickets is calculated as: @@ -107,7 +107,7 @@ Ciphernode status on sepolia: Ticket balance: 100 (10 available) License bond: 100 Pending exits: tickets=0, license=0 - Requirements: minTickets=1, ticketPrice=10 ITK, licenseBond=100 INTF + Requirements: minTickets=1, ticketPrice=10 tFOLD, licenseBond=100 FOLD ``` ## CLI Command Reference @@ -115,10 +115,10 @@ Ciphernode status on sepolia: ### License Commands ```bash -# Bond INTF tokens +# Bond FOLD tokens interfold ciphernode license bond --amount -# Unbond INTF (moves to exit queue) +# Unbond FOLD (moves to exit queue) interfold ciphernode license unbond --amount # Claim unlocked exits @@ -173,7 +173,7 @@ Current Sepolia defaults (verify on-chain before depositing): | Parameter | Value | Description | | --------------------- | -------------------- | ---------------------------------- | | `ticketPrice` | 10,000,000 (10 USDC) | Cost per ticket in fee token units | -| `licenseRequiredBond` | 100 INTF | Minimum INTF to bond | +| `licenseRequiredBond` | 100 FOLD | Minimum FOLD to bond | | `minTicketBalance` | 1 ticket | Minimum tickets to be active | | `exitDelay` | 604,800s (7 days) | Wait time before claiming exits | @@ -212,7 +212,7 @@ status changes due to balance or bond updates. | Issue | Cause | Solution | | ------------------------- | --------------------------------------- | ---------------------------------------------------- | -| `isActive` is false | Below minimum license (80%) or tickets | Add more INTF or tickets | +| `isActive` is false | Below minimum license (80%) or tickets | Add more FOLD or tickets | | Registration fails | Already registered, banned, or unbonded | Check `isRegistered()`, ban status, and license bond | | Ticket purchase fails | Insufficient stablecoin or allowance | Ensure balance and approve spending | | "NodeNotEligible" in logs | Not registered before E3 request | Register before requests are made | diff --git a/docs/pages/ciphernode-operators/running.mdx b/docs/pages/ciphernode-operators/running.mdx index f8b5c7246..3ec274441 100644 --- a/docs/pages/ciphernode-operators/running.mdx +++ b/docs/pages/ciphernode-operators/running.mdx @@ -366,5 +366,5 @@ Control verbosity with the `-v` flag: Once your node is running: -1. **[Register & License](./registration)** - Bond INTF and register as an operator +1. **[Register & License](./registration)** - Bond FOLD and register as an operator 2. **[Add Tickets](./tickets-and-sortition)** - Purchase tickets to participate in sortition diff --git a/docs/pages/ciphernode-operators/tickets-and-sortition.mdx b/docs/pages/ciphernode-operators/tickets-and-sortition.mdx index 80816892f..9ef9b0fef 100644 --- a/docs/pages/ciphernode-operators/tickets-and-sortition.mdx +++ b/docs/pages/ciphernode-operators/tickets-and-sortition.mdx @@ -10,13 +10,13 @@ ticket system and sortition algorithm. ## Ticket Overview -| Token | Purpose | Transferable | -| -------- | -------------------------------------------------- | ------------ | -| **INTF** | License bond - required to register | Yes | -| **ITK** | Ticket token - determines committee selection odds | No | -| **USDC** | Underlying asset for tickets (fee token) | Yes | +| Token | Purpose | Transferable | +| --------- | -------------------------------------------------- | ------------ | +| **FOLD** | License bond - required to register | Yes | +| **tFOLD** | Ticket token - determines committee selection odds | No | +| **USDC** | Underlying asset for tickets (fee token) | Yes | -Tickets are priced in stablecoins and minted into non-transferable ITK balances: +Tickets are priced in stablecoins and minted into non-transferable tFOLD balances: ``` availableTickets = floor(ticketTokenBalance / ticketPrice) @@ -37,7 +37,7 @@ This: 1. Approves the ticket contract to spend your USDC (if needed) 2. Deposits the stablecoin -3. Mints equivalent ITK to your balance +3. Mints equivalent tFOLD to your balance ### Burn Tickets diff --git a/docs/pages/tutorials/deploy-to-testnet.mdx b/docs/pages/tutorials/deploy-to-testnet.mdx index 973ace267..a2c7f491a 100644 --- a/docs/pages/tutorials/deploy-to-testnet.mdx +++ b/docs/pages/tutorials/deploy-to-testnet.mdx @@ -27,9 +27,9 @@ You'll need: [sepoliafaucet.com](https://sepoliafaucet.com), [Google Cloud faucet](https://cloud.google.com/application/web3/faucet/ethereum/sepolia), or [PoW faucet](https://sepolia-faucet.pk910.de). -- **Test INTF** — for ciphernode bonding (only if you're running your own nodes). The mock INTF +- **Test FOLD** — for ciphernode bonding (only if you're running your own nodes). The mock FOLD token is deployed at `0x24b28471AE7BdF1fdBcfDd183c73D13ff0689B99`. Reach out on the - [community Telegram](https://t.me/encaborations) for test INTF. + [community Telegram](https://t.me/encaborations) for test FOLD. - **Test USDC** — for E3 fees and tickets. Mock USDC at `0x01AbD7D8e6547c943c2fE082C3Ce194fDCe57396`. Same channel for tokens. diff --git a/docs/pages/tutorials/manage-tickets.mdx b/docs/pages/tutorials/manage-tickets.mdx index 16b9953cb..a4fff9651 100644 --- a/docs/pages/tutorials/manage-tickets.mdx +++ b/docs/pages/tutorials/manage-tickets.mdx @@ -37,7 +37,7 @@ you'll be selected roughly 10% of the time (assuming no buffer effects). ## Buying Tickets -Deposit stablecoins (USDC or the configured fee token) to mint ticket tokens (ITK): +Deposit stablecoins (USDC or the configured fee token) to mint ticket tokens (tFOLD): ```bash interfold ciphernode tickets buy --amount 100 @@ -47,7 +47,7 @@ This: 1. Approves the ticket contract to spend your stablecoins (if needed) 2. Deposits the stablecoins -3. Mints equivalent ITK to your balance +3. Mints equivalent tFOLD to your balance Your available ticket count is: diff --git a/docs/pages/tutorials/using-the-dashboard.mdx b/docs/pages/tutorials/using-the-dashboard.mdx index 9a57f6f57..9306b69a1 100644 --- a/docs/pages/tutorials/using-the-dashboard.mdx +++ b/docs/pages/tutorials/using-the-dashboard.mdx @@ -111,7 +111,7 @@ how many events are loaded vs. how many match your current filters. Shows your node's operational state: - **Ciphernode status** — active/inactive, current committees, pending exits -- **Wallet** — ETH balance, INTF bond, ticket token balance +- **Wallet** — ETH balance, FOLD bond, ticket token balance Use this to quickly check whether your node is in a healthy state. diff --git a/examples/CRISP/interfold.config.yaml b/examples/CRISP/interfold.config.yaml index 3a11c747e..979c7a2c2 100644 --- a/examples/CRISP/interfold.config.yaml +++ b/examples/CRISP/interfold.config.yaml @@ -5,11 +5,11 @@ chains: rpc_url: ws://localhost:8545 contracts: e3_program: - address: "0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650" - deploy_block: 38 + address: "0xc351628EB244ec633d5f21fBD6621e1a683B1181" + deploy_block: 40 interfold: - address: "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0" - deploy_block: 14 + address: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" + deploy_block: 16 ciphernode_registry: address: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707" deploy_block: 8 @@ -17,14 +17,14 @@ chains: address: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" deploy_block: 9 bonding_registry: - address: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" - deploy_block: 10 + address: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" + deploy_block: 9 slashing_manager: - address: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707" - deploy_block: 8 + address: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9" + deploy_block: 7 fee_token: address: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512" - deploy_block: 4 + deploy_block: 5 program: dev: true # risc0: diff --git a/examples/CRISP/packages/crisp-contracts/deploy/crisp.ts b/examples/CRISP/packages/crisp-contracts/deploy/crisp.ts index 7b0ef0d43..7b66baf79 100644 --- a/examples/CRISP/packages/crisp-contracts/deploy/crisp.ts +++ b/examples/CRISP/packages/crisp-contracts/deploy/crisp.ts @@ -89,7 +89,7 @@ export const deployCRISPContracts = async () => { ) // enable the program on Interfold - const tx = await interfold.enableE3Program(crispAddress) + const tx = await interfold.registerE3Program(crispAddress) await tx.wait() let tokenAddress diff --git a/examples/CRISP/packages/crisp-contracts/deployed_contracts.json b/examples/CRISP/packages/crisp-contracts/deployed_contracts.json index 37f3dc87a..8f50c170b 100644 --- a/examples/CRISP/packages/crisp-contracts/deployed_contracts.json +++ b/examples/CRISP/packages/crisp-contracts/deployed_contracts.json @@ -1,25 +1,15 @@ { "localhost": { "PoseidonT3": { - "blockNumber": 3, - "blockNumber": 3, + "blockNumber": 4, "address": "0x3333333C0A88F9BE4fd23ed0536F9B6c427e3B93" }, "MockUSDC": { "constructorArgs": { "initialSupply": "1000000" }, - "blockNumber": 4, - "blockNumber": 4, - "address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512" - }, - "InterfoldToken": { - "constructorArgs": { - "owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" - }, - "blockNumber": 5, "blockNumber": 5, - "address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" + "address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512" }, "InterfoldTicketToken": { "constructorArgs": { @@ -27,18 +17,16 @@ "registry": "0x0000000000000000000000000000000000000001", "owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" }, - "blockNumber": 7, - "blockNumber": 7, - "address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9" + "blockNumber": 6, + "address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" }, "SlashingManager": { "constructorArgs": { "initialDelay": "172800", "admin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" }, - "blockNumber": 8, - "blockNumber": 8, - "address": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707" + "blockNumber": 7, + "address": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9" }, "CiphernodeRegistryOwnable": { "constructorArgs": { @@ -52,9 +40,8 @@ "proxyAdminAddress": "0x61c36a8d610163660E21a8b7359e1Cac0C9133e1", "implementationAddress": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9" }, - "blockNumber": 9, - "blockNumber": 9, - "address": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" + "blockNumber": 8, + "address": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707" }, "BondingRegistry": { "constructorArgs": { @@ -81,14 +68,14 @@ "InterfoldToken": { "constructorArgs": { "owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "ccaStart": "1781296729", - "ccaEnd": "1781901529", + "ccaStart": "1781542027", + "ccaEnd": "1782146827", "claimSource": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "bondingRegistry": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" + "bondingRegistry": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", + "noMoreLocks": "1912178827" }, - "blockNumber": 10, - "blockNumber": 10, - "address": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" + "blockNumber": 12, + "address": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" }, "Interfold": { "constructorArgs": { @@ -107,9 +94,8 @@ "proxyAdminAddress": "0x32467b43BFa67273FC7dDda0999Ee9A12F2AaA08", "implementationAddress": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0" }, - "blockNumber": 14, - "blockNumber": 14, - "address": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0" + "blockNumber": 16, + "address": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" }, "E3RefundManager": { "constructorArgs": { @@ -124,65 +110,46 @@ "proxyAdminAddress": "0x524F04724632eED237cbA3c37272e018b3A7967e", "implementationAddress": "0x9A676e781A523b5d0C0e43731313A708CB607508" }, - "blockNumber": 16, - "blockNumber": 16, - "address": "0x9A676e781A523b5d0C0e43731313A708CB607508" + "blockNumber": 18, + "address": "0x0B306BF915C4d645ff596e518fAf3F9669b97016" }, "MockComputeProvider": { - "blockNumber": 30, - "address": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570" - "blockNumber": 30, - "address": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570" + "blockNumber": 32, + "address": "0x809d550fca64d94Bd9F66E60752A544199cfAC3D" }, "MockDecryptionVerifier": { - "blockNumber": 31, - "address": "0x809d550fca64d94Bd9F66E60752A544199cfAC3D" - "blockNumber": 31, - "address": "0x809d550fca64d94Bd9F66E60752A544199cfAC3D" + "blockNumber": 33, + "address": "0x4c5859f0F772848b2D91F1D83E2Fe57935348029" }, "MockPkVerifier": { - "blockNumber": 32, - "address": "0x4c5859f0F772848b2D91F1D83E2Fe57935348029" - "blockNumber": 32, - "address": "0x4c5859f0F772848b2D91F1D83E2Fe57935348029" + "blockNumber": 34, + "address": "0x1291Be112d480055DaFd8a610b7d1e203891C274" }, "MockE3Program": { - "blockNumber": 33, - "address": "0x1291Be112d480055DaFd8a610b7d1e203891C274" - "blockNumber": 33, - "address": "0x1291Be112d480055DaFd8a610b7d1e203891C274" + "blockNumber": 35, + "address": "0x5f3f1dBD7B74C6B46e8c44f98792A1dAf8d69154" }, "MockRISC0Verifier": { - "address": "0x82e01223d51Eb87e16A03E24687EDF0F294da6f1", - "blockNumber": 37 - }, - "HonkVerifier": { - "address": "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0", - "blockNumber": 38 + "address": "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3", + "blockNumber": 39 }, "HonkVerifier": { "address": "0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650", "blockNumber": 40 }, "CRISPProgram": { - "address": "0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650", - "blockNumber": 38, - "address": "0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650", - "blockNumber": 38, + "address": "0xc351628EB244ec633d5f21fBD6621e1a683B1181", + "blockNumber": 40, "constructorArgs": { - "interfold": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0", - "verifierAddress": "0x82e01223d51Eb87e16A03E24687EDF0F294da6f1", - "honkVerifierAddress": "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0", - "verifierAddress": "0x82e01223d51Eb87e16A03E24687EDF0F294da6f1", - "honkVerifierAddress": "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0", + "interfold": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82", + "verifierAddress": "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3", + "honkVerifierAddress": "0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650", "imageId": "0x0ad904cfaec1eeefa9b89a11020086ec51454423db1fee3b1ab614fff97368d6" } }, "MockVotingToken": { - "address": "0xFD471836031dc5108809D173A067e8486B9047A3", - "blockNumber": 40 - "address": "0xFD471836031dc5108809D173A067e8486B9047A3", - "blockNumber": 40 + "address": "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc", + "blockNumber": 42 } } } \ No newline at end of file diff --git a/examples/CRISP/server/src/cli/commands.rs b/examples/CRISP/server/src/cli/commands.rs index beff3d0df..b789aa670 100644 --- a/examples/CRISP/server/src/cli/commands.rs +++ b/examples/CRISP/server/src/cli/commands.rs @@ -200,7 +200,7 @@ pub async fn initialize_crisp_round( info!("Debug - E3 Program enabled status: {}", enabled); if !enabled { info!("E3 Program not enabled, attempting to enable..."); - match contract.enable_e3_program(e3_program).await { + match contract.register_e3_program(e3_program).await { Ok(res) => info!("E3 Program enabled. TxHash: {:?}", res.transaction_hash), Err(e) => info!("Error enabling E3 Program: {:?}", e), } diff --git a/examples/CRISP/server/src/server/routes/rounds.rs b/examples/CRISP/server/src/server/routes/rounds.rs index 7d0c9a584..0949dae3c 100644 --- a/examples/CRISP/server/src/server/routes/rounds.rs +++ b/examples/CRISP/server/src/server/routes/rounds.rs @@ -187,7 +187,7 @@ pub async fn initialize_crisp_round( match contract.is_e3_program_enabled(e3_program).await { Ok(enabled) => { if !enabled { - match contract.enable_e3_program(e3_program).await { + match contract.register_e3_program(e3_program).await { Ok(res) => println!("E3 Program enabled. TxHash: {:?}", res.transaction_hash), Err(e) => println!("Error enabling E3 Program: {:?}", e), } diff --git a/packages/interfold-contracts/README.md b/packages/interfold-contracts/README.md index e3e6b3611..849561769 100644 --- a/packages/interfold-contracts/README.md +++ b/packages/interfold-contracts/README.md @@ -6,8 +6,8 @@ | ------------------------------- | ------------------------------------------------------------------------------------------------ | | `Interfold.sol` | Main protocol coordinator — handles E3 requests, param sets, fee routing, and output publication | | `CiphernodeRegistryOwnable.sol` | Ciphernode registration and committee selection | -| `BondingRegistry.sol` | INTF token bonding for ciphernodes; tracks bond amounts and manages bond lifecycle | -| `InterfoldToken.sol` | INTF governance/utility token | +| `BondingRegistry.sol` | FOLD token bonding for ciphernodes; tracks bond amounts and manages bond lifecycle | +| `InterfoldToken.sol` | FOLD governance/utility token | | `InterfoldTicketToken.sol` | USDC-backed tickets used by ciphernodes for sortition entry | | `SlashingManager.sol` | Fault attribution and slashing for dishonest ciphernodes (accusation → quorum → slash) | | `E3RefundManager.sol` | Issues refunds to requesters when an E3 fails | @@ -56,7 +56,7 @@ directory, as well as to the `deployed_contracts.json` file. Be sure to configure your desired network in `hardhat.config.ts` before deploying. -For non-local networks, set `INTERFOLD_TGE_TIMESTAMP` to the agreed INTF TGE +For non-local networks, set `INTERFOLD_TGE_TIMESTAMP` to the agreed FOLD TGE Unix timestamp before deploying. The deployment script configures this on `InterfoldToken` for token-level lock schedules. Local mock deployments default this timestamp to the latest local block timestamp. @@ -117,7 +117,7 @@ pnpm ciphernode:add --network [network] Options: -- `--license-bond-amount`: Amount of INTF to bond (default: 1000 INTF) +- `--license-bond-amount`: Amount of FOLD to bond (default: 1000 FOLD) - `--ticket-amount`: Amount of USDC for tickets (default: 1000 USDC) For testing/development, you can also use the admin task to register any diff --git a/packages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json b/packages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json index df44e9161..03bf2ee04 100644 --- a/packages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json +++ b/packages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json @@ -1081,5 +1081,5 @@ "deployedLinkReferences": {}, "immutableReferences": {}, "inputSourceName": "project/contracts/interfaces/IBondingRegistry.sol", - "buildInfoId": "solc-0_8_28-131befb7b6efbc9af996a8f87e4762d0d84ba904" + "buildInfoId": "solc-0_8_28-a92c823a7221deb8999e5c2c611c376dca846b23" } \ No newline at end of file diff --git a/packages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json b/packages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json index 4d5a4c982..9cad34db1 100644 --- a/packages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json +++ b/packages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json @@ -1332,5 +1332,5 @@ "deployedLinkReferences": {}, "immutableReferences": {}, "inputSourceName": "project/contracts/interfaces/ICiphernodeRegistry.sol", - "buildInfoId": "solc-0_8_28-131befb7b6efbc9af996a8f87e4762d0d84ba904" + "buildInfoId": "solc-0_8_28-a92c823a7221deb8999e5c2c611c376dca846b23" } \ No newline at end of file diff --git a/packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json b/packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json index 6dc1dc71e..7628c8053 100644 --- a/packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json +++ b/packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json @@ -366,17 +366,6 @@ "name": "ModuleAlreadyEnabled", "type": "error" }, - { - "inputs": [ - { - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "ModuleNotEnabled", - "type": "error" - }, { "inputs": [ { @@ -612,20 +601,7 @@ "type": "address" } ], - "name": "E3ProgramDisabled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IE3Program", - "name": "e3Program", - "type": "address" - } - ], - "name": "E3ProgramEnabled", + "name": "E3ProgramRegistered", "type": "event" }, { @@ -1322,19 +1298,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "contract IE3Program", - "name": "e3Program", - "type": "address" - } - ], - "name": "disableE3Program", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -1348,19 +1311,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "contract IE3Program", - "name": "e3Program", - "type": "address" - } - ], - "name": "enableE3Program", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -2001,6 +1951,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract IE3Program", + "name": "e3Program", + "type": "address" + } + ], + "name": "registerE3Program", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -2427,5 +2390,5 @@ "deployedLinkReferences": {}, "immutableReferences": {}, "inputSourceName": "project/contracts/interfaces/IInterfold.sol", - "buildInfoId": "solc-0_8_28-131befb7b6efbc9af996a8f87e4762d0d84ba904" + "buildInfoId": "solc-0_8_28-a92c823a7221deb8999e5c2c611c376dca846b23" } \ No newline at end of file diff --git a/packages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json b/packages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json index 24271bce1..7445a7ec7 100644 --- a/packages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json +++ b/packages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json @@ -1233,5 +1233,5 @@ "deployedLinkReferences": {}, "immutableReferences": {}, "inputSourceName": "project/contracts/interfaces/ISlashingManager.sol", - "buildInfoId": "solc-0_8_28-131befb7b6efbc9af996a8f87e4762d0d84ba904" + "buildInfoId": "solc-0_8_28-a92c823a7221deb8999e5c2c611c376dca846b23" } \ No newline at end of file diff --git a/packages/interfold-contracts/contracts/E3RefundManager.sol b/packages/interfold-contracts/contracts/E3RefundManager.sol index 4e5d53055..cf9ef486b 100644 --- a/packages/interfold-contracts/contracts/E3RefundManager.sol +++ b/packages/interfold-contracts/contracts/E3RefundManager.sol @@ -33,8 +33,6 @@ contract E3RefundManager is IE3RefundManager, Ownable2StepUpgradeable { //////////////////////////////////////////////////////////// /// @notice The Interfold contract (contains lifecycle functionality) IInterfold public interfold; - /// @notice The fee token used for payments - IERC20 public feeToken; /// @notice The bonding registry for node rewards IBondingRegistry public bondingRegistry; /// @notice Protocol treasury for protocol fee collection @@ -104,7 +102,6 @@ contract E3RefundManager is IE3RefundManager, Ownable2StepUpgradeable { require(_treasury != address(0), "Invalid treasury"); interfold = IInterfold(_interfold); - feeToken = interfold.feeToken(); bondingRegistry = interfold.bondingRegistry(); treasury = _treasury; diff --git a/packages/interfold-contracts/contracts/Interfold.sol b/packages/interfold-contracts/contracts/Interfold.sol index 90a6d0a73..b0961a56d 100644 --- a/packages/interfold-contracts/contracts/Interfold.sol +++ b/packages/interfold-contracts/contracts/Interfold.sol @@ -680,20 +680,13 @@ contract Interfold is IInterfold, Ownable2StepUpgradeable { } /// @inheritdoc IInterfold - function enableE3Program(IE3Program e3Program) external { + function registerE3Program(IE3Program e3Program) external { require( !e3Programs[e3Program], ModuleAlreadyEnabled(address(e3Program)) ); e3Programs[e3Program] = true; - emit E3ProgramEnabled(e3Program); - } - - /// @inheritdoc IInterfold - function disableE3Program(IE3Program e3Program) external onlyOwner { - require(e3Programs[e3Program], ModuleNotEnabled(address(e3Program))); - delete e3Programs[e3Program]; - emit E3ProgramDisabled(e3Program); + emit E3ProgramRegistered(e3Program); } /// @inheritdoc IInterfold diff --git a/packages/interfold-contracts/contracts/interfaces/IBondingRegistry.sol b/packages/interfold-contracts/contracts/interfaces/IBondingRegistry.sol index 0b9cbec71..7f1b6c47e 100644 --- a/packages/interfold-contracts/contracts/interfaces/IBondingRegistry.sol +++ b/packages/interfold-contracts/contracts/interfaces/IBondingRegistry.sol @@ -214,9 +214,9 @@ interface IBondingRegistry { function getLicenseBond(address operator) external view returns (uint256); /** - * @notice Get INTF that still counts toward an account's locked-floor collateral. - * @dev Includes active license bond plus pending INTF exits that remain slashable/not returned. - * @param account Account/operator whose INTF bond credit is queried + * @notice Get FOLD that still counts toward an account's locked-floor collateral. + * @dev Includes active license bond plus pending FOLD exits that remain slashable/not returned. + * @param account Account/operator whose FOLD bond credit is queried * @return Active plus pending license-bond amount */ function totalBonded(address account) external view returns (uint256); diff --git a/packages/interfold-contracts/contracts/interfaces/IInterfold.sol b/packages/interfold-contracts/contracts/interfaces/IInterfold.sol index 8d6aaf70e..b0605ef1d 100644 --- a/packages/interfold-contracts/contracts/interfaces/IInterfold.sol +++ b/packages/interfold-contracts/contracts/interfaces/IInterfold.sol @@ -228,13 +228,10 @@ interface IInterfold { /// @param encryptionSchemeId The ID of the encryption scheme that was disabled. event EncryptionSchemeDisabled(bytes32 encryptionSchemeId); - /// @notice This event MUST be emitted any time a E3 Program is enabled. + /// @notice This event MUST be emitted any time a E3 Program is registered. /// @param e3Program The address of the E3 Program. - event E3ProgramEnabled(IE3Program e3Program); - - /// @notice This event MUST be emitted any time a E3 Program is disabled. - /// @param e3Program The address of the E3 Program. - event E3ProgramDisabled(IE3Program e3Program); + /// @dev Registration is append-only; programs cannot be deregistered. + event E3ProgramRegistered(IE3Program e3Program); /// @notice Emitted when a BFV param set is registered or updated. /// @param paramSet The param set index. @@ -333,14 +330,10 @@ interface IInterfold { /// @param e3Id The ID of the non-existent E3. error E3DoesNotExist(uint256 e3Id); - /// @notice Thrown when attempting to enable a module or program that is already enabled. - /// @param module The address of the module that is already enabled. + /// @notice Thrown when attempting to register a program that is already registered. + /// @param module The address of the program that is already registered. error ModuleAlreadyEnabled(address module); - /// @notice Thrown when attempting to disable a module or program that is not enabled. - /// @param module The address of the module that is not enabled. - error ModuleNotEnabled(address module); - /// @notice Thrown when an invalid or disabled encryption scheme is used. /// @param encryptionSchemeId The ID of the invalid encryption scheme. error InvalidEncryptionScheme(bytes32 encryptionSchemeId); @@ -589,13 +582,9 @@ interface IInterfold { /// @notice Returns whether a token is currently allow-listed as an E3 fee token. function isFeeTokenAllowed(IERC20 token) external view returns (bool); - /// @notice This function should be called to enable an E3 Program. - /// @param e3Program The address of the E3 Program. - function enableE3Program(IE3Program e3Program) external; - - /// @notice This function should be called to disable an E3 Program. + /// @notice Register an E3 Program. Append-only — programs cannot be deregistered. /// @param e3Program The address of the E3 Program. - function disableE3Program(IE3Program e3Program) external; + function registerE3Program(IE3Program e3Program) external; /// @notice Sets or enables a decryption verifier for a specific encryption scheme. /// @dev This function MUST revert if the verifier address is zero or already set to the same value. diff --git a/packages/interfold-contracts/contracts/registry/BondingRegistry.sol b/packages/interfold-contracts/contracts/registry/BondingRegistry.sol index 277672b15..be413234c 100644 --- a/packages/interfold-contracts/contracts/registry/BondingRegistry.sol +++ b/packages/interfold-contracts/contracts/registry/BondingRegistry.sol @@ -61,10 +61,10 @@ contract BondingRegistry is // Storage // ====================== - /// @notice Ticket token (ITK with underlying USDC) used for collateral + /// @notice Ticket token (tFOLD with underlying USDC) used for collateral InterfoldTicketToken public ticketToken; - /// @notice License token (INTF) required for operator registration + /// @notice License token (FOLD) required for operator registration IERC20 public licenseToken; /// @notice Registry contract for managing committee membership diff --git a/packages/interfold-contracts/contracts/token/InterfoldTicketToken.sol b/packages/interfold-contracts/contracts/token/InterfoldTicketToken.sol index 79ec5f7ec..35c51840c 100644 --- a/packages/interfold-contracts/contracts/token/InterfoldTicketToken.sol +++ b/packages/interfold-contracts/contracts/token/InterfoldTicketToken.sol @@ -27,7 +27,7 @@ import { } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; /** - * @title InterfoldTicketToken (ITK) + * @title InterfoldTicketToken (tFOLD) * @notice Non-transferable, non-delegatable ERC20Votes wrapper over a stablecoin for operator * staking in the Interfold protocol. * @dev SECURITY NOTES @@ -154,7 +154,7 @@ contract InterfoldTicketToken is } /** - * @notice Initializes the Interfold Ticket Token with name "Interfold Ticket Token" and symbol "ITK" + * @notice Initializes the Interfold Ticket Token with name "Interfold Ticket Token" and symbol "tFOLD" * @dev Sets the registry pointer directly so deployment never depends on the deployer also * being {initialOwner_}. The registry can be re-pointed instantly until * {lockRegistry} is called. @@ -167,7 +167,7 @@ contract InterfoldTicketToken is address registry_, address initialOwner_ ) - ERC20("Interfold Ticket Token", "ITK") + ERC20("Interfold Ticket Token", "tFOLD") ERC20Permit("Interfold Ticket Token") ERC20Wrapper(baseToken) Ownable(initialOwner_) diff --git a/packages/interfold-contracts/contracts/token/InterfoldToken.sol b/packages/interfold-contracts/contracts/token/InterfoldToken.sol index 67c222b3e..0d5e255c5 100644 --- a/packages/interfold-contracts/contracts/token/InterfoldToken.sol +++ b/packages/interfold-contracts/contracts/token/InterfoldToken.sol @@ -208,7 +208,7 @@ contract InterfoldToken is /// @notice The CCA auction contract address public immutable CLAIM_SOURCE; - /// @notice Registry whose bonded INTF counts toward locked balances. + /// @notice Registry whose bonded FOLD counts toward locked balances. IBondingRegistry public immutable BONDING_REGISTRY; // ───────────────────────────────────────────────────────────────────────── @@ -288,7 +288,7 @@ contract InterfoldToken is // ───────────────────────────────────────────────────────────────────────── /** - * @notice Deploys INTF with no TGE set. + * @notice Deploys FOLD with no TGE set. * @dev The initial owner receives every role via the {_transferOwnership} * sync. Operational roles can additionally be granted to dedicated * keys post-deployment. @@ -297,7 +297,7 @@ contract InterfoldToken is * @param ccaEnd_ CCA auction window end; after `ccaStart_`. * @param noMoreLocks_ Absolute timestamp after which token locks no longer apply. * @param claimSource_ The CCA auction contract - * @param bondingRegistry_ Registry whose bonded INTF + * @param bondingRegistry_ Registry whose bonded FOLD */ constructor( address initialOwner_, @@ -307,7 +307,7 @@ contract InterfoldToken is address claimSource_, IBondingRegistry bondingRegistry_ ) - ERC20("Interfold", "INTF") + ERC20("Interfold", "FOLD") ERC20Permit("Interfold") Ownable(initialOwner_) { @@ -337,7 +337,7 @@ contract InterfoldToken is // Minting // ───────────────────────────────────────────────────────────────────────── - /// @notice Plain vanilla admin mint: INTF with no lock attached. Only + /// @notice Plain vanilla admin mint: FOLD with no lock attached. Only /// allowed during the Virtual phase. function mint( address recipient, diff --git a/packages/interfold-contracts/scripts/deployInterfold.ts b/packages/interfold-contracts/scripts/deployInterfold.ts index 6666ee28e..4c48023b1 100644 --- a/packages/interfold-contracts/scripts/deployInterfold.ts +++ b/packages/interfold-contracts/scripts/deployInterfold.ts @@ -214,9 +214,9 @@ export const deployInterfold = async ( const ciphernodeRegistryAddress = await ciphernodeRegistry.getAddress(); console.log("CiphernodeRegistry deployed to:", ciphernodeRegistryAddress); - // BondingRegistry is deployed before INTF so its address can be passed to + // BondingRegistry is deployed before FOLD so its address can be passed to // the token constructor. The license token is set to address(0) temporarily - // and fixed after INTF is deployed via setLicenseToken(). + // and fixed after FOLD is deployed via setLicenseToken(). console.log("Deploying BondingRegistry..."); const { bondingRegistry } = await deployAndSaveBondingRegistry({ owner: ownerAddress, @@ -233,11 +233,11 @@ export const deployInterfold = async ( const bondingRegistryAddress = await bondingRegistry.getAddress(); console.log("BondingRegistry deployed to:", bondingRegistryAddress); - // INTF is deployed with BondingRegistry's real address. claimSource uses + // FOLD is deployed with BondingRegistry's real address. claimSource uses // the deployer as a placeholder; the actual Interfold protocol contract is // deployed later (its address is not known at this point). CLAIM_SOURCE is // immutable, so local deployments use the deployer as the claim source. - console.log("Deploying INTF token..."); + console.log("Deploying FOLD token..."); const { interfoldToken } = await deployAndSaveInterfoldToken({ owner: ownerAddress, ccaStart, @@ -250,7 +250,7 @@ export const deployInterfold = async ( const interfoldTokenAddress = await interfoldToken.getAddress(); console.log("InterfoldToken deployed to:", interfoldTokenAddress); - // Fix up BondingRegistry's license token now that INTF exists. + // Fix up BondingRegistry's license token now that FOLD exists. console.log("Setting license token in BondingRegistry..."); await (await bondingRegistry.setLicenseToken(interfoldTokenAddress)).wait(); @@ -263,7 +263,7 @@ export const deployInterfold = async ( } // Whitelist BondingRegistry so bonded transfers work pre-TGE. - console.log("Whitelisting BondingRegistry in INTF..."); + console.log("Whitelisting BondingRegistry in FOLD..."); await ( await interfoldToken.setTransferWhitelisted(bondingRegistryAddress, true) ).wait(); @@ -463,7 +463,7 @@ export const deployInterfold = async ( } } - const tx = await interfold.enableE3Program(e3ProgramAddress); + const tx = await interfold.registerE3Program(e3ProgramAddress); await tx.wait(); console.log(`Successfully enabled E3 Program in Interfold contract`); } @@ -560,7 +560,7 @@ export const deployInterfold = async ( Deployment Complete! ============================================ MockFeeToken: ${feeTokenAddress} - InterfoldToken (INTF): ${interfoldTokenAddress} + InterfoldToken (FOLD): ${interfoldTokenAddress} InterfoldTicketToken: ${interfoldTicketTokenAddress} SlashingManager: ${slashingManagerAddress} BondingRegistry: ${bondingRegistryAddress} diff --git a/packages/interfold-contracts/tasks/ciphernode.ts b/packages/interfold-contracts/tasks/ciphernode.ts index 393b6ae70..c8f3cc5ca 100644 --- a/packages/interfold-contracts/tasks/ciphernode.ts +++ b/packages/interfold-contracts/tasks/ciphernode.ts @@ -53,7 +53,7 @@ export const ciphernodeAdd = task( .addOption({ name: "licenseBondAmount", description: - "amount of INTF to bond (in wei, e.g., 1000000000000000000000 for 1000 INTF)", + "amount of FOLD to bond (in wei, e.g., 1000000000000000000000 for 1000 FOLD)", defaultValue: "1000000000000000000000", }) .addOption({ @@ -96,18 +96,18 @@ export const ciphernodeAdd = task( try { console.log("Step 1: Checking balances..."); - const intfBalance = await licenseToken.balanceOf(signer.address); + const foldBalance = await licenseToken.balanceOf(signer.address); const usdcBalance = await usdcToken.balanceOf(signer.address); - console.log(`INTF balance: ${ethers.formatEther(intfBalance)}`); + console.log(`FOLD balance: ${ethers.formatEther(foldBalance)}`); console.log(`USDC balance: ${ethers.formatUnits(usdcBalance, 6)}`); const licenseBondAmountBigInt = BigInt(licenseBondAmount); const ticketAmountBigInt = BigInt(ticketAmount); - if (intfBalance < licenseBondAmountBigInt) { + if (foldBalance < licenseBondAmountBigInt) { throw new Error( - `Insufficient INTF balance. Need: ${ethers.formatEther(licenseBondAmountBigInt)}, Have: ${ethers.formatEther(intfBalance)}`, + `Insufficient FOLD balance. Need: ${ethers.formatEther(licenseBondAmountBigInt)}, Have: ${ethers.formatEther(foldBalance)}`, ); } @@ -117,13 +117,13 @@ export const ciphernodeAdd = task( ); } - console.log("Step 2: Approving INTF for license bond..."); + console.log("Step 2: Approving FOLD for license bond..."); const approveTx = await licenseToken.approve( await bondingRegistry.getAddress(), licenseBondAmountBigInt, ); await approveTx.wait(); - console.log("INTF approved"); + console.log("FOLD approved"); console.log("Step 3: Bonding license..."); const bondTx = await bondingRegistryConnected.bondLicense( @@ -131,7 +131,7 @@ export const ciphernodeAdd = task( ); await bondTx.wait(); console.log( - `Licensed bonded: ${ethers.formatEther(licenseBondAmountBigInt)} INTF`, + `Licensed bonded: ${ethers.formatEther(licenseBondAmountBigInt)} FOLD`, ); console.log("Step 4: Registering as operator..."); @@ -174,7 +174,7 @@ export const ciphernodeAdd = task( console.log(`Ciphernode: ${signer.address}`); console.log(`Registered: ${isRegistered}`); console.log(`Active: ${isActive}`); - console.log(`License Bond: ${ethers.formatEther(licenseBond)} INTF`); + console.log(`License Bond: ${ethers.formatEther(licenseBond)} FOLD`); console.log( `Ticket Balance: ${ethers.formatUnits(ticketBalance, 6)} USDC worth`, ); @@ -226,7 +226,7 @@ export const ciphernodeRemove = task( export const ciphernodeMintTokens = task( "ciphernode:mint-tokens", - "Mint INTF and USDC tokens for a ciphernode (for testing)", + "Mint FOLD and USDC tokens for a ciphernode (for testing)", ) .addOption({ name: "ciphernodeAddress", @@ -234,9 +234,9 @@ export const ciphernodeMintTokens = task( defaultValue: ZeroAddress, }) .addOption({ - name: "intfAmount", + name: "foldAmount", description: - "amount of INTF to mint (in ether units, e.g., 2000 for 2000 INTF)", + "amount of FOLD to mint (in ether units, e.g., 2000 for 2000 FOLD)", defaultValue: "2000", }) .addOption({ @@ -246,7 +246,7 @@ export const ciphernodeMintTokens = task( defaultValue: "1000", }) .setAction(async () => ({ - default: async ({ ciphernodeAddress, intfAmount, usdcAmount }, hre) => { + default: async ({ ciphernodeAddress, foldAmount, usdcAmount }, hre) => { const connection = await hre.network.connect(); const { ethers } = connection; @@ -275,14 +275,14 @@ export const ciphernodeMintTokens = task( try { console.log(`Minting tokens for: ${ciphernodeAddress}`); - console.log(`Minting ${intfAmount} INTF...`); - const intfTx = await interfoldTokenContract.mint( + console.log(`Minting ${foldAmount} FOLD...`); + const foldTx = await interfoldTokenContract.mint( ciphernodeAddress, - ethers.parseEther(intfAmount), + ethers.parseEther(foldAmount), ethers.encodeBytes32String("cn-alloc"), ); - await intfTx.wait(); - console.log(`${intfAmount} INTF minted`); + await foldTx.wait(); + console.log(`${foldAmount} FOLD minted`); console.log(`Minting ${usdcAmount} USDC...`); const usdcTx = await mockUSDCContract.mint( @@ -292,12 +292,12 @@ export const ciphernodeMintTokens = task( await usdcTx.wait(); console.log(`${usdcAmount} USDC minted`); - const intfBalance = + const foldBalance = await interfoldTokenContract.balanceOf(ciphernodeAddress); const usdcBalance = await mockUSDCContract.balanceOf(ciphernodeAddress); console.log("\n=== Token Balances ==="); - console.log(`INTF: ${ethers.formatEther(intfBalance)}`); + console.log(`FOLD: ${ethers.formatEther(foldBalance)}`); console.log(`USDC: ${ethers.formatUnits(usdcBalance, 6)}`); const tgeTs = await interfoldTokenContract.tgeTimestamp(); @@ -339,7 +339,7 @@ export const ciphernodeAdminAdd = task( .addOption({ name: "licenseBondAmount", description: - "amount of INTF to bond (in ether units, e.g., 1000 for 1000 INTF)", + "amount of FOLD to bond (in ether units, e.g., 1000 for 1000 FOLD)", defaultValue: "1000", }) .addOption({ @@ -417,21 +417,21 @@ export const ciphernodeAdminAdd = task( const licenseBondWei = ethers.parseEther(licenseBondAmount); const ticketAmountWei = ethers.parseUnits(ticketAmount, 6); - console.log("Step 1: Minting and transferring INTF to ciphernode..."); + console.log("Step 1: Minting and transferring FOLD to ciphernode..."); - const intfTx = await interfoldTokenConnected.mint( + const foldTx = await interfoldTokenConnected.mint( adminWallet.address, licenseBondWei, ethers.encodeBytes32String("admin-cn-reg"), ); - await intfTx.wait(); + await foldTx.wait(); const transferTx = await interfoldTokenConnected.transfer( ciphernodeAddress, licenseBondWei, ); await transferTx.wait(); - console.log(`${licenseBondAmount} INTF transferred to ciphernode`); + console.log(`${licenseBondAmount} FOLD transferred to ciphernode`); console.log("Step 2: Minting USDC to admin..."); const usdcTx = await mockUSDCConnected.mint( @@ -469,7 +469,7 @@ export const ciphernodeAdminAdd = task( const bondTx = await bondingRegistryAsCiphernode.bondLicense(licenseBondWei); await bondTx.wait(); - console.log(`License bonded: ${licenseBondAmount} INTF`); + console.log(`License bonded: ${licenseBondAmount} FOLD`); const registerTx = await bondingRegistryAsCiphernode.registerOperator(); await registerTx.wait(); @@ -533,7 +533,7 @@ export const ciphernodeAdminAdd = task( console.log(`Ciphernode: ${ciphernodeAddress}`); console.log(`Registered: ${isRegistered}`); console.log(`Active: ${isActive}`); - console.log(`License Bond: ${ethers.formatEther(licenseBond)} INTF`); + console.log(`License Bond: ${ethers.formatEther(licenseBond)} FOLD`); console.log( `Ticket Balance: ${ethers.formatUnits(ticketBalance, 6)} USDC worth`, ); diff --git a/packages/interfold-contracts/tasks/interfold.ts b/packages/interfold-contracts/tasks/interfold.ts index 13b5f8e5e..920e2eac4 100644 --- a/packages/interfold-contracts/tasks/interfold.ts +++ b/packages/interfold-contracts/tasks/interfold.ts @@ -292,7 +292,7 @@ export const enableE3 = task("interfold:enableE3", "Enable an E3 program") hre, }); - const tx = await interfold.enableE3Program(e3Address); + const tx = await interfold.registerE3Program(e3Address); console.log("Enabling E3 program... ", tx.hash); await tx.wait(); diff --git a/packages/interfold-contracts/test/E3Lifecycle/E3Integration.spec.ts b/packages/interfold-contracts/test/E3Lifecycle/E3Integration.spec.ts index 19a50dfd5..874e08bb8 100644 --- a/packages/interfold-contracts/test/E3Lifecycle/E3Integration.spec.ts +++ b/packages/interfold-contracts/test/E3Lifecycle/E3Integration.spec.ts @@ -80,7 +80,7 @@ describe("E3 Integration - Refund/Timeout Mechanism", function () { ciphernodeRegistry: registry, slashingManager, usdcToken, - licenseToken: intfToken, + licenseToken: foldToken, mocks: { e3Program, decryptionVerifier, @@ -146,14 +146,14 @@ describe("E3 Integration - Refund/Timeout Mechanism", function () { const ticketTokenAddress = await bondingRegistry.ticketToken(); const ticketAmount = ethers.parseUnits("100", 6); - await intfToken.mint( + await foldToken.mint( operatorAddress, ethers.parseEther("10000"), ethers.encodeBytes32String("Test allocation"), ); await usdcToken.mint(operatorAddress, ethers.parseUnits("100000", 6)); - await intfToken + await foldToken .connect(operator) .approve(await bondingRegistry.getAddress(), ethers.parseEther("2000")); await bondingRegistry @@ -175,7 +175,7 @@ describe("E3 Integration - Refund/Timeout Mechanism", function () { slashingManager, _circuitVerifier, usdcToken, - intfToken, + foldToken, e3Program, decryptionVerifier, owner, diff --git a/packages/interfold-contracts/test/Interfold.spec.ts b/packages/interfold-contracts/test/Interfold.spec.ts index aa7ca1e7b..ba12923bf 100644 --- a/packages/interfold-contracts/test/Interfold.spec.ts +++ b/packages/interfold-contracts/test/Interfold.spec.ts @@ -349,18 +349,17 @@ describe("Interfold", function () { }); }); - describe("enableE3Program()", function () { - it("reverts if E3 Program is already enabled", async function () { + describe("registerE3Program()", function () { + it("reverts if E3 Program is already registered", async function () { const { interfold, mocks: { e3Program }, } = await loadFixture(setup); - - await expect(interfold.enableE3Program(e3Program)) + await expect(interfold.registerE3Program(e3Program)) .to.be.revertedWithCustomError(interfold, "ModuleAlreadyEnabled") .withArgs(e3Program); }); - it("enables E3 Program correctly", async function () { + it("registers E3 Program correctly", async function () { const { interfold, mocks: { e3Program }, @@ -368,50 +367,12 @@ describe("Interfold", function () { const enabled = await interfold.e3Programs(e3Program); expect(enabled).to.be.true; }); - it("emits E3ProgramEnabled event", async function () { - const { interfold } = await loadFixture(setup); - await expect(interfold.enableE3Program(AddressTwo)) - .to.emit(interfold, "E3ProgramEnabled") - .withArgs(AddressTwo); - }); - }); - - describe("disableE3Program()", function () { - it("reverts if not called by owner", async function () { - const { - interfold, - mocks: { e3Program }, - notTheOwner, - } = await loadFixture(setup); - await expect(interfold.connect(notTheOwner).disableE3Program(e3Program)) - .to.be.revertedWithCustomError(interfold, "OwnableUnauthorizedAccount") - .withArgs(notTheOwner); - }); - it("reverts if E3 Program is not enabled", async function () { + it("emits E3ProgramRegistered event", async function () { const { interfold } = await loadFixture(setup); - await expect(interfold.disableE3Program(AddressTwo)) - .to.be.revertedWithCustomError(interfold, "ModuleNotEnabled") + await expect(interfold.registerE3Program(AddressTwo)) + .to.emit(interfold, "E3ProgramRegistered") .withArgs(AddressTwo); }); - it("disables E3 Program correctly", async function () { - const { - interfold, - mocks: { e3Program }, - } = await loadFixture(setup); - await interfold.disableE3Program(e3Program); - - const enabled = await interfold.e3Programs(e3Program); - expect(enabled).to.be.false; - }); - it("emits E3ProgramDisabled event", async function () { - const { - interfold, - mocks: { e3Program }, - } = await loadFixture(setup); - await expect(interfold.disableE3Program(e3Program)) - .to.emit(interfold, "E3ProgramDisabled") - .withArgs(e3Program); - }); }); describe("request()", function () { diff --git a/packages/interfold-contracts/test/Registry/BondingRegistry.spec.ts b/packages/interfold-contracts/test/Registry/BondingRegistry.spec.ts index fb1e2b083..e7f7a0392 100644 --- a/packages/interfold-contracts/test/Registry/BondingRegistry.spec.ts +++ b/packages/interfold-contracts/test/Registry/BondingRegistry.spec.ts @@ -679,7 +679,7 @@ describe("BondingRegistry", function () { const initialUSDCBalance = await usdcToken.balanceOf( await operator1.getAddress(), ); - const initialINTFBalance = await licenseToken.balanceOf( + const initialFOLDBalance = await licenseToken.balanceOf( await operator1.getAddress(), ); @@ -692,7 +692,7 @@ describe("BondingRegistry", function () { ); expect( await licenseToken.balanceOf(await operator1.getAddress()), - ).to.equal(initialINTFBalance + bondAmount); + ).to.equal(initialFOLDBalance + bondAmount); }); it("reverts if exit not ready", async function () { @@ -745,7 +745,7 @@ describe("BondingRegistry", function () { const initialUSDCBalance = await usdcToken.balanceOf( await operator1.getAddress(), ); - const initialINTFBalance = await licenseToken.balanceOf( + const initialFOLDBalance = await licenseToken.balanceOf( await operator1.getAddress(), ); @@ -758,7 +758,7 @@ describe("BondingRegistry", function () { ); expect( await licenseToken.balanceOf(await operator1.getAddress()), - ).to.equal(initialINTFBalance + partialLicense); + ).to.equal(initialFOLDBalance + partialLicense); const [remainingTickets, remainingLicense] = await bondingRegistry.pendingExits(await operator1.getAddress()); @@ -1054,7 +1054,7 @@ describe("BondingRegistry", function () { const initialUSDCBalance = await usdcToken.balanceOf( await operator1.getAddress(), ); - const initialINTFBalance = await licenseToken.balanceOf( + const initialFOLDBalance = await licenseToken.balanceOf( await operator1.getAddress(), ); @@ -1067,7 +1067,7 @@ describe("BondingRegistry", function () { ); expect( await licenseToken.balanceOf(await operator1.getAddress()), - ).to.equal(initialINTFBalance + bondAmount); + ).to.equal(initialFOLDBalance + bondAmount); await licenseToken .connect(operator1) @@ -1228,7 +1228,7 @@ describe("BondingRegistry", function () { } = await loadFixture(setup); // Register and fund tickets so the generic ExitQueueLib ticket path is - // exercised directly alongside INTF exits. + // exercised directly alongside FOLD exits. const bondAmount = LICENSE_REQUIRED_BOND; await licenseToken .connect(operator1) diff --git a/packages/interfold-contracts/test/Slashing/CommitteeExpulsion.spec.ts b/packages/interfold-contracts/test/Slashing/CommitteeExpulsion.spec.ts index e61f844e7..9ee2d1e8d 100644 --- a/packages/interfold-contracts/test/Slashing/CommitteeExpulsion.spec.ts +++ b/packages/interfold-contracts/test/Slashing/CommitteeExpulsion.spec.ts @@ -69,7 +69,7 @@ describe("Committee Expulsion & Fault Tolerance", function () { ciphernodeRegistry: registry, slashingManager, bondingRegistry, - licenseToken: intfToken, + licenseToken: foldToken, ticketToken, usdcToken, mocks, @@ -107,14 +107,14 @@ describe("Committee Expulsion & Fault Tolerance", function () { async function setupOperator(operator: Signer) { const operatorAddress = await operator.getAddress(); - await intfToken.mint( + await foldToken.mint( operatorAddress, ethers.parseEther("10000"), ethers.encodeBytes32String("Test allocation"), ); await usdcToken.mint(operatorAddress, ethers.parseUnits("100000", 6)); - await intfToken + await foldToken .connect(operator) .approve(await bondingRegistry.getAddress(), ethers.parseEther("2000")); await bondingRegistry @@ -180,7 +180,7 @@ describe("Committee Expulsion & Fault Tolerance", function () { bondingRegistry, mockVerifier, usdcToken, - intfToken, + foldToken, ticketToken, owner, requester, diff --git a/packages/interfold-contracts/test/Token/InterfoldToken.spec.ts b/packages/interfold-contracts/test/Token/InterfoldToken.spec.ts index 94893703d..daba82907 100644 --- a/packages/interfold-contracts/test/Token/InterfoldToken.spec.ts +++ b/packages/interfold-contracts/test/Token/InterfoldToken.spec.ts @@ -2337,7 +2337,7 @@ describe("InterfoldToken", function () { expect(tb).to.be.closeTo(grantAmount, ethers.parseEther("0.02")); }); - it("transferableBalanceOf counts bonded INTF toward the locked floor", async function () { + it("transferableBalanceOf counts bonded FOLD toward the locked floor", async function () { const signers = await ethers.getSigners(); const [, beneficiary, slasher] = signers; const beneficiaryAddress = await beneficiary.getAddress(); diff --git a/packages/interfold-contracts/test/fixtures/system.ts b/packages/interfold-contracts/test/fixtures/system.ts index 66a0c2593..aa75d48ac 100644 --- a/packages/interfold-contracts/test/fixtures/system.ts +++ b/packages/interfold-contracts/test/fixtures/system.ts @@ -489,7 +489,7 @@ export async function deployInterfoldSystem( ); } - await interfold.enableE3Program(await e3Program.getAddress()); + await interfold.registerE3Program(await e3Program.getAddress()); await interfold.setParamSet(0, bfvParams); await interfold.setDecryptionVerifier( ENCRYPTION_SCHEME_ID, diff --git a/packages/interfold-sdk/src/events/types.ts b/packages/interfold-sdk/src/events/types.ts index 084ed9d1b..d72aaf1e8 100644 --- a/packages/interfold-sdk/src/events/types.ts +++ b/packages/interfold-sdk/src/events/types.ts @@ -10,8 +10,7 @@ export enum InterfoldEventType { E3_REQUESTED = 'E3Requested', CIPHERTEXT_OUTPUT_PUBLISHED = 'CiphertextOutputPublished', PLAINTEXT_OUTPUT_PUBLISHED = 'PlaintextOutputPublished', - E3_PROGRAM_ENABLED = 'E3ProgramEnabled', - E3_PROGRAM_DISABLED = 'E3ProgramDisabled', + E3_PROGRAM_REGISTERED = 'E3ProgramRegistered', ENCRYPTION_SCHEME_ENABLED = 'EncryptionSchemeEnabled', ENCRYPTION_SCHEME_DISABLED = 'EncryptionSchemeDisabled', CIPHERNODE_REGISTRY_SET = 'CiphernodeRegistrySet', diff --git a/templates/default/deploy/default.ts b/templates/default/deploy/default.ts index 8f7fa954a..434850167 100644 --- a/templates/default/deploy/default.ts +++ b/templates/default/deploy/default.ts @@ -65,7 +65,7 @@ export const deployTemplate = async () => { await e3Program.waitForDeployment() const programAddress = await e3Program.getAddress() - const tx = await interfold.enableE3Program(programAddress) + const tx = await interfold.registerE3Program(programAddress) await tx.wait() const allowed = await interfold.e3Programs(programAddress) From 47125edded2c88b569481e71b9e208036f8b7f0c Mon Sep 17 00:00:00 2001 From: Hamza Khalid Date: Mon, 15 Jun 2026 22:09:15 +0500 Subject: [PATCH 2/2] fix: review comments --- agent/flow-trace/00_INDEX.md | 6 +- agent/flow-trace/01_REGISTRATION.md | 2 +- agent/flow-trace/02_TOKENS_AND_ACTIVATION.md | 82 +++++++++---------- .../flow-trace/05_FAILURE_REFUND_SLASHING.md | 10 +-- .../06_DEACTIVATION_AND_COMPLETION.md | 14 ++-- .../IBondingRegistry.json | 2 +- .../ICiphernodeRegistry.json | 2 +- .../interfaces/IInterfold.sol/IInterfold.json | 2 +- .../ISlashingManager.json | 2 +- .../InterfoldTicketToken.json | 20 ++--- .../test/Interfold.spec.ts | 9 +- packages/interfold-sdk/src/events/types.ts | 3 +- 12 files changed, 75 insertions(+), 79 deletions(-) diff --git a/agent/flow-trace/00_INDEX.md b/agent/flow-trace/00_INDEX.md index 51c783c06..90b84a47a 100644 --- a/agent/flow-trace/00_INDEX.md +++ b/agent/flow-trace/00_INDEX.md @@ -5,7 +5,7 @@ | # | File | Covers | | --- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | [01_REGISTRATION.md](01_REGISTRATION.md) | `setup`, `register`, `activate`, `status` CLI commands. On-chain registration into BondingRegistry → CiphernodeRegistry IMT. Rust-side event detection. | -| 2 | [02_TOKENS_AND_ACTIVATION.md](02_TOKENS_AND_ACTIVATION.md) | INTF license bonding, USDC→ITK ticket purchasing, unbonding, burning, exit queue, claiming. Activation thresholds and the `_updateOperatorStatus` formula. | +| 2 | [02_TOKENS_AND_ACTIVATION.md](02_TOKENS_AND_ACTIVATION.md) | FOLD license bonding, USDC→tFOLD ticket purchasing, unbonding, burning, exit queue, claiming. Activation thresholds and the `_updateOperatorStatus` formula. | | 3 | [03_E3_REQUEST_AND_COMMITTEE.md](03_E3_REQUEST_AND_COMMITTEE.md) | E3 request on-chain flow, fee payment, committee request, IMT snapshot. Rust-side sortition (score-based), on-chain ticket submission, committee finalization, `CiphernodeSelected` event. | | 4 | [04_DKG_AND_COMPUTATION.md](04_DKG_AND_COMPUTATION.md) | Full DKG with ZK proof pipeline: BFV keygen → C0 proof → encryption key exchange → TrBFV share generation → C1/C2/C3 proofs → share verification → Shamir secret sharing → encrypted share broadcast → C4 proofs → decryption key reconstruction. C5 proof for PK aggregation. Ciphertext output → C6 proof for decryption shares → C7 proof for plaintext → rewards. | | 5 | [05_FAILURE_REFUND_SLASHING.md](05_FAILURE_REFUND_SLASHING.md) | Timeout-based failure detection, `markE3Failed`, `processE3Failure`. Refund calculation (work-value allocation). Off-chain AccusationManager quorum protocol (proof failure → accusation → voting → quorum). Lane A (attestation-based, atomic) and Lane B (evidence-based, with appeals) slashing. Ticket/license slashing. Slashed funds escrow and routing. | @@ -20,7 +20,7 @@ → Config, password, private key stored locally 2. BOND interfold ciphernode license bond --amount N - → INTF tokens locked in BondingRegistry + → FOLD tokens locked in BondingRegistry 3. TICKETS interfold ciphernode tickets buy --amount N → USDC → InterfoldTicketToken (non-transferable) @@ -77,7 +77,7 @@ 15. DEREGISTER interfold ciphernode deregister --proof X → All collateral queued for exit → Removed from IMT - → After exitDelay: claim USDC + INTF back + → After exitDelay: claim USDC + FOLD back ``` ## End-to-End Failure Path Summary diff --git a/agent/flow-trace/01_REGISTRATION.md b/agent/flow-trace/01_REGISTRATION.md index 64dff559b..756f8f0ae 100644 --- a/agent/flow-trace/01_REGISTRATION.md +++ b/agent/flow-trace/01_REGISTRATION.md @@ -188,7 +188,7 @@ User runs: interfold ciphernode status Active: true Exit Pending: false Ticket Balance: 100 (available: 95) - License Bond: 50000 INTF + License Bond: 50000 FOLD Pending Exits: tickets=0, license=0 Requirements: minTickets=10, ticketPrice=1000000, licenseBond=50000 ``` diff --git a/agent/flow-trace/02_TOKENS_AND_ACTIVATION.md b/agent/flow-trace/02_TOKENS_AND_ACTIVATION.md index 00315123b..0c0937388 100644 --- a/agent/flow-trace/02_TOKENS_AND_ACTIVATION.md +++ b/agent/flow-trace/02_TOKENS_AND_ACTIVATION.md @@ -4,8 +4,8 @@ Before a node can register, it must stake two types of collateral: -1. **INTF tokens** (license bond) — governance/utility token, staked directly -2. **Stablecoin via ITK tickets** (ticket collateral) — USDC wrapped into non-transferable +1. **FOLD tokens** (license bond) — governance/utility token, staked directly +2. **Stablecoin via tFOLD tickets** (ticket collateral) — USDC wrapped into non-transferable InterfoldTicketToken --- @@ -14,7 +14,7 @@ Before a node can register, it must stake two types of collateral: ``` ┌───────────────────────────────────────────────────────────┐ -│ InterfoldToken (INTF) │ +│ InterfoldToken (FOLD) │ │ ERC20 + ERC20Permit + ERC20Votes + AccessControl │ │ + Ownable2Step │ │ │ @@ -74,7 +74,7 @@ Before a node can register, it must stake two types of collateral: └───────────────────────────────────────────────────────────┘ ┌───────────────────────────────────────────────────────────┐ -│ InterfoldTicketToken (ITK) │ +│ InterfoldTicketToken (tFOLD) │ │ ERC20Wrapper over stablecoin (e.g. USDC) │ │ │ │ NON-TRANSFERABLE: _update() reverts on transfer │ @@ -82,10 +82,10 @@ Before a node can register, it must stake two types of collateral: │ NO APPROVALS: approve() reverts │ │ │ │ Only BondingRegistry (registry role) can: │ -│ depositFor() → wrap USDC, mint ITK to operator │ -│ depositFrom() → pull USDC from X, mint ITK to Y │ -│ burnTickets() → burn ITK, NO underlying returned │ -│ withdrawTo() → burn ITK, return underlying USDC │ +│ depositFor() → wrap USDC, mint tFOLD to operator │ +│ depositFrom() → pull USDC from X, mint tFOLD to Y │ +│ burnTickets() → burn tFOLD, NO underlying returned │ +│ withdrawTo() → burn tFOLD, return underlying USDC │ │ payout() → send underlying from payableBalance │ │ │ │ Used as: TICKET COLLATERAL token │ @@ -104,9 +104,9 @@ User runs: interfold ciphernode license bond --amount 50000 ├─ 1. ChainContext::new() │ └─ Loads config, decrypts wallet, connects to BondingRegistry │ -├─ 2. Approve INTF spend: +├─ 2. Approve FOLD spend: │ └─ InterfoldToken.approve(bondingRegistry, 50000) -│ → Allows BondingRegistry to pull INTF tokens +│ → Allows BondingRegistry to pull FOLD tokens │ ├─ 3. BondingRegistryContract.bondLicense(50000).send().await │ │ @@ -121,9 +121,9 @@ User runs: interfold ciphernode license bond --amount 50000 │ │ │ address(this), // to BondingRegistry │ │ │ │ amount │ │ │ │ ) │ -│ │ │ → INTF _update can see the pre-recorded bond │ +│ │ │ → FOLD _update can see the pre-recorded bond │ │ │ │ and enforce locked-floor accounting │ -│ │ │ → INTF tokens move from operator → contract │ +│ │ │ → FOLD tokens move from operator → contract │ │ │ │ 4. _updateOperatorStatus(msg.sender) │ │ │ │ → May activate if all conditions now met │ │ │ │ 5. Emit LicenseBondUpdated(msg.sender, newBond) │ @@ -133,11 +133,11 @@ User runs: interfold ciphernode license bond --amount 50000 └─ OUTPUT: "Transaction hash: 0x..." ``` -### Locked INTF bonding +### Locked FOLD bonding -`BondingRegistry.totalBonded(account)` returns active INTF license bond plus pending INTF exits that +`BondingRegistry.totalBonded(account)` returns active FOLD license bond plus pending FOLD exits that remain slashable/not returned. `InterfoldToken` uses this view for pooled wallet-level locks, so -locked INTF can be self-bonded by the same account without becoming transferable. Delegated +locked FOLD can be self-bonded by the same account without becoming transferable. Delegated source-aware bonding is not part of the pooled-lock model; license bonds are credited to `msg.sender` through `bondLicense(amount)`. @@ -151,7 +151,7 @@ _updateOperatorStatus(operator): operators[operator].registered == true AND operators[operator].licenseBond >= (licenseRequiredBond * licenseActiveBps / 10000) // Default: licenseActiveBps = 8000 (80%) - // So if licenseRequiredBond = 50000, need >= 40000 INTF + // So if licenseRequiredBond = 50000, need >= 40000 FOLD AND ticketToken.balanceOf(operator) / ticketPrice >= minTicketBalance ) @@ -201,16 +201,16 @@ User runs: interfold ciphernode tickets buy --amount 100 │ │ │ 3. modifier: require(!exitInProgress(msg.sender)) │ │ │ │ 4. ticketToken.depositFrom( │ │ │ │ msg.sender, // pull USDC from operator │ -│ │ │ msg.sender, // mint ITK to operator │ +│ │ │ msg.sender, // mint tFOLD to operator │ │ │ │ amount // RAW stablecoin units │ │ │ │ ) // NO ticketPrice multiplication│ │ │ │ │ │ │ │ │ │ ┌─ InterfoldTicketToken.depositFrom() ────┐ │ │ │ │ │ │ 1. underlying.transferFrom( │ │ │ │ │ │ │ from, address(this), amount) │ │ -│ │ │ │ │ → USDC moves: operator → ITK │ │ +│ │ │ │ │ → USDC moves: operator → tFOLD │ │ │ │ │ │ │ 2. _mint(to, amount) │ │ -│ │ │ │ │ → ITK minted 1:1 with USDC │ │ +│ │ │ │ │ → tFOLD minted 1:1 with USDC │ │ │ │ │ │ │ 3. Auto-delegate to self on first │ │ │ │ │ │ │ deposit (for voting power tracking)│ │ │ │ │ │ └────────────────────────────────────────┘ │ @@ -225,7 +225,7 @@ User runs: interfold ciphernode tickets buy --amount 100 ### Why tickets are non-transferable: -ITK tokens cannot be transferred between addresses. This ensures: +tFOLD tokens cannot be transferred between addresses. This ensures: - An operator's collateral can't be moved to avoid slashing - The ticket balance is always attributable to the specific operator @@ -250,7 +250,7 @@ User runs: interfold ciphernode license unbond --amount 10000 │ │ │ 4. _exits.queueLicensesForExit( │ │ │ │ msg.sender, exitDelay, amount │ │ │ │ ) │ -│ │ │ → Pending INTF still counts in totalBonded() │ +│ │ │ → Pending FOLD still counts in totalBonded() │ │ │ │ until claimed or slashed │ │ │ │ 5. _updateOperatorStatus(msg.sender) │ │ │ │ → May DEACTIVATE if bond drops below threshold │ @@ -265,9 +265,9 @@ User runs: interfold ciphernode license unbond --amount 10000 ## Step 4: Burn Tickets (`interfold ciphernode tickets burn`) -> **IMPORTANT:** Like `addTicketBalance`, the `amount` here is in **raw stablecoin base units** (ITK -> units, which are 1:1 with underlying). There is NO `ticketPrice` multiplication. The CLI parses -> the user's amount using the ticket token's decimals. +> **IMPORTANT:** Like `addTicketBalance`, the `amount` here is in **raw stablecoin base units** +> (tFOLD units, which are 1:1 with underlying). There is NO `ticketPrice` multiplication. The CLI +> parses the user's amount using the ticket token's decimals. ``` User runs: interfold ciphernode tickets burn --amount 50 @@ -290,7 +290,7 @@ User runs: interfold ciphernode tickets burn --amount 50 │ │ │ │ │ burnTickets(operator, amount): │ │ │ │ │ │ │ payableBalance += amount │ │ │ │ │ │ │ _burn(operator, amount) │ │ -│ │ │ │ │ → ITK destroyed │ │ +│ │ │ │ │ → tFOLD destroyed │ │ │ │ │ │ │ → Underlying USDC NOT returned yet │ │ │ │ │ │ │ → Tracked in payableBalance for │ │ │ │ │ │ │ later payout() │ │ @@ -348,15 +348,15 @@ User runs: interfold ciphernode license claim [--max-ticket 50] [--max-license 1 │ │ │ 3. licenseAmount = _claimLicenseExits( │ │ │ │ msg.sender, maxLicense │ │ │ │ ) │ -│ │ │ → Each INTF source pays its withdrawalAddress │ +│ │ │ → Each FOLD source pays its withdrawalAddress │ │ │ │ → Receiver callback gets (operator, amount, │ │ │ │ sourceId) when supported │ -│ │ │ → Pending INTF is removed from totalBonded() │ -│ │ │ as returned INTF reaches the wallet │ +│ │ │ → Pending FOLD is removed from totalBonded() │ +│ │ │ as returned FOLD reaches the wallet │ │ │ │ } │ │ │ └───────────────────────────────────────────────────────┘ │ -└─ Operator receives back USDC; INTF goes to each source's withdrawal address +└─ Operator receives back USDC; FOLD goes to each source's withdrawal address ``` --- @@ -365,7 +365,7 @@ User runs: interfold ciphernode license claim [--max-ticket 50] [--max-license 1 | Requirement | Default | Description | | --------------------- | ------------------- | ------------------------------------------ | -| `licenseRequiredBond` | Configured by owner | Min INTF to register | +| `licenseRequiredBond` | Configured by owner | Min FOLD to register | | `licenseActiveBps` | 8000 (80%) | % of required bond to stay active | | `minTicketBalance` | Configured by owner | Min tickets for active status | | `ticketPrice` | Configured by owner | Stablecoin cost per ticket (in base units) | @@ -387,21 +387,21 @@ active = registered BOND LICENSE BUY TICKETS ──────────── ─────────── Operator Operator - INTF wallet ──→ BondingRegistry USDC wallet ──→ InterfoldTicketToken - (licenseBond++) (wraps USDC → mints ITK) - ITK → Operator balance + FOLD wallet ──→ BondingRegistry USDC wallet ──→ InterfoldTicketToken + (licenseBond++) (wraps USDC → mints tFOLD) + tFOLD → Operator balance UNBOND LICENSE BURN TICKETS ────────────── ──────────── - licenseBond -= amount ITK burned from operator - amount → ExitQueue (locked) USDC stays in ITK contract (payableBalance) + licenseBond -= amount tFOLD burned from operator + amount → ExitQueue (locked) USDC stays in tFOLD contract (payableBalance) amount → ExitQueue (locked) CLAIM EXITS ─────────── After exitDelay seconds: - INTF → returned to source withdrawal address - USDC → paid out from ITK.payableBalance + FOLD → returned to source withdrawal address + USDC → paid out from tFOLD.payableBalance ``` --- @@ -411,7 +411,7 @@ active = registered The token contracts were hardened against the following audit findings. All changes are covered by `packages/interfold-contracts/test/Token/` and have no runtime impact outside the touched contracts. -### InterfoldTicketToken (ITK) +### InterfoldTicketToken (tFOLD) - **H-02 — registry initialization.** The constructor now takes `(IERC20 baseToken, address registry_, address initialOwner_)` and assigns `registry = registry_` @@ -434,9 +434,9 @@ The token contracts were hardened against the following audit findings. All chan - **M-29 — EIP-6372 timestamp clock.** `clock() = uint48(block.timestamp)`, `CLOCK_MODE() = "mode=timestamp"`. -### InterfoldToken (INTF) — Complete Rewrite +### InterfoldToken (FOLD) — Complete Rewrite -The INTF token was rewritten to implement a CCA-auction-aligned lifecycle with wallet-level lock +The FOLD token was rewritten to implement a CCA-auction-aligned lifecycle with wallet-level lock enforcement based on immutable policy curves. Key changes: - **Phase-based lifecycle.** The token derives its phase from immutable `CCA_START` / `CCA_END` and @@ -472,4 +472,4 @@ enforcement based on immutable policy curves. Key changes: field names are preserved for backwards compatibility). All callers — including `BondingRegistry.getTicketBalanceAtBlock(node, c.requestBlock - 1)` — pass the value through unchanged; the parameter is now a timepoint per EIP-6372 rather than a block number, which is - required for the ITK timestamp clock to be valid. + required for the tFOLD timestamp clock to be valid. diff --git a/agent/flow-trace/05_FAILURE_REFUND_SLASHING.md b/agent/flow-trace/05_FAILURE_REFUND_SLASHING.md index ebdfbcd23..63ad0c7d9 100644 --- a/agent/flow-trace/05_FAILURE_REFUND_SLASHING.md +++ b/agent/flow-trace/05_FAILURE_REFUND_SLASHING.md @@ -635,7 +635,7 @@ _executeSlash(proposalId): │ │ │ activeBalance = ticketToken.balanceOf(operator) │ │ │ │ slashFromActive = min(amount, activeBalance) │ │ │ │ ticketToken.burnTickets(operator, slashFromActive)│ -│ │ │ → Burns ITK, underlying stays as payableBalance │ +│ │ │ → Burns tFOLD, underlying stays as payableBalance │ │ │ │ │ │ │ │ 2. Remaining from EXIT QUEUE: │ │ │ │ remaining = amount - slashFromActive │ @@ -661,7 +661,7 @@ _executeSlash(proposalId): │ │ │ │ ┌─── BondingRegistry.slashLicenseBond() ───────────────┐ │ │ │ │ -│ │ │ 1. Compute active + pending INTF source total │ +│ │ │ 1. Compute active + pending FOLD source total │ │ │ │ │ │ │ │ 2. _slashLicenseSourcesLifo(operator, amount): │ │ │ │ Compare newest active source sequence with │ @@ -670,7 +670,7 @@ _executeSlash(proposalId): │ │ │ → Active slash decrements operators[op].licenseBond│ │ │ │ → Pending slash decrements pending license totals │ │ │ │ → totalBonded(op) drops immediately; if op has │ -│ │ │ token-level locks, same-wallet INTF may become │ +│ │ │ token-level locks, same-wallet FOLD may become │ │ │ │ encumbered until the locked floor decays/top-up │ │ │ │ → Receiver callback gets (operator, amount, │ │ │ │ sourceId) when supported │ @@ -898,7 +898,7 @@ Case 4: E3 completes successfully with escrowed slashed funds ``` SlashPolicy { ticketPenalty: uint256 // tickets to slash (in base units) - licensePenalty: uint256 // INTF to slash + licensePenalty: uint256 // FOLD to slash requiresProof: bool // Lane A (true) or Lane B (false) proofVerifier: address // verifier address (Lane A: used in policy lookup) banNode: bool // permanently ban operator @@ -1025,7 +1025,7 @@ FALLBACK: TREASURY WITHDRAWAL → licenseToken.safeTransfer(treasury, licenseAmount) Effect: slashedTicketBalance decremented -License bond slashes always go to treasury (no escrow routing for INTF). +License bond slashes always go to treasury (no escrow routing for FOLD). ``` --- diff --git a/agent/flow-trace/06_DEACTIVATION_AND_COMPLETION.md b/agent/flow-trace/06_DEACTIVATION_AND_COMPLETION.md index 066ecf78f..4ca7fa79e 100644 --- a/agent/flow-trace/06_DEACTIVATION_AND_COMPLETION.md +++ b/agent/flow-trace/06_DEACTIVATION_AND_COMPLETION.md @@ -22,9 +22,9 @@ User runs: interfold ciphernode deactivate --tickets 50 │ ┌─── ON-CHAIN (BondingRegistry.sol) ─────────────────────┐ │ │ │ │ │ removeTicketBalance(50): │ - │ │ 1. require(amount != 0, registered, sufficient ITK) │ + │ │ 1. require(amount != 0, registered, sufficient tFOLD) │ │ │ 2. ticketToken.burnTickets(operator, amount) │ - │ │ → ITK destroyed, underlying becomes claimable │ + │ │ → tFOLD destroyed, underlying becomes claimable │ │ │ 3. _exits.queueTicketsForExit( │ │ │ operator, exitDelay, amount │ │ │ ) │ @@ -51,10 +51,10 @@ User runs: interfold ciphernode deactivate --license 20000 │ ┌─── ON-CHAIN ───────────────────────────────────────────┐ │ │ │ │ │ unbondLicense(20000): │ - │ │ 1. require(amount != 0, sufficient bonded INTF) │ + │ │ 1. require(amount != 0, sufficient bonded FOLD) │ │ │ 2. operators[op].licenseBond -= 20000 │ │ │ 3. _exits.queueLicensesForExit(op, exitDelay, 20000)│ - │ │ → Pending INTF remains in totalBonded(op) for │ + │ │ → Pending FOLD remains in totalBonded(op) for │ │ │ token-level locked-floor accounting │ │ │ 4. _updateOperatorStatus(operator) │ │ │ → If licenseBond < │ @@ -75,7 +75,7 @@ User runs: interfold ciphernode deactivate --tickets 50 --license 20000 ├─ Calls removeTicketBalance(50) first └─ Then calls unbondLicense(20000) → Tickets are queued in ExitQueueLib - → INTF is queued in ExitQueueLib pending license exits and remains counted in totalBonded() + → FOLD is queued in ExitQueueLib pending license exits and remains counted in totalBonded() ``` --- @@ -279,8 +279,8 @@ Time ───────────────────────── │ or deactivate() │ EXIT DELAY │ │ │ │ (configured) │ │ │ Assets queued │ │ Assets claimable │ -│ ITK burned │ Cannot cancel │ USDC returned │ -│ INTF locked │ Can be slashed! │ INTF returned to │ +│ tFOLD burned │ Cannot cancel │ USDC returned │ +│ FOLD locked │ Can be slashed! │ FOLD returned to │ │ │ │ withdrawal addr │ │ │ │ │ diff --git a/packages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json b/packages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json index 03bf2ee04..7ba594e6a 100644 --- a/packages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json +++ b/packages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json @@ -1081,5 +1081,5 @@ "deployedLinkReferences": {}, "immutableReferences": {}, "inputSourceName": "project/contracts/interfaces/IBondingRegistry.sol", - "buildInfoId": "solc-0_8_28-a92c823a7221deb8999e5c2c611c376dca846b23" + "buildInfoId": "solc-0_8_28-9672985902d4f3c60307b637e6940bacad029c39" } \ No newline at end of file diff --git a/packages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json b/packages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json index 9cad34db1..58cf67401 100644 --- a/packages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json +++ b/packages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json @@ -1332,5 +1332,5 @@ "deployedLinkReferences": {}, "immutableReferences": {}, "inputSourceName": "project/contracts/interfaces/ICiphernodeRegistry.sol", - "buildInfoId": "solc-0_8_28-a92c823a7221deb8999e5c2c611c376dca846b23" + "buildInfoId": "solc-0_8_28-9672985902d4f3c60307b637e6940bacad029c39" } \ No newline at end of file diff --git a/packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json b/packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json index 7628c8053..269316c76 100644 --- a/packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json +++ b/packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json @@ -2390,5 +2390,5 @@ "deployedLinkReferences": {}, "immutableReferences": {}, "inputSourceName": "project/contracts/interfaces/IInterfold.sol", - "buildInfoId": "solc-0_8_28-a92c823a7221deb8999e5c2c611c376dca846b23" + "buildInfoId": "solc-0_8_28-9672985902d4f3c60307b637e6940bacad029c39" } \ No newline at end of file diff --git a/packages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json b/packages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json index 7445a7ec7..bb816d015 100644 --- a/packages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json +++ b/packages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json @@ -1233,5 +1233,5 @@ "deployedLinkReferences": {}, "immutableReferences": {}, "inputSourceName": "project/contracts/interfaces/ISlashingManager.sol", - "buildInfoId": "solc-0_8_28-a92c823a7221deb8999e5c2c611c376dca846b23" + "buildInfoId": "solc-0_8_28-9672985902d4f3c60307b637e6940bacad029c39" } \ No newline at end of file diff --git a/packages/interfold-contracts/artifacts/contracts/token/InterfoldTicketToken.sol/InterfoldTicketToken.json b/packages/interfold-contracts/artifacts/contracts/token/InterfoldTicketToken.sol/InterfoldTicketToken.json index 6111a835f..3d529b19d 100644 --- a/packages/interfold-contracts/artifacts/contracts/token/InterfoldTicketToken.sol/InterfoldTicketToken.json +++ b/packages/interfold-contracts/artifacts/contracts/token/InterfoldTicketToken.sol/InterfoldTicketToken.json @@ -1423,12 +1423,12 @@ "type": "function" } ], - "bytecode": "0x61018060405234801561001157600080fd5b50604051612ed4380380612ed483398101604081905261003091610387565b82816040518060400160405280601681526020017f496e746572666f6c64205469636b657420546f6b656e0000000000000000000081525080604051806040016040528060018152602001603160f81b8152506040518060400160405280601681526020017f496e746572666f6c64205469636b657420546f6b656e000000000000000000008152506040518060400160405280600381526020016249544b60e81b81525081600390816100e49190610473565b5060046100f18282610473565b5061010191508390506005610293565b61012052610110816006610293565b61014052815160208084019190912060e052815190820120610100524660a05261019d60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c052506001600160a01b0381166101da576000604051631e4fbdf760e01b81526004016101d19190610531565b60405180910390fd5b6101e3816102c6565b50306001600160a01b0382160361020f573060405163438d6fe360e01b81526004016101d19190610531565b6001600160a01b03908116610160526001600d5582166102425760405163d92e233d60e01b815260040160405180910390fd5b600e80546001600160a01b0319166001600160a01b0384169081179091556040516000907f4803049971913703d2dd43c06110dc7fad451e4603e9f485cbeebdda11263ab0908290a35050506105b7565b60006020835110156102af576102a8836102e2565b90506102c0565b816102ba8482610473565b5060ff90505b92915050565b600c80546001600160a01b03191690556102df81610320565b50565b600080829050601f8151111561030d578260405163305a27a960e01b81526004016101d19190610545565b805161031882610593565b179392505050565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811681146102df57600080fd5b60008060006060848603121561039c57600080fd5b83516103a781610372565b60208501519093506103b881610372565b60408501519092506103c981610372565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806103fe57607f821691505b60208210810361041e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561046e57806000526020600020601f840160051c8101602085101561044b5750805b601f840160051c820191505b8181101561046b5760008155600101610457565b50505b505050565b81516001600160401b0381111561048c5761048c6103d4565b6104a08161049a84546103ea565b84610424565b6020601f8211600181146104d457600083156104bc5750848201515b600019600385901b1c1916600184901b17845561046b565b600084815260208120601f198516915b8281101561050457878501518255602094850194600190920191016104e4565b50848210156105225786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6001600160a01b0391909116815260200190565b602081526000825180602084015260005b818110156105735760208186018101516040868401015201610556565b506000604082850101526040601f19601f83011684010191505092915050565b8051602080830151919081101561041e5760001960209190910360031b1b16919050565b60805160a05160c05160e051610100516101205161014051610160516128aa61062a60003960008181610c3001528181611327015261152b01526000611865015260006118380152600061168c01526000611664015260006115bf015260006115e90152600061161301526128aa6000f3fe608060405234801561001057600080fd5b506004361061021a5760003560e01c806306fdde031461021f578063095ea7b31461023d578063117de2fd1461026057806318160ddd14610275578063205c28781461028757806323b872dd1461029a5780632b596f6d146102ad5780632f4f21e2146102b5578063313ce567146102c85780633644e515146102e25780633a46b1a8146102ea578063406c66e7146102fd57806341da29801461032457806344b279a2146103445780634bf5d7e91461034d5780635146034a14610377578063587cde1e146103815780635c19a95c1461039457806368a9674d146103a75780636f307dc3146103ba5780636fcfff45146103c257806370a08231146103ea578063715018a6146103fd57806379b47f401461040557806379ba5097146104195780637b103999146104215780637ecebe001461043457806384b0196e1461044757806385bc898c146104625780638da5cb5b146104755780638e539e8c1461047d57806391ddadf41461049057806393000487146104a657806395d89b41146104ae5780639ab24eb0146104b6578063a9059cbb146104c9578063a91ee0dc146104dc578063aabf2d60146104ef578063b2118a8d146104f7578063c3cda5201461050a578063d505accf1461051d578063dd62ed3e14610530578063e30c397814610543578063e8ba64711461054b578063f1127ed81461055e578063f2fde38b1461059d575b600080fd5b6102276105b0565b60405161023491906123fb565b60405180910390f35b61025061024b366004612423565b610642565b6040519015158152602001610234565b61027361026e366004612423565b61065d565b005b6002545b604051908152602001610234565b610250610295366004612423565b610708565b6102506102a836600461244f565b61075a565b610273610780565b6102506102c3366004612423565b6107f1565b6102d06109af565b60405160ff9091168152602001610234565b6102796109be565b6102796102f8366004612423565b6109c8565b600f5461031790600160a01b90046001600160401b031681565b6040516102349190612490565b600f54610337906001600160a01b031681565b60405161023491906124a4565b61027960105481565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610227565b6103176201518081565b61033761038f3660046124b8565b610a04565b6102736103a23660046124b8565b610a22565b6102506103b536600461244f565b610a70565b610337610c2e565b6103d56103d03660046124b8565b610c52565b60405163ffffffff9091168152602001610234565b6102796103f83660046124b8565b610c5d565b610273610c78565b600f5461025090600160e01b900460ff1681565b610273610c9c565b600e54610337906001600160a01b031681565b6102796104423660046124b8565b610ce1565b61044f610cec565b60405161023497969594939291906124d5565b610273610470366004612423565b610d32565b610337610d83565b61027961048b36600461256d565b610d92565b60405165ffffffffffff42168152602001610234565b610273610db7565b610227610e6c565b6102796104c43660046124b8565b610e7b565b6102506104d7366004612423565b610e9c565b6102736104ea3660046124b8565b610eb4565b610273610f4e565b61027361050536600461244f565b610fc7565b610273610518366004612595565b611095565b61027361052b3660046125f1565b6110ae565b61027961053e366004612662565b6110c6565b6103376110f1565b6102736105593660046124b8565b611100565b61057161056c36600461269b565b6111e5565b60408051825165ffffffffffff1681526020928301516001600160d01b03169281019290925201610234565b6102736105ab3660046124b8565b6111f7565b6060600380546105bf906126d2565b80601f01602080910402602001604051908101604052809291908181526020018280546105eb906126d2565b80156106385780601f1061060d57610100808354040283529160200191610638565b820191906000526020600020905b81548152906001019060200180831161061b57829003601f168201915b5050505050905090565b6000604051638cd22d1960e01b815260040160405180910390fd5b600e546001600160a01b0316331461068857604051633217675b60e21b815260040160405180910390fd5b60105481111561069757600080fd5b80601060008282546106a99190612722565b909155506106c190506106ba610c2e565b838361125d565b816001600160a01b03167f5afeca38b2064c23a692c4cf353015d80ab3ecc417b4f893f372690c11fbd9a6826040516106fc91815260200190565b60405180910390a25050565b600e546000906001600160a01b0316331461073657604051633217675b60e21b815260040160405180910390fd5b61073e6112c1565b61074883836112eb565b90506107546001600d55565b92915050565b600033610768858285611356565b6107738585856113aa565b60019150505b9392505050565b610788611409565b600f54600160e01b900460ff16156107b357604051630e92b53f60e01b815260040160405180910390fd5b600f805460ff60e01b1916600160e01b1790556040517f78a4e7d992eeb14841bd804441e7062105649d0bcc77a4c0dfa33b28f438937e90600090a1565b600e546000906001600160a01b0316331461081f57604051633217675b60e21b815260040160405180910390fd5b6108276112c1565b6001600160a01b038316158061084557506001600160a01b03831630145b156108635760405163d92e233d60e01b815260040160405180910390fd5b600061086d610c2e565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161089d91906124a4565b602060405180830381865afa1580156108ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108de9190612735565b90506108f56001600160a01b03831633308761143d565b600081836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161092491906124a4565b602060405180830381865afa158015610941573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109659190612735565b61096f9190612722565b905061097b8682611476565b600061098687610a04565b6001600160a01b03160361099e5761099e86876114ac565b600193505050506107546001600d55565b60006109b9611527565b905090565b60006109b96115b2565b60006109f46109d6836116dd565b6001600160a01b038516600090815260096020526040902090611722565b6001600160d01b03169392505050565b6001600160a01b039081166000908152600860205260409020541690565b6001600160a01b0381163314610a4b57604051635e81118160e11b815260040160405180910390fd5b33610a5581610a04565b6001600160a01b031614610a6d57610a6d33336114ac565b50565b600e546000906001600160a01b03163314610a9e57604051633217675b60e21b815260040160405180910390fd5b610aa66112c1565b6001600160a01b0383161580610ac457506001600160a01b03831630145b15610ae25760405163d92e233d60e01b815260040160405180910390fd5b6000610aec610c2e565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b1c91906124a4565b602060405180830381865afa158015610b39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d9190612735565b9050610b746001600160a01b03831687308761143d565b600081836001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610ba391906124a4565b602060405180830381865afa158015610bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be49190612735565b610bee9190612722565b9050610bfa8682611476565b6000610c0587610a04565b6001600160a01b031603610c1d57610c1d86876114ac565b600193505050506107796001600d55565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000610754826117d8565b6001600160a01b031660009081526020819052604090205490565b610c80611409565b6040516001623f026d60e01b0319815260040160405180910390fd5b3380610ca66110f1565b6001600160a01b031614610cd8578060405163118cdaa760e01b8152600401610ccf91906124a4565b60405180910390fd5b610a6d816117fa565b600061075482611813565b600060608060008060006060610d00611831565b610d0861185e565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600e546001600160a01b03163314610d5d57604051633217675b60e21b815260040160405180910390fd5b8060106000828254610d6f919061274e565b90915550610d7f9050828261188b565b5050565b600b546001600160a01b031690565b6000610da8610da0836116dd565b600a90611722565b6001600160d01b031692915050565b610dbf611409565b600f546001600160a01b031680610de957604051632810857b60e01b815260040160405180910390fd5b600f54600160a01b90046001600160401b0316421015610e1c5760405163dc25bbd360e01b815260040160405180910390fd5b600e80546001600160a01b038381166001600160a01b031983168117909355600f80546001600160e01b031916905560405191169190829060008051602061285e83398151915290600090a35050565b6060600480546105bf906126d2565b6001600160a01b0381166000908152600960205260408120610da8906118c1565b600033610eaa8185856113aa565b5060019392505050565b610ebc611409565b600f54600160e01b900460ff1615610ee75760405163e4d1dbdb60e01b815260040160405180910390fd5b6001600160a01b038116610f0e5760405163d92e233d60e01b815260040160405180910390fd5b600e80546001600160a01b038381166001600160a01b03198316811790935560405191169190829060008051602061285e83398151915290600090a35050565b610f56611409565b600f546001600160a01b031680610f8057604051632810857b60e01b815260040160405180910390fd5b600f80546001600160e01b03191690556040516001600160a01b038216907fa129fdeaad5381eaad4da2f3131ccb44f798dc53387876fb9ecf6eb3a94c7be890600090a250565b610fcf611409565b610fd7610c2e565b6001600160a01b0316836001600160a01b0316036110085760405163068a860d60e41b815260040160405180910390fd5b6001600160a01b03821661102f5760405163d92e233d60e01b815260040160405180910390fd5b6110436001600160a01b038416838361125d565b816001600160a01b0316836001600160a01b03167f8bbfbb5d7fcacf6fc74005cdede0635561638507f576c95f7f294c22141be2e58360405161108891815260200190565b60405180910390a3505050565b604051635e81118160e11b815260040160405180910390fd5b604051624d381d60e41b815260040160405180910390fd5b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600c546001600160a01b031690565b611108611409565b600f54600160e01b900460ff16611132576040516305a2606f60e11b815260040160405180910390fd5b6001600160a01b0381166111595760405163d92e233d60e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b03831617905560006111836201518042612761565b600f8054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040519091506001600160a01b038316907f1801c99f71f2ce0769882ce1c9c5f45a726be342fc22e404fc331e4186a9c12d906106fc908490612490565b6111ed61239e565b61077983836118fa565b6111ff611409565b600c80546001600160a01b0319166001600160a01b038316908117909155611225610d83565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6040516001600160a01b038381166024830152604482018390526112bc91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611924565b505050565b6002600d54036112e457604051633ee5aeb560e01b815260040160405180910390fd5b6002600d55565b6000306001600160a01b03841603611318578260405163ec442f0560e01b8152600401610ccf91906124a4565b611322338361188b565b61134d7f0000000000000000000000000000000000000000000000000000000000000000848461125d565b50600192915050565b600061136284846110c6565b90506000198110156113a4578181101561139557828183604051637dc7a0d960e11b8152600401610ccf93929190612780565b6113a48484848403600061198c565b50505050565b6001600160a01b0383166113d4576000604051634b637e8f60e11b8152600401610ccf91906124a4565b6001600160a01b0382166113fe57600060405163ec442f0560e01b8152600401610ccf91906124a4565b6112bc838383611a61565b33611412610d83565b6001600160a01b03161461143b573360405163118cdaa760e01b8152600401610ccf91906124a4565b565b6040516001600160a01b0384811660248301528381166044830152606482018390526113a49186918216906323b872dd9060840161128a565b6001600160a01b0382166114a057600060405163ec442f0560e01b8152600401610ccf91906124a4565b610d7f60008383611a61565b60006114b783610a04565b6001600160a01b0384811660008181526008602052604080822080546001600160a01b031916888616908117909155905194955093928516927f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46112bc818361152286611aaa565b611ab5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115a3575060408051601f3d908101601f191682019092526115a0918101906127a1565b60015b6115ad5750601290565b919050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561160b57507f000000000000000000000000000000000000000000000000000000000000000046145b1561163557507f000000000000000000000000000000000000000000000000000000000000000090565b6109b9604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60004265ffffffffffff8116831061171957604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610ccf565b61077983611bfd565b81546000908181600581111561178157600061173d84611c2f565b6117479085612722565b60008881526020902090915081015465ffffffffffff90811690871610156117715780915061177f565b61177c81600161274e565b92505b505b600061178f87878585611d82565b905080156117ca576117b4876117a6600184612722565b600091825260209091200190565b54600160301b90046001600160d01b03166117cd565b60005b979650505050505050565b6001600160a01b03811660009081526009602052604081205461075490611de4565b600c80546001600160a01b0319169055610a6d81611e10565b6001600160a01b038116600090815260076020526040812054610754565b60606109b97f00000000000000000000000000000000000000000000000000000000000000006005611e62565b60606109b97f00000000000000000000000000000000000000000000000000000000000000006006611e62565b6001600160a01b0382166118b5576000604051634b637e8f60e11b8152600401610ccf91906124a4565b610d7f82600083611a61565b805460009080156118f1576118db836117a6600184612722565b54600160301b90046001600160d01b0316610779565b60009392505050565b61190261239e565b6001600160a01b03831660009081526009602052604090206107799083611f0d565b600080602060008451602086016000885af180611947576040513d6000823e3d81fd5b50506000513d9150811561195f57806001141561196c565b6001600160a01b0384163b155b156113a45783604051635274afe760e01b8152600401610ccf91906124a4565b6001600160a01b0384166119b657600060405163e602df0560e01b8152600401610ccf91906124a4565b6001600160a01b0383166119e0576000604051634a1406b160e11b8152600401610ccf91906124a4565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156113a457826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611a5391815260200190565b60405180910390a350505050565b6001600160a01b03831615801590611a8157506001600160a01b03821615155b15611a9f57604051638cd22d1960e01b815260040160405180910390fd5b6112bc838383611f71565b600061075482610c5d565b816001600160a01b0316836001600160a01b031614158015611ad75750600081115b156112bc576001600160a01b03831615611b6d576001600160a01b03831660009081526009602052604081208190611b1a90611fd8611b1586611fe4565b612013565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602061287e8339815191528383604051611b62929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156112bc576001600160a01b03821660009081526009602052604081208190611ba690612045611b1586611fe4565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602061287e8339815191528383604051611bee929190918252602082015260400190565b60405180910390a25050505050565b600065ffffffffffff821115611c2b576030826040516306dfcc6560e41b8152600401610ccf9291906127be565b5090565b600060018211611c3d575090565b816001600160801b8210611c565760809190911c9060401b5b600160401b8210611c6c5760409190911c9060201b5b600160201b8210611c825760209190911c9060101b5b620100008210611c975760109190911c9060081b5b6101008210611cab5760089190911c9060041b5b60108210611cbe5760049190911c9060021b5b60048210611cca5760011b5b600302600190811c90818581611ce257611ce26127d1565b048201901c90506001818581611cfa57611cfa6127d1565b048201901c90506001818581611d1257611d126127d1565b048201901c90506001818581611d2a57611d2a6127d1565b048201901c90506001818581611d4257611d426127d1565b048201901c90506001818581611d5a57611d5a6127d1565b048201901c9050611d79818581611d7357611d736127d1565b04821190565b90039392505050565b60005b81831015611ddc576000611d998484612051565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff161115611dc857809250611dd6565b611dd381600161274e565b93505b50611d85565b509392505050565b600063ffffffff821115611c2b576020826040516306dfcc6560e41b8152600401610ccf9291906127be565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060ff8314611e7c57611e758361206c565b9050610754565b818054611e88906126d2565b80601f0160208091040260200160405190810160405280929190818152602001828054611eb4906126d2565b8015611f015780601f10611ed657610100808354040283529160200191611f01565b820191906000526020600020905b815481529060010190602001808311611ee457829003601f168201915b50505050509050610754565b611f1561239e565b826000018263ffffffff1681548110611f3057611f306127e7565b60009182526020918290206040805180820190915291015465ffffffffffff81168252600160301b90046001600160d01b0316918101919091529392505050565b611f7c8383836120ab565b6001600160a01b038316611fcd576000611f9560025490565b90506001600160d01b0380821115611fca57604051630e58ae9360e11b81526004810183905260248101829052604401610ccf565b50505b6112bc8383836121b5565b600061077982846127fd565b60006001600160d01b03821115611c2b5760d0826040516306dfcc6560e41b8152600401610ccf9291906127be565b60008061203842612030612026886118c1565b868863ffffffff16565b879190612214565b915091505b935093915050565b6000610779828461281c565b6000612060600284841861283b565b6107799084841661274e565b6060600061207983612222565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6001600160a01b0383166120d65780600260008282546120cb919061274e565b909155506121359050565b6001600160a01b038316600090815260208190526040902054818110156121165783818360405163391434e360e21b8152600401610ccf93929190612780565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661215157600280548290039055612170565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161108891815260200190565b6001600160a01b0383166121d7576121d4600a612045611b1584611fe4565b50505b6001600160a01b0382166121f9576121f6600a611fd8611b1584611fe4565b50505b6112bc61220584610a04565b61220e84610a04565b83611ab5565b60008061203885858561224a565b600060ff8216601f81111561075457604051632cd44ac360e21b815260040160405180910390fd5b825460009081908015612343576000612268876117a6600185612722565b805490915065ffffffffffff80821691600160301b90046001600160d01b03169088168211156122ab57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036122e457825465ffffffffffff16600160301b6001600160d01b03891602178355612335565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b945085935061203d92505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b02919093161792019190915590508161203d565b604080518082019091526000808252602082015290565b6000815180845260005b818110156123db576020818501810151868301820152016123bf565b506000602082860101526020601f19601f83011685010191505092915050565b60208152600061077960208301846123b5565b6001600160a01b0381168114610a6d57600080fd5b6000806040838503121561243657600080fd5b82356124418161240e565b946020939093013593505050565b60008060006060848603121561246457600080fd5b833561246f8161240e565b9250602084013561247f8161240e565b929592945050506040919091013590565b6001600160401b0391909116815260200190565b6001600160a01b0391909116815260200190565b6000602082840312156124ca57600080fd5b81356107798161240e565b60ff60f81b8816815260e0602082015260006124f460e08301896123b5565b828103604084015261250681896123b5565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561255c57835183526020938401939092019160010161253e565b50909b9a5050505050505050505050565b60006020828403121561257f57600080fd5b5035919050565b60ff81168114610a6d57600080fd5b60008060008060008060c087890312156125ae57600080fd5b86356125b98161240e565b9550602087013594506040870135935060608701356125d781612586565b9598949750929560808101359460a0909101359350915050565b600080600080600080600060e0888a03121561260c57600080fd5b87356126178161240e565b965060208801356126278161240e565b95506040880135945060608801359350608088013561264581612586565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561267557600080fd5b82356126808161240e565b915060208301356126908161240e565b809150509250929050565b600080604083850312156126ae57600080fd5b82356126b98161240e565b9150602083013563ffffffff8116811461269057600080fd5b600181811c908216806126e657607f821691505b60208210810361270657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156107545761075461270c565b60006020828403121561274757600080fd5b5051919050565b808201808211156107545761075461270c565b6001600160401b0381811683821601908111156107545761075461270c565b6001600160a01b039390931683526020830191909152604082015260600190565b6000602082840312156127b357600080fd5b815161077981612586565b60ff929092168252602082015260400190565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160d01b0382811682821603908111156107545761075461270c565b6001600160d01b0381811683821601908111156107545761075461270c565b60008261285857634e487b7160e01b600052601260045260246000fd5b50049056fe4803049971913703d2dd43c06110dc7fad451e4603e9f485cbeebdda11263ab0dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724a164736f6c634300081c000a", + "bytecode": "0x61018060405234801561001157600080fd5b50604051612ed6380380612ed683398101604081905261003091610389565b82816040518060400160405280601681526020017f496e746572666f6c64205469636b657420546f6b656e0000000000000000000081525080604051806040016040528060018152602001603160f81b8152506040518060400160405280601681526020017f496e746572666f6c64205469636b657420546f6b656e00000000000000000000815250604051806040016040528060058152602001641d1193d31160da1b81525081600390816100e69190610475565b5060046100f38282610475565b5061010391508390506005610295565b61012052610112816006610295565b61014052815160208084019190912060e052815190820120610100524660a05261019f60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c052506001600160a01b0381166101dc576000604051631e4fbdf760e01b81526004016101d39190610533565b60405180910390fd5b6101e5816102c8565b50306001600160a01b03821603610211573060405163438d6fe360e01b81526004016101d39190610533565b6001600160a01b03908116610160526001600d5582166102445760405163d92e233d60e01b815260040160405180910390fd5b600e80546001600160a01b0319166001600160a01b0384169081179091556040516000907f4803049971913703d2dd43c06110dc7fad451e4603e9f485cbeebdda11263ab0908290a35050506105b9565b60006020835110156102b1576102aa836102e4565b90506102c2565b816102bc8482610475565b5060ff90505b92915050565b600c80546001600160a01b03191690556102e181610322565b50565b600080829050601f8151111561030f578260405163305a27a960e01b81526004016101d39190610547565b805161031a82610595565b179392505050565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811681146102e157600080fd5b60008060006060848603121561039e57600080fd5b83516103a981610374565b60208501519093506103ba81610374565b60408501519092506103cb81610374565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061040057607f821691505b60208210810361042057634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561047057806000526020600020601f840160051c8101602085101561044d5750805b601f840160051c820191505b8181101561046d5760008155600101610459565b50505b505050565b81516001600160401b0381111561048e5761048e6103d6565b6104a28161049c84546103ec565b84610426565b6020601f8211600181146104d657600083156104be5750848201515b600019600385901b1c1916600184901b17845561046d565b600084815260208120601f198516915b8281101561050657878501518255602094850194600190920191016104e6565b50848210156105245786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6001600160a01b0391909116815260200190565b602081526000825180602084015260005b818110156105755760208186018101516040868401015201610558565b506000604082850101526040601f19601f83011684010191505092915050565b805160208083015191908110156104205760001960209190910360031b1b16919050565b60805160a05160c05160e051610100516101205161014051610160516128aa61062c60003960008181610c3001528181611327015261152b01526000611865015260006118380152600061168c01526000611664015260006115bf015260006115e90152600061161301526128aa6000f3fe608060405234801561001057600080fd5b506004361061021a5760003560e01c806306fdde031461021f578063095ea7b31461023d578063117de2fd1461026057806318160ddd14610275578063205c28781461028757806323b872dd1461029a5780632b596f6d146102ad5780632f4f21e2146102b5578063313ce567146102c85780633644e515146102e25780633a46b1a8146102ea578063406c66e7146102fd57806341da29801461032457806344b279a2146103445780634bf5d7e91461034d5780635146034a14610377578063587cde1e146103815780635c19a95c1461039457806368a9674d146103a75780636f307dc3146103ba5780636fcfff45146103c257806370a08231146103ea578063715018a6146103fd57806379b47f401461040557806379ba5097146104195780637b103999146104215780637ecebe001461043457806384b0196e1461044757806385bc898c146104625780638da5cb5b146104755780638e539e8c1461047d57806391ddadf41461049057806393000487146104a657806395d89b41146104ae5780639ab24eb0146104b6578063a9059cbb146104c9578063a91ee0dc146104dc578063aabf2d60146104ef578063b2118a8d146104f7578063c3cda5201461050a578063d505accf1461051d578063dd62ed3e14610530578063e30c397814610543578063e8ba64711461054b578063f1127ed81461055e578063f2fde38b1461059d575b600080fd5b6102276105b0565b60405161023491906123fb565b60405180910390f35b61025061024b366004612423565b610642565b6040519015158152602001610234565b61027361026e366004612423565b61065d565b005b6002545b604051908152602001610234565b610250610295366004612423565b610708565b6102506102a836600461244f565b61075a565b610273610780565b6102506102c3366004612423565b6107f1565b6102d06109af565b60405160ff9091168152602001610234565b6102796109be565b6102796102f8366004612423565b6109c8565b600f5461031790600160a01b90046001600160401b031681565b6040516102349190612490565b600f54610337906001600160a01b031681565b60405161023491906124a4565b61027960105481565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610227565b6103176201518081565b61033761038f3660046124b8565b610a04565b6102736103a23660046124b8565b610a22565b6102506103b536600461244f565b610a70565b610337610c2e565b6103d56103d03660046124b8565b610c52565b60405163ffffffff9091168152602001610234565b6102796103f83660046124b8565b610c5d565b610273610c78565b600f5461025090600160e01b900460ff1681565b610273610c9c565b600e54610337906001600160a01b031681565b6102796104423660046124b8565b610ce1565b61044f610cec565b60405161023497969594939291906124d5565b610273610470366004612423565b610d32565b610337610d83565b61027961048b36600461256d565b610d92565b60405165ffffffffffff42168152602001610234565b610273610db7565b610227610e6c565b6102796104c43660046124b8565b610e7b565b6102506104d7366004612423565b610e9c565b6102736104ea3660046124b8565b610eb4565b610273610f4e565b61027361050536600461244f565b610fc7565b610273610518366004612595565b611095565b61027361052b3660046125f1565b6110ae565b61027961053e366004612662565b6110c6565b6103376110f1565b6102736105593660046124b8565b611100565b61057161056c36600461269b565b6111e5565b60408051825165ffffffffffff1681526020928301516001600160d01b03169281019290925201610234565b6102736105ab3660046124b8565b6111f7565b6060600380546105bf906126d2565b80601f01602080910402602001604051908101604052809291908181526020018280546105eb906126d2565b80156106385780601f1061060d57610100808354040283529160200191610638565b820191906000526020600020905b81548152906001019060200180831161061b57829003601f168201915b5050505050905090565b6000604051638cd22d1960e01b815260040160405180910390fd5b600e546001600160a01b0316331461068857604051633217675b60e21b815260040160405180910390fd5b60105481111561069757600080fd5b80601060008282546106a99190612722565b909155506106c190506106ba610c2e565b838361125d565b816001600160a01b03167f5afeca38b2064c23a692c4cf353015d80ab3ecc417b4f893f372690c11fbd9a6826040516106fc91815260200190565b60405180910390a25050565b600e546000906001600160a01b0316331461073657604051633217675b60e21b815260040160405180910390fd5b61073e6112c1565b61074883836112eb565b90506107546001600d55565b92915050565b600033610768858285611356565b6107738585856113aa565b60019150505b9392505050565b610788611409565b600f54600160e01b900460ff16156107b357604051630e92b53f60e01b815260040160405180910390fd5b600f805460ff60e01b1916600160e01b1790556040517f78a4e7d992eeb14841bd804441e7062105649d0bcc77a4c0dfa33b28f438937e90600090a1565b600e546000906001600160a01b0316331461081f57604051633217675b60e21b815260040160405180910390fd5b6108276112c1565b6001600160a01b038316158061084557506001600160a01b03831630145b156108635760405163d92e233d60e01b815260040160405180910390fd5b600061086d610c2e565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161089d91906124a4565b602060405180830381865afa1580156108ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108de9190612735565b90506108f56001600160a01b03831633308761143d565b600081836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161092491906124a4565b602060405180830381865afa158015610941573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109659190612735565b61096f9190612722565b905061097b8682611476565b600061098687610a04565b6001600160a01b03160361099e5761099e86876114ac565b600193505050506107546001600d55565b60006109b9611527565b905090565b60006109b96115b2565b60006109f46109d6836116dd565b6001600160a01b038516600090815260096020526040902090611722565b6001600160d01b03169392505050565b6001600160a01b039081166000908152600860205260409020541690565b6001600160a01b0381163314610a4b57604051635e81118160e11b815260040160405180910390fd5b33610a5581610a04565b6001600160a01b031614610a6d57610a6d33336114ac565b50565b600e546000906001600160a01b03163314610a9e57604051633217675b60e21b815260040160405180910390fd5b610aa66112c1565b6001600160a01b0383161580610ac457506001600160a01b03831630145b15610ae25760405163d92e233d60e01b815260040160405180910390fd5b6000610aec610c2e565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b1c91906124a4565b602060405180830381865afa158015610b39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d9190612735565b9050610b746001600160a01b03831687308761143d565b600081836001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610ba391906124a4565b602060405180830381865afa158015610bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be49190612735565b610bee9190612722565b9050610bfa8682611476565b6000610c0587610a04565b6001600160a01b031603610c1d57610c1d86876114ac565b600193505050506107796001600d55565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000610754826117d8565b6001600160a01b031660009081526020819052604090205490565b610c80611409565b6040516001623f026d60e01b0319815260040160405180910390fd5b3380610ca66110f1565b6001600160a01b031614610cd8578060405163118cdaa760e01b8152600401610ccf91906124a4565b60405180910390fd5b610a6d816117fa565b600061075482611813565b600060608060008060006060610d00611831565b610d0861185e565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600e546001600160a01b03163314610d5d57604051633217675b60e21b815260040160405180910390fd5b8060106000828254610d6f919061274e565b90915550610d7f9050828261188b565b5050565b600b546001600160a01b031690565b6000610da8610da0836116dd565b600a90611722565b6001600160d01b031692915050565b610dbf611409565b600f546001600160a01b031680610de957604051632810857b60e01b815260040160405180910390fd5b600f54600160a01b90046001600160401b0316421015610e1c5760405163dc25bbd360e01b815260040160405180910390fd5b600e80546001600160a01b038381166001600160a01b031983168117909355600f80546001600160e01b031916905560405191169190829060008051602061285e83398151915290600090a35050565b6060600480546105bf906126d2565b6001600160a01b0381166000908152600960205260408120610da8906118c1565b600033610eaa8185856113aa565b5060019392505050565b610ebc611409565b600f54600160e01b900460ff1615610ee75760405163e4d1dbdb60e01b815260040160405180910390fd5b6001600160a01b038116610f0e5760405163d92e233d60e01b815260040160405180910390fd5b600e80546001600160a01b038381166001600160a01b03198316811790935560405191169190829060008051602061285e83398151915290600090a35050565b610f56611409565b600f546001600160a01b031680610f8057604051632810857b60e01b815260040160405180910390fd5b600f80546001600160e01b03191690556040516001600160a01b038216907fa129fdeaad5381eaad4da2f3131ccb44f798dc53387876fb9ecf6eb3a94c7be890600090a250565b610fcf611409565b610fd7610c2e565b6001600160a01b0316836001600160a01b0316036110085760405163068a860d60e41b815260040160405180910390fd5b6001600160a01b03821661102f5760405163d92e233d60e01b815260040160405180910390fd5b6110436001600160a01b038416838361125d565b816001600160a01b0316836001600160a01b03167f8bbfbb5d7fcacf6fc74005cdede0635561638507f576c95f7f294c22141be2e58360405161108891815260200190565b60405180910390a3505050565b604051635e81118160e11b815260040160405180910390fd5b604051624d381d60e41b815260040160405180910390fd5b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600c546001600160a01b031690565b611108611409565b600f54600160e01b900460ff16611132576040516305a2606f60e11b815260040160405180910390fd5b6001600160a01b0381166111595760405163d92e233d60e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b03831617905560006111836201518042612761565b600f8054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040519091506001600160a01b038316907f1801c99f71f2ce0769882ce1c9c5f45a726be342fc22e404fc331e4186a9c12d906106fc908490612490565b6111ed61239e565b61077983836118fa565b6111ff611409565b600c80546001600160a01b0319166001600160a01b038316908117909155611225610d83565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6040516001600160a01b038381166024830152604482018390526112bc91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611924565b505050565b6002600d54036112e457604051633ee5aeb560e01b815260040160405180910390fd5b6002600d55565b6000306001600160a01b03841603611318578260405163ec442f0560e01b8152600401610ccf91906124a4565b611322338361188b565b61134d7f0000000000000000000000000000000000000000000000000000000000000000848461125d565b50600192915050565b600061136284846110c6565b90506000198110156113a4578181101561139557828183604051637dc7a0d960e11b8152600401610ccf93929190612780565b6113a48484848403600061198c565b50505050565b6001600160a01b0383166113d4576000604051634b637e8f60e11b8152600401610ccf91906124a4565b6001600160a01b0382166113fe57600060405163ec442f0560e01b8152600401610ccf91906124a4565b6112bc838383611a61565b33611412610d83565b6001600160a01b03161461143b573360405163118cdaa760e01b8152600401610ccf91906124a4565b565b6040516001600160a01b0384811660248301528381166044830152606482018390526113a49186918216906323b872dd9060840161128a565b6001600160a01b0382166114a057600060405163ec442f0560e01b8152600401610ccf91906124a4565b610d7f60008383611a61565b60006114b783610a04565b6001600160a01b0384811660008181526008602052604080822080546001600160a01b031916888616908117909155905194955093928516927f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46112bc818361152286611aaa565b611ab5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115a3575060408051601f3d908101601f191682019092526115a0918101906127a1565b60015b6115ad5750601290565b919050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561160b57507f000000000000000000000000000000000000000000000000000000000000000046145b1561163557507f000000000000000000000000000000000000000000000000000000000000000090565b6109b9604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60004265ffffffffffff8116831061171957604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610ccf565b61077983611bfd565b81546000908181600581111561178157600061173d84611c2f565b6117479085612722565b60008881526020902090915081015465ffffffffffff90811690871610156117715780915061177f565b61177c81600161274e565b92505b505b600061178f87878585611d82565b905080156117ca576117b4876117a6600184612722565b600091825260209091200190565b54600160301b90046001600160d01b03166117cd565b60005b979650505050505050565b6001600160a01b03811660009081526009602052604081205461075490611de4565b600c80546001600160a01b0319169055610a6d81611e10565b6001600160a01b038116600090815260076020526040812054610754565b60606109b97f00000000000000000000000000000000000000000000000000000000000000006005611e62565b60606109b97f00000000000000000000000000000000000000000000000000000000000000006006611e62565b6001600160a01b0382166118b5576000604051634b637e8f60e11b8152600401610ccf91906124a4565b610d7f82600083611a61565b805460009080156118f1576118db836117a6600184612722565b54600160301b90046001600160d01b0316610779565b60009392505050565b61190261239e565b6001600160a01b03831660009081526009602052604090206107799083611f0d565b600080602060008451602086016000885af180611947576040513d6000823e3d81fd5b50506000513d9150811561195f57806001141561196c565b6001600160a01b0384163b155b156113a45783604051635274afe760e01b8152600401610ccf91906124a4565b6001600160a01b0384166119b657600060405163e602df0560e01b8152600401610ccf91906124a4565b6001600160a01b0383166119e0576000604051634a1406b160e11b8152600401610ccf91906124a4565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156113a457826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611a5391815260200190565b60405180910390a350505050565b6001600160a01b03831615801590611a8157506001600160a01b03821615155b15611a9f57604051638cd22d1960e01b815260040160405180910390fd5b6112bc838383611f71565b600061075482610c5d565b816001600160a01b0316836001600160a01b031614158015611ad75750600081115b156112bc576001600160a01b03831615611b6d576001600160a01b03831660009081526009602052604081208190611b1a90611fd8611b1586611fe4565b612013565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602061287e8339815191528383604051611b62929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156112bc576001600160a01b03821660009081526009602052604081208190611ba690612045611b1586611fe4565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602061287e8339815191528383604051611bee929190918252602082015260400190565b60405180910390a25050505050565b600065ffffffffffff821115611c2b576030826040516306dfcc6560e41b8152600401610ccf9291906127be565b5090565b600060018211611c3d575090565b816001600160801b8210611c565760809190911c9060401b5b600160401b8210611c6c5760409190911c9060201b5b600160201b8210611c825760209190911c9060101b5b620100008210611c975760109190911c9060081b5b6101008210611cab5760089190911c9060041b5b60108210611cbe5760049190911c9060021b5b60048210611cca5760011b5b600302600190811c90818581611ce257611ce26127d1565b048201901c90506001818581611cfa57611cfa6127d1565b048201901c90506001818581611d1257611d126127d1565b048201901c90506001818581611d2a57611d2a6127d1565b048201901c90506001818581611d4257611d426127d1565b048201901c90506001818581611d5a57611d5a6127d1565b048201901c9050611d79818581611d7357611d736127d1565b04821190565b90039392505050565b60005b81831015611ddc576000611d998484612051565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff161115611dc857809250611dd6565b611dd381600161274e565b93505b50611d85565b509392505050565b600063ffffffff821115611c2b576020826040516306dfcc6560e41b8152600401610ccf9291906127be565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060ff8314611e7c57611e758361206c565b9050610754565b818054611e88906126d2565b80601f0160208091040260200160405190810160405280929190818152602001828054611eb4906126d2565b8015611f015780601f10611ed657610100808354040283529160200191611f01565b820191906000526020600020905b815481529060010190602001808311611ee457829003601f168201915b50505050509050610754565b611f1561239e565b826000018263ffffffff1681548110611f3057611f306127e7565b60009182526020918290206040805180820190915291015465ffffffffffff81168252600160301b90046001600160d01b0316918101919091529392505050565b611f7c8383836120ab565b6001600160a01b038316611fcd576000611f9560025490565b90506001600160d01b0380821115611fca57604051630e58ae9360e11b81526004810183905260248101829052604401610ccf565b50505b6112bc8383836121b5565b600061077982846127fd565b60006001600160d01b03821115611c2b5760d0826040516306dfcc6560e41b8152600401610ccf9291906127be565b60008061203842612030612026886118c1565b868863ffffffff16565b879190612214565b915091505b935093915050565b6000610779828461281c565b6000612060600284841861283b565b6107799084841661274e565b6060600061207983612222565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6001600160a01b0383166120d65780600260008282546120cb919061274e565b909155506121359050565b6001600160a01b038316600090815260208190526040902054818110156121165783818360405163391434e360e21b8152600401610ccf93929190612780565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661215157600280548290039055612170565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161108891815260200190565b6001600160a01b0383166121d7576121d4600a612045611b1584611fe4565b50505b6001600160a01b0382166121f9576121f6600a611fd8611b1584611fe4565b50505b6112bc61220584610a04565b61220e84610a04565b83611ab5565b60008061203885858561224a565b600060ff8216601f81111561075457604051632cd44ac360e21b815260040160405180910390fd5b825460009081908015612343576000612268876117a6600185612722565b805490915065ffffffffffff80821691600160301b90046001600160d01b03169088168211156122ab57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036122e457825465ffffffffffff16600160301b6001600160d01b03891602178355612335565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b945085935061203d92505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b02919093161792019190915590508161203d565b604080518082019091526000808252602082015290565b6000815180845260005b818110156123db576020818501810151868301820152016123bf565b506000602082860101526020601f19601f83011685010191505092915050565b60208152600061077960208301846123b5565b6001600160a01b0381168114610a6d57600080fd5b6000806040838503121561243657600080fd5b82356124418161240e565b946020939093013593505050565b60008060006060848603121561246457600080fd5b833561246f8161240e565b9250602084013561247f8161240e565b929592945050506040919091013590565b6001600160401b0391909116815260200190565b6001600160a01b0391909116815260200190565b6000602082840312156124ca57600080fd5b81356107798161240e565b60ff60f81b8816815260e0602082015260006124f460e08301896123b5565b828103604084015261250681896123b5565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561255c57835183526020938401939092019160010161253e565b50909b9a5050505050505050505050565b60006020828403121561257f57600080fd5b5035919050565b60ff81168114610a6d57600080fd5b60008060008060008060c087890312156125ae57600080fd5b86356125b98161240e565b9550602087013594506040870135935060608701356125d781612586565b9598949750929560808101359460a0909101359350915050565b600080600080600080600060e0888a03121561260c57600080fd5b87356126178161240e565b965060208801356126278161240e565b95506040880135945060608801359350608088013561264581612586565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561267557600080fd5b82356126808161240e565b915060208301356126908161240e565b809150509250929050565b600080604083850312156126ae57600080fd5b82356126b98161240e565b9150602083013563ffffffff8116811461269057600080fd5b600181811c908216806126e657607f821691505b60208210810361270657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156107545761075461270c565b60006020828403121561274757600080fd5b5051919050565b808201808211156107545761075461270c565b6001600160401b0381811683821601908111156107545761075461270c565b6001600160a01b039390931683526020830191909152604082015260600190565b6000602082840312156127b357600080fd5b815161077981612586565b60ff929092168252602082015260400190565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160d01b0382811682821603908111156107545761075461270c565b6001600160d01b0381811683821601908111156107545761075461270c565b60008261285857634e487b7160e01b600052601260045260246000fd5b50049056fe4803049971913703d2dd43c06110dc7fad451e4603e9f485cbeebdda11263ab0dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724a164736f6c634300081c000a", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061021a5760003560e01c806306fdde031461021f578063095ea7b31461023d578063117de2fd1461026057806318160ddd14610275578063205c28781461028757806323b872dd1461029a5780632b596f6d146102ad5780632f4f21e2146102b5578063313ce567146102c85780633644e515146102e25780633a46b1a8146102ea578063406c66e7146102fd57806341da29801461032457806344b279a2146103445780634bf5d7e91461034d5780635146034a14610377578063587cde1e146103815780635c19a95c1461039457806368a9674d146103a75780636f307dc3146103ba5780636fcfff45146103c257806370a08231146103ea578063715018a6146103fd57806379b47f401461040557806379ba5097146104195780637b103999146104215780637ecebe001461043457806384b0196e1461044757806385bc898c146104625780638da5cb5b146104755780638e539e8c1461047d57806391ddadf41461049057806393000487146104a657806395d89b41146104ae5780639ab24eb0146104b6578063a9059cbb146104c9578063a91ee0dc146104dc578063aabf2d60146104ef578063b2118a8d146104f7578063c3cda5201461050a578063d505accf1461051d578063dd62ed3e14610530578063e30c397814610543578063e8ba64711461054b578063f1127ed81461055e578063f2fde38b1461059d575b600080fd5b6102276105b0565b60405161023491906123fb565b60405180910390f35b61025061024b366004612423565b610642565b6040519015158152602001610234565b61027361026e366004612423565b61065d565b005b6002545b604051908152602001610234565b610250610295366004612423565b610708565b6102506102a836600461244f565b61075a565b610273610780565b6102506102c3366004612423565b6107f1565b6102d06109af565b60405160ff9091168152602001610234565b6102796109be565b6102796102f8366004612423565b6109c8565b600f5461031790600160a01b90046001600160401b031681565b6040516102349190612490565b600f54610337906001600160a01b031681565b60405161023491906124a4565b61027960105481565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610227565b6103176201518081565b61033761038f3660046124b8565b610a04565b6102736103a23660046124b8565b610a22565b6102506103b536600461244f565b610a70565b610337610c2e565b6103d56103d03660046124b8565b610c52565b60405163ffffffff9091168152602001610234565b6102796103f83660046124b8565b610c5d565b610273610c78565b600f5461025090600160e01b900460ff1681565b610273610c9c565b600e54610337906001600160a01b031681565b6102796104423660046124b8565b610ce1565b61044f610cec565b60405161023497969594939291906124d5565b610273610470366004612423565b610d32565b610337610d83565b61027961048b36600461256d565b610d92565b60405165ffffffffffff42168152602001610234565b610273610db7565b610227610e6c565b6102796104c43660046124b8565b610e7b565b6102506104d7366004612423565b610e9c565b6102736104ea3660046124b8565b610eb4565b610273610f4e565b61027361050536600461244f565b610fc7565b610273610518366004612595565b611095565b61027361052b3660046125f1565b6110ae565b61027961053e366004612662565b6110c6565b6103376110f1565b6102736105593660046124b8565b611100565b61057161056c36600461269b565b6111e5565b60408051825165ffffffffffff1681526020928301516001600160d01b03169281019290925201610234565b6102736105ab3660046124b8565b6111f7565b6060600380546105bf906126d2565b80601f01602080910402602001604051908101604052809291908181526020018280546105eb906126d2565b80156106385780601f1061060d57610100808354040283529160200191610638565b820191906000526020600020905b81548152906001019060200180831161061b57829003601f168201915b5050505050905090565b6000604051638cd22d1960e01b815260040160405180910390fd5b600e546001600160a01b0316331461068857604051633217675b60e21b815260040160405180910390fd5b60105481111561069757600080fd5b80601060008282546106a99190612722565b909155506106c190506106ba610c2e565b838361125d565b816001600160a01b03167f5afeca38b2064c23a692c4cf353015d80ab3ecc417b4f893f372690c11fbd9a6826040516106fc91815260200190565b60405180910390a25050565b600e546000906001600160a01b0316331461073657604051633217675b60e21b815260040160405180910390fd5b61073e6112c1565b61074883836112eb565b90506107546001600d55565b92915050565b600033610768858285611356565b6107738585856113aa565b60019150505b9392505050565b610788611409565b600f54600160e01b900460ff16156107b357604051630e92b53f60e01b815260040160405180910390fd5b600f805460ff60e01b1916600160e01b1790556040517f78a4e7d992eeb14841bd804441e7062105649d0bcc77a4c0dfa33b28f438937e90600090a1565b600e546000906001600160a01b0316331461081f57604051633217675b60e21b815260040160405180910390fd5b6108276112c1565b6001600160a01b038316158061084557506001600160a01b03831630145b156108635760405163d92e233d60e01b815260040160405180910390fd5b600061086d610c2e565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161089d91906124a4565b602060405180830381865afa1580156108ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108de9190612735565b90506108f56001600160a01b03831633308761143d565b600081836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161092491906124a4565b602060405180830381865afa158015610941573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109659190612735565b61096f9190612722565b905061097b8682611476565b600061098687610a04565b6001600160a01b03160361099e5761099e86876114ac565b600193505050506107546001600d55565b60006109b9611527565b905090565b60006109b96115b2565b60006109f46109d6836116dd565b6001600160a01b038516600090815260096020526040902090611722565b6001600160d01b03169392505050565b6001600160a01b039081166000908152600860205260409020541690565b6001600160a01b0381163314610a4b57604051635e81118160e11b815260040160405180910390fd5b33610a5581610a04565b6001600160a01b031614610a6d57610a6d33336114ac565b50565b600e546000906001600160a01b03163314610a9e57604051633217675b60e21b815260040160405180910390fd5b610aa66112c1565b6001600160a01b0383161580610ac457506001600160a01b03831630145b15610ae25760405163d92e233d60e01b815260040160405180910390fd5b6000610aec610c2e565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b1c91906124a4565b602060405180830381865afa158015610b39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d9190612735565b9050610b746001600160a01b03831687308761143d565b600081836001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610ba391906124a4565b602060405180830381865afa158015610bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be49190612735565b610bee9190612722565b9050610bfa8682611476565b6000610c0587610a04565b6001600160a01b031603610c1d57610c1d86876114ac565b600193505050506107796001600d55565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000610754826117d8565b6001600160a01b031660009081526020819052604090205490565b610c80611409565b6040516001623f026d60e01b0319815260040160405180910390fd5b3380610ca66110f1565b6001600160a01b031614610cd8578060405163118cdaa760e01b8152600401610ccf91906124a4565b60405180910390fd5b610a6d816117fa565b600061075482611813565b600060608060008060006060610d00611831565b610d0861185e565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600e546001600160a01b03163314610d5d57604051633217675b60e21b815260040160405180910390fd5b8060106000828254610d6f919061274e565b90915550610d7f9050828261188b565b5050565b600b546001600160a01b031690565b6000610da8610da0836116dd565b600a90611722565b6001600160d01b031692915050565b610dbf611409565b600f546001600160a01b031680610de957604051632810857b60e01b815260040160405180910390fd5b600f54600160a01b90046001600160401b0316421015610e1c5760405163dc25bbd360e01b815260040160405180910390fd5b600e80546001600160a01b038381166001600160a01b031983168117909355600f80546001600160e01b031916905560405191169190829060008051602061285e83398151915290600090a35050565b6060600480546105bf906126d2565b6001600160a01b0381166000908152600960205260408120610da8906118c1565b600033610eaa8185856113aa565b5060019392505050565b610ebc611409565b600f54600160e01b900460ff1615610ee75760405163e4d1dbdb60e01b815260040160405180910390fd5b6001600160a01b038116610f0e5760405163d92e233d60e01b815260040160405180910390fd5b600e80546001600160a01b038381166001600160a01b03198316811790935560405191169190829060008051602061285e83398151915290600090a35050565b610f56611409565b600f546001600160a01b031680610f8057604051632810857b60e01b815260040160405180910390fd5b600f80546001600160e01b03191690556040516001600160a01b038216907fa129fdeaad5381eaad4da2f3131ccb44f798dc53387876fb9ecf6eb3a94c7be890600090a250565b610fcf611409565b610fd7610c2e565b6001600160a01b0316836001600160a01b0316036110085760405163068a860d60e41b815260040160405180910390fd5b6001600160a01b03821661102f5760405163d92e233d60e01b815260040160405180910390fd5b6110436001600160a01b038416838361125d565b816001600160a01b0316836001600160a01b03167f8bbfbb5d7fcacf6fc74005cdede0635561638507f576c95f7f294c22141be2e58360405161108891815260200190565b60405180910390a3505050565b604051635e81118160e11b815260040160405180910390fd5b604051624d381d60e41b815260040160405180910390fd5b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600c546001600160a01b031690565b611108611409565b600f54600160e01b900460ff16611132576040516305a2606f60e11b815260040160405180910390fd5b6001600160a01b0381166111595760405163d92e233d60e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b03831617905560006111836201518042612761565b600f8054600160a01b600160e01b031916600160a01b6001600160401b038416021790556040519091506001600160a01b038316907f1801c99f71f2ce0769882ce1c9c5f45a726be342fc22e404fc331e4186a9c12d906106fc908490612490565b6111ed61239e565b61077983836118fa565b6111ff611409565b600c80546001600160a01b0319166001600160a01b038316908117909155611225610d83565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6040516001600160a01b038381166024830152604482018390526112bc91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611924565b505050565b6002600d54036112e457604051633ee5aeb560e01b815260040160405180910390fd5b6002600d55565b6000306001600160a01b03841603611318578260405163ec442f0560e01b8152600401610ccf91906124a4565b611322338361188b565b61134d7f0000000000000000000000000000000000000000000000000000000000000000848461125d565b50600192915050565b600061136284846110c6565b90506000198110156113a4578181101561139557828183604051637dc7a0d960e11b8152600401610ccf93929190612780565b6113a48484848403600061198c565b50505050565b6001600160a01b0383166113d4576000604051634b637e8f60e11b8152600401610ccf91906124a4565b6001600160a01b0382166113fe57600060405163ec442f0560e01b8152600401610ccf91906124a4565b6112bc838383611a61565b33611412610d83565b6001600160a01b03161461143b573360405163118cdaa760e01b8152600401610ccf91906124a4565b565b6040516001600160a01b0384811660248301528381166044830152606482018390526113a49186918216906323b872dd9060840161128a565b6001600160a01b0382166114a057600060405163ec442f0560e01b8152600401610ccf91906124a4565b610d7f60008383611a61565b60006114b783610a04565b6001600160a01b0384811660008181526008602052604080822080546001600160a01b031916888616908117909155905194955093928516927f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46112bc818361152286611aaa565b611ab5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115a3575060408051601f3d908101601f191682019092526115a0918101906127a1565b60015b6115ad5750601290565b919050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561160b57507f000000000000000000000000000000000000000000000000000000000000000046145b1561163557507f000000000000000000000000000000000000000000000000000000000000000090565b6109b9604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60004265ffffffffffff8116831061171957604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610ccf565b61077983611bfd565b81546000908181600581111561178157600061173d84611c2f565b6117479085612722565b60008881526020902090915081015465ffffffffffff90811690871610156117715780915061177f565b61177c81600161274e565b92505b505b600061178f87878585611d82565b905080156117ca576117b4876117a6600184612722565b600091825260209091200190565b54600160301b90046001600160d01b03166117cd565b60005b979650505050505050565b6001600160a01b03811660009081526009602052604081205461075490611de4565b600c80546001600160a01b0319169055610a6d81611e10565b6001600160a01b038116600090815260076020526040812054610754565b60606109b97f00000000000000000000000000000000000000000000000000000000000000006005611e62565b60606109b97f00000000000000000000000000000000000000000000000000000000000000006006611e62565b6001600160a01b0382166118b5576000604051634b637e8f60e11b8152600401610ccf91906124a4565b610d7f82600083611a61565b805460009080156118f1576118db836117a6600184612722565b54600160301b90046001600160d01b0316610779565b60009392505050565b61190261239e565b6001600160a01b03831660009081526009602052604090206107799083611f0d565b600080602060008451602086016000885af180611947576040513d6000823e3d81fd5b50506000513d9150811561195f57806001141561196c565b6001600160a01b0384163b155b156113a45783604051635274afe760e01b8152600401610ccf91906124a4565b6001600160a01b0384166119b657600060405163e602df0560e01b8152600401610ccf91906124a4565b6001600160a01b0383166119e0576000604051634a1406b160e11b8152600401610ccf91906124a4565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156113a457826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611a5391815260200190565b60405180910390a350505050565b6001600160a01b03831615801590611a8157506001600160a01b03821615155b15611a9f57604051638cd22d1960e01b815260040160405180910390fd5b6112bc838383611f71565b600061075482610c5d565b816001600160a01b0316836001600160a01b031614158015611ad75750600081115b156112bc576001600160a01b03831615611b6d576001600160a01b03831660009081526009602052604081208190611b1a90611fd8611b1586611fe4565b612013565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602061287e8339815191528383604051611b62929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156112bc576001600160a01b03821660009081526009602052604081208190611ba690612045611b1586611fe4565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602061287e8339815191528383604051611bee929190918252602082015260400190565b60405180910390a25050505050565b600065ffffffffffff821115611c2b576030826040516306dfcc6560e41b8152600401610ccf9291906127be565b5090565b600060018211611c3d575090565b816001600160801b8210611c565760809190911c9060401b5b600160401b8210611c6c5760409190911c9060201b5b600160201b8210611c825760209190911c9060101b5b620100008210611c975760109190911c9060081b5b6101008210611cab5760089190911c9060041b5b60108210611cbe5760049190911c9060021b5b60048210611cca5760011b5b600302600190811c90818581611ce257611ce26127d1565b048201901c90506001818581611cfa57611cfa6127d1565b048201901c90506001818581611d1257611d126127d1565b048201901c90506001818581611d2a57611d2a6127d1565b048201901c90506001818581611d4257611d426127d1565b048201901c90506001818581611d5a57611d5a6127d1565b048201901c9050611d79818581611d7357611d736127d1565b04821190565b90039392505050565b60005b81831015611ddc576000611d998484612051565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff161115611dc857809250611dd6565b611dd381600161274e565b93505b50611d85565b509392505050565b600063ffffffff821115611c2b576020826040516306dfcc6560e41b8152600401610ccf9291906127be565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060ff8314611e7c57611e758361206c565b9050610754565b818054611e88906126d2565b80601f0160208091040260200160405190810160405280929190818152602001828054611eb4906126d2565b8015611f015780601f10611ed657610100808354040283529160200191611f01565b820191906000526020600020905b815481529060010190602001808311611ee457829003601f168201915b50505050509050610754565b611f1561239e565b826000018263ffffffff1681548110611f3057611f306127e7565b60009182526020918290206040805180820190915291015465ffffffffffff81168252600160301b90046001600160d01b0316918101919091529392505050565b611f7c8383836120ab565b6001600160a01b038316611fcd576000611f9560025490565b90506001600160d01b0380821115611fca57604051630e58ae9360e11b81526004810183905260248101829052604401610ccf565b50505b6112bc8383836121b5565b600061077982846127fd565b60006001600160d01b03821115611c2b5760d0826040516306dfcc6560e41b8152600401610ccf9291906127be565b60008061203842612030612026886118c1565b868863ffffffff16565b879190612214565b915091505b935093915050565b6000610779828461281c565b6000612060600284841861283b565b6107799084841661274e565b6060600061207983612222565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6001600160a01b0383166120d65780600260008282546120cb919061274e565b909155506121359050565b6001600160a01b038316600090815260208190526040902054818110156121165783818360405163391434e360e21b8152600401610ccf93929190612780565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661215157600280548290039055612170565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161108891815260200190565b6001600160a01b0383166121d7576121d4600a612045611b1584611fe4565b50505b6001600160a01b0382166121f9576121f6600a611fd8611b1584611fe4565b50505b6112bc61220584610a04565b61220e84610a04565b83611ab5565b60008061203885858561224a565b600060ff8216601f81111561075457604051632cd44ac360e21b815260040160405180910390fd5b825460009081908015612343576000612268876117a6600185612722565b805490915065ffffffffffff80821691600160301b90046001600160d01b03169088168211156122ab57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036122e457825465ffffffffffff16600160301b6001600160d01b03891602178355612335565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b945085935061203d92505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b02919093161792019190915590508161203d565b604080518082019091526000808252602082015290565b6000815180845260005b818110156123db576020818501810151868301820152016123bf565b506000602082860101526020601f19601f83011685010191505092915050565b60208152600061077960208301846123b5565b6001600160a01b0381168114610a6d57600080fd5b6000806040838503121561243657600080fd5b82356124418161240e565b946020939093013593505050565b60008060006060848603121561246457600080fd5b833561246f8161240e565b9250602084013561247f8161240e565b929592945050506040919091013590565b6001600160401b0391909116815260200190565b6001600160a01b0391909116815260200190565b6000602082840312156124ca57600080fd5b81356107798161240e565b60ff60f81b8816815260e0602082015260006124f460e08301896123b5565b828103604084015261250681896123b5565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b8181101561255c57835183526020938401939092019160010161253e565b50909b9a5050505050505050505050565b60006020828403121561257f57600080fd5b5035919050565b60ff81168114610a6d57600080fd5b60008060008060008060c087890312156125ae57600080fd5b86356125b98161240e565b9550602087013594506040870135935060608701356125d781612586565b9598949750929560808101359460a0909101359350915050565b600080600080600080600060e0888a03121561260c57600080fd5b87356126178161240e565b965060208801356126278161240e565b95506040880135945060608801359350608088013561264581612586565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561267557600080fd5b82356126808161240e565b915060208301356126908161240e565b809150509250929050565b600080604083850312156126ae57600080fd5b82356126b98161240e565b9150602083013563ffffffff8116811461269057600080fd5b600181811c908216806126e657607f821691505b60208210810361270657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156107545761075461270c565b60006020828403121561274757600080fd5b5051919050565b808201808211156107545761075461270c565b6001600160401b0381811683821601908111156107545761075461270c565b6001600160a01b039390931683526020830191909152604082015260600190565b6000602082840312156127b357600080fd5b815161077981612586565b60ff929092168252602082015260400190565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160d01b0382811682821603908111156107545761075461270c565b6001600160d01b0381811683821601908111156107545761075461270c565b60008261285857634e487b7160e01b600052601260045260246000fd5b50049056fe4803049971913703d2dd43c06110dc7fad451e4603e9f485cbeebdda11263ab0dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724a164736f6c634300081c000a", "linkReferences": {}, "deployedLinkReferences": {}, "immutableReferences": { - "4593": [ + "4010": [ { "length": 32, "start": 3120 @@ -1442,43 +1442,43 @@ "start": 5419 } ], - "7931": [ + "7066": [ { "length": 32, "start": 5651 } ], - "7933": [ + "7068": [ { "length": 32, "start": 5609 } ], - "7935": [ + "7070": [ { "length": 32, "start": 5567 } ], - "7937": [ + "7072": [ { "length": 32, "start": 5732 } ], - "7939": [ + "7074": [ { "length": 32, "start": 5772 } ], - "7942": [ + "7077": [ { "length": 32, "start": 6200 } ], - "7945": [ + "7080": [ { "length": 32, "start": 6245 @@ -1486,5 +1486,5 @@ ] }, "inputSourceName": "project/contracts/token/InterfoldTicketToken.sol", - "buildInfoId": "solc-0_8_28-131befb7b6efbc9af996a8f87e4762d0d84ba904" + "buildInfoId": "solc-0_8_28-9672985902d4f3c60307b637e6940bacad029c39" } \ No newline at end of file diff --git a/packages/interfold-contracts/test/Interfold.spec.ts b/packages/interfold-contracts/test/Interfold.spec.ts index ba12923bf..300ea6679 100644 --- a/packages/interfold-contracts/test/Interfold.spec.ts +++ b/packages/interfold-contracts/test/Interfold.spec.ts @@ -360,12 +360,9 @@ describe("Interfold", function () { .withArgs(e3Program); }); it("registers E3 Program correctly", async function () { - const { - interfold, - mocks: { e3Program }, - } = await loadFixture(setup); - const enabled = await interfold.e3Programs(e3Program); - expect(enabled).to.be.true; + const { interfold } = await loadFixture(setup); + await interfold.registerE3Program(AddressTwo); + expect(await interfold.e3Programs(AddressTwo)).to.be.true; }); it("emits E3ProgramRegistered event", async function () { const { interfold } = await loadFixture(setup); diff --git a/packages/interfold-sdk/src/events/types.ts b/packages/interfold-sdk/src/events/types.ts index d72aaf1e8..b2d70d5fe 100644 --- a/packages/interfold-sdk/src/events/types.ts +++ b/packages/interfold-sdk/src/events/types.ts @@ -106,8 +106,7 @@ export interface InterfoldEventData { [InterfoldEventType.E3_REQUESTED]: E3RequestedData [InterfoldEventType.CIPHERTEXT_OUTPUT_PUBLISHED]: CiphertextOutputPublishedData [InterfoldEventType.PLAINTEXT_OUTPUT_PUBLISHED]: PlaintextOutputPublishedData - [InterfoldEventType.E3_PROGRAM_ENABLED]: { e3Program: string } - [InterfoldEventType.E3_PROGRAM_DISABLED]: { e3Program: string } + [InterfoldEventType.E3_PROGRAM_REGISTERED]: { e3Program: string } [InterfoldEventType.ENCRYPTION_SCHEME_ENABLED]: { encryptionSchemeId: string } [InterfoldEventType.ENCRYPTION_SCHEME_DISABLED]: { encryptionSchemeId: string } [InterfoldEventType.CIPHERNODE_REGISTRY_SET]: { ciphernodeRegistry: string }