Skip to content
This repository was archived by the owner on Feb 8, 2025. It is now read-only.

Commit 3fbabbc

Browse files
authored
Merge pull request #289 from zallo-labs/Z-343-upgrade-approver
Z 343 upgrade approver
2 parents 7a88540 + 1a773a1 commit 3fbabbc

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

api/src/core/database/database.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class DatabaseService implements OnModuleInit {
2626
.withConfig({
2727
allow_user_specified_id: true /* Required for account insertion */,
2828
})
29-
.withRetryOptions({ attempts: 7 });
29+
.withRetryOptions({ attempts: 10 });
3030
this.DANGEROUS_superuserClient = this.__client.withConfig({ apply_access_policies: false });
3131
}
3232

app/src/app/(nav)/[account]/(home)/send.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ function SendScreen() {
103103
.with('transfer', () => (
104104
<TransferMode account={account} token={token} to={to} amount={amount} />
105105
))
106-
.with('transferFrom', () => (
107-
<TransferFromMode account={account} token={token} to={to} amount={amount} />
108-
))
109106
.exhaustive()}
110107
</Scrollable>
111108
</Pane>

app/src/components/send/SendModeChips.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Scrollable } from '#/Scrollable';
33
import { CheckAllIcon, ContactsOutlineIcon, DataIcon, OutboundIcon } from '@theme/icons';
44
import { createStyles, useStyles } from '@theme/styles';
55

6-
export type SendMode = 'transfer' | 'transferFrom'; // | 'approve' | 'data';
6+
export type SendMode = 'transfer'; // | 'transferFrom' | 'approve' | 'data';
77

88
export interface SendModeChipsProps {
99
mode: SendMode;

app/src/components/send/TransferMode.tsx

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { asAddress, asFp, UAddress } from 'lib';
1+
import { asAddress, asFp, isEthToken, UAddress } from 'lib';
22
import { Actions } from '#/layout/Actions';
33
import { Button } from '#/Button';
44
import { graphql } from 'relay-runtime';
@@ -11,7 +11,6 @@ import Decimal from 'decimal.js';
1111
import { CheckAllIcon } from '@theme/icons';
1212
import { useRouter } from 'expo-router';
1313
import { ampli } from '~/lib/ampli';
14-
import { useMemo } from 'react';
1514
import { usePreparedTransaction } from '~/hooks/mutations/usePreparedTransaction';
1615

1716
const Account = graphql`
@@ -40,15 +39,21 @@ export function TransferMode({ to, amount, ...props }: TransferModeProps) {
4039
const token = useFragment(Token, props.token);
4140
const router = useRouter();
4241

42+
const amountFp = asFp(amount, token.decimals, Decimal.ROUND_DOWN);
4343
const operations = to && [
44-
{
45-
to: asAddress(token.address),
46-
data: encodeFunctionData({
47-
abi: ERC20,
48-
functionName: 'transfer',
49-
args: [asAddress(to), asFp(amount, token.decimals, Decimal.ROUND_DOWN)],
50-
}),
51-
},
44+
isEthToken(asAddress(token.address))
45+
? {
46+
to: asAddress(to),
47+
value: amountFp,
48+
}
49+
: {
50+
to: asAddress(token.address),
51+
data: encodeFunctionData({
52+
abi: ERC20,
53+
functionName: 'transfer',
54+
args: [asAddress(to), amountFp],
55+
}),
56+
},
5257
];
5358
const propose = usePreparedTransaction({
5459
account,

packages/lib/src/contract.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export const PAYMASTER = {
3535
};
3636

3737
export const UPGRADE_APPROVER = addresses({
38-
zksync: '0x006629B301Ce7EF02ff2622e99752B2b2695B167',
39-
'zksync-sepolia': '0x70fa585aFdbe80Ad4619bcCec17B86d31f017a23',
38+
zksync: '0x34c1ADDf5BbF24a76b3968Ec9B6f9FEd75159AAf',
39+
'zksync-sepolia': '0x64Ce53387A29fa667e3E99f576e7718CdfAB6DBa',
4040
});
4141

4242
function addresses(

0 commit comments

Comments
 (0)