Skip to main content

Protocol Tester

The Protocol Tester is a sandbox tool that lets you call any DeFi protocol contract directly from your browser — no off-chain scripts required. Use it to validate your contract's integration with VaultRegistrar and DS Token before writing production code.

When to use it

  • You've deployed a protocol contract and want to verify it works with the VaultRegistrar end-to-end.
  • You want to test a specific method interactively with real wallet signing.
  • You're debugging a failed transaction and want to isolate which step breaks.

How it works

Navigate to /protocol-tester in the sandbox.

1. Upload your ABI

Paste or upload a JSON ABI. The tester filters to nonpayable and payable functions — view functions are excluded since they don't require a wallet.

2. Select a method

Pick a function from the dropdown. Parameter fields are generated automatically from the ABI input types.

3. Fill in parameters

  • Amount fields (any parameter whose name includes "amount") are entered as human-readable numbers (e.g., 10 for 10 DS Tokens). The tester converts them to the correct 6-decimal representation automatically.
  • uint256 fields are entered as plain numbers.
  • bytes fields accept a hex string (the EIP-712 signature goes here for deposit-style methods).
  • address fields are entered as checksummed hex addresses.

4. Sign the EIP-712 permission (optional)

If your method requires an investor EIP-712 signature (e.g., a deposit function that calls registerVault internally), click Sign EIP-712. The tester will:

  1. Read the current operatorNonce for your wallet and the target contract.
  2. Sign a RegisterVault typed-data message with a 10-minute deadline.
  3. Auto-fill the signature and deadline parameters.

The operator in the signature is set to the contract address you entered, so the EIP-712 message is bound to that specific contract.

5. Approve DS Token (if needed)

If the method moves DS Tokens from your wallet, click Approve first. The tester submits an ERC-20 approve(contractAddress, amount) transaction and waits for confirmation before enabling the execute button.

6. Execute

Click Execute. The tester calls the selected method with your filled parameters, waits for transaction confirmation, and shows the tx hash.

Example: testing a custom deposit function

Say you've deployed a protocol contract at 0xAbCd... that has a deposit(uint256 amount, uint256 deadline, bytes signature) function and calls VaultRegistrar.registerVault() internally.

  1. Upload the contract's ABI.
  2. Select deposit.
  3. Enter 10 in the amount field.
  4. Click Sign EIP-712 — this fills deadline and signature automatically.
  5. Click Approve to approve 10 DS Tokens to the contract.
  6. Click Execute — the contract is called and the vault is registered on-chain.

Limitations

  • The tester calls methods with your connected wallet as both the investor and the transaction sender. In production, the investor signs off-chain and the operator submits the transaction — the roles are split.
  • It does not simulate multi-wallet flows (e.g., operator submits a signature collected from a different wallet).
  • Only Ethereum Sepolia is supported in the current sandbox.

See also

  • Mock Protocol Example — a pre-wired version of this flow using the reference MockDeFiProtocol contract
  • Mock Protocol Reference — the Solidity source and integration notes for the reference implementation
  • Deposit Flow — the equivalent TypeScript for driving the same flow from your own scripts