Skip to content

feat(Escrow): add custom buyer to universal contract #121

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
### Devnet
#### Arbitrum Sepolia

- [EscrowCustomBuyer](https://sepolia.arbiscan.io/address/0xA01e6B988aeDae1fD4a748D6bfBcB8A438601DeE)
- [EscrowUniversal](https://sepolia.arbiscan.io/address/0x5ef185810BCe41c03c9E5ca271B8C91F1024F953)
- [EscrowView](https://sepolia.arbiscan.io/address/0x6451046caB9291a919FCba045bf6Bb8E0Bb71467)
- [EscrowViewCustomBuyer](https://sepolia.arbiscan.io/address/0xe0892815E8958f0ad6Dab876995987c4F439954D)
- [EscrowUniversal](https://sepolia.arbiscan.io/address/0xEc3984f38C3535aB272C94Eecf76CA67820a55a7)
- [EscrowView](https://sepolia.arbiscan.io/address/0xBbdec240fd37c2C8e440c733CE2277FCC9949F52)

## Getting Started

Expand Down Expand Up @@ -94,7 +92,6 @@ yarn hardhat node --tags nothing

```bash
yarn deploy --network localhost --tags EscrowUniversal
yarn deploy --network localhost --tags EscrowCustomBuyer
```

#### 2. Deploy to a Public Network Fork
Expand All @@ -119,7 +116,6 @@ yarn deploy-testnet-fork

```bash
yarn deploy --network arbitrumSepolia --tags EscrowUniversal
yarn deploy --network arbitrumSepolia --tags EscrowCustomBuyer
```

The deployed addresses should be displayed to the screen after the deployment is complete. If you missed them, you can always go to the `deployments/<network>` directory and look for the respective file.
Expand Down
2 changes: 0 additions & 2 deletions contracts/README.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ yarn hardhat node --tags nothing

```bash
yarn deploy --network localhost --tags EscrowUniversal
yarn deploy --network localhost --tags EscrowCustomBuyer
```

#### 2. Deploy to a Public Network Fork
Expand All @@ -103,7 +102,6 @@ yarn deploy-testnet-fork

```bash
yarn deploy --network arbitrumSepolia --tags EscrowUniversal
yarn deploy --network arbitrumSepolia --tags EscrowCustomBuyer
```

The deployed addresses should be displayed to the screen after the deployment is complete. If you missed them, you can always go to the `deployments/<network>` directory and look for the respective file.
Expand Down
15 changes: 0 additions & 15 deletions contracts/deploy/00-escrow-custom-buyer.ts

This file was deleted.

6 changes: 0 additions & 6 deletions contracts/deploy/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export type EscrowDeployment = {

export type EscrowDeployments = {
universal: EscrowDeployment;
customBuyer?: EscrowDeployment;
};

export const config = {
Expand All @@ -24,10 +23,6 @@ export const config = {
escrow: "EscrowUniversal",
view: "EscrowView",
},
customBuyer: {
escrow: "EscrowCustomBuyer",
view: "EscrowViewCustomBuyer",
},
} satisfies EscrowDeployments,
},
arbitrum: {
Expand All @@ -40,7 +35,6 @@ export const config = {
escrow: "EscrowUniversal",
view: "EscrowView",
},
customBuyer: undefined,
} satisfies EscrowDeployments,
},
};
Expand Down
6 changes: 2 additions & 4 deletions contracts/deploy/utils/getContracts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeploymentName, getContractsEthers as _getArbitratorContracts } from "@kleros/kleros-v2-contracts";
import { EscrowView, EscrowUniversal, EscrowCustomBuyer } from "../../typechain-types";
import { EscrowView, EscrowUniversal } from "../../typechain-types";

const NETWORK_TO_DEPLOYMENT: Record<string, DeploymentName> = {
arbitrumSepoliaDevnet: "devnet",
Expand All @@ -24,7 +24,5 @@ export const getContracts = async (hre: HardhatRuntimeEnvironment) => {
const { klerosCore, disputeTemplateRegistry } = await getArbitratorContracts(hre);
const escrow = await ethers.getContract<EscrowUniversal>("EscrowUniversal");
const view = await ethers.getContract<EscrowView>("EscrowView");
const escrowCustomBuyer = await ethers.getContract<EscrowCustomBuyer>("EscrowCustomBuyer");
const customBuyerView = await ethers.getContract<EscrowView>("EscrowViewCustomBuyer");
return { escrow, view, escrowCustomBuyer, customBuyerView, disputeTemplateRegistry, klerosCore };
return { escrow, view, disputeTemplateRegistry, klerosCore };
};
280 changes: 280 additions & 0 deletions contracts/deployments/arbitrum/PNK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
{
"address": "0x330bD769382cFc6d50175903434CCC8D206DCAE5",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
Loading