Skip to content

Commit e7ee86b

Browse files
committed
refactor(frontend): handle changes in backend
#65
1 parent 58269f6 commit e7ee86b

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

backend/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ npx hardhat ignition deploy ./ignition/modules/QueueHandler.ts --network hardhat
2727
```
2828

2929
Ethereum Sepolia (Chain ID `11155111`)
30-
31-
```shell
32-
rm -rf ./ignition/deployments/chain-11155111/artifacts/
33-
```
34-
3530
```shell
3631
npx hardhat ignition deploy ./ignition/modules/SponsorshipQueue.ts --network sepolia --reset --verify
3732
npx hardhat ignition deploy ./ignition/modules/DistributionQueue.ts --network sepolia --verify
@@ -41,11 +36,6 @@ npx hardhat ignition deploy ./ignition/modules/QueueHandler.ts --network sepolia
4136
[`./ignition/deployments/chain-11155111/deployed_addresses.json`](./ignition/deployments/chain-11155111/deployed_addresses.json)
4237

4338
Ethereum Mainnet (Chain ID `1`)
44-
45-
```shell
46-
rm -rf ./ignition/deployments/chain-1/artifacts/
47-
```
48-
4939
```shell
5040
npx hardhat ignition deploy ./ignition/modules/SponsorshipQueue.ts --network mainnet --reset --verify
5141
npx hardhat ignition deploy ./ignition/modules/DistributionQueue.ts --network mainnet --verify

frontend/src/components/Distributions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function Distributions() {
1515
const { isLoading, isError, error, data } = useReadContract({
1616
abi,
1717
address: deploymentAddress,
18-
functionName: "getQueueCount"
18+
functionName: "getLength"
1919
});
2020
console.debug("isLoading:", isLoading);
2121
console.debug("isError:", isError);

frontend/src/components/Sponsorships.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function Sponsorships() {
1515
const { isLoading, isError, error, data } = useReadContract({
1616
abi,
1717
address: deploymentAddress,
18-
functionName: "getQueueCount"
18+
functionName: "getLength"
1919
});
2020
console.debug("isLoading:", isLoading);
2121
console.debug("isError:", isError);

frontend/src/pages/sponsorships/add.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ export function ReadEstimatedCost() {
6363

6464
return (
6565
<>
66-
<SimulateContractButton estimatedCost={0.0001} />
66+
<SimulateContractButton />
6767
</>
6868
)
6969
}
7070

71-
export function SimulateContractButton({ estimatedCost }: any) {
71+
export function SimulateContractButton() {
7272
console.debug("SimulateContractButton");
7373

7474
const deploymentAddress: Address = deployed_addresses["SponsorshipQueueModule#SponsorshipQueue"] as `0x${string}`;
@@ -77,8 +77,7 @@ export function SimulateContractButton({ estimatedCost }: any) {
7777
const { isPending, isError, error, isSuccess } = useSimulateContract({
7878
abi,
7979
address: deploymentAddress,
80-
functionName: "addSponsorship",
81-
value: parseEther(estimatedCost)
80+
functionName: "addSponsorship"
8281
})
8382
console.debug("isPending:", isPending);
8483
console.debug("isError:", isError);
@@ -98,7 +97,7 @@ export function SimulateContractButton({ estimatedCost }: any) {
9897
return <WriteContractButton />
9998
}
10099

101-
export function WriteContractButton({ estimatedCost }: any) {
100+
export function WriteContractButton() {
102101
console.debug("WriteContractButton");
103102

104103
const deploymentAddress: Address = deployed_addresses["SponsorshipQueueModule#SponsorshipQueue"] as `0x${string}`;
@@ -112,12 +111,11 @@ export function WriteContractButton({ estimatedCost }: any) {
112111
writeContract({
113112
abi,
114113
address: deploymentAddress,
115-
functionName: "addSponsorship",
116-
value: parseEther(estimatedCost)
114+
functionName: "addSponsorship"
117115
})
118116
}
119117
>
120-
Send {estimatedCost} ETH ⟠
118+
Send 0.0001 ETH ⟠
121119
</button>
122120
)
123121
}

0 commit comments

Comments
 (0)