Skip to content

Commit

Permalink
fix: integrate deposit fee and audit fixes (#3232)
Browse files Browse the repository at this point in the history
* integrate deposit fee and audit fixes

* unit test fix

* latest gateway changes

* latest gateway

* latest gateway
  • Loading branch information
skosito committed Dec 3, 2024
1 parent e2c34d3 commit 93f02bd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
Binary file modified contrib/localnet/solana/gateway.so
Binary file not shown.
3 changes: 2 additions & 1 deletion e2e/runner/solana.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ func (r *E2ERunner) CreateDepositSPLInstruction(
DataBytes: depositSPLData,
AccountValues: []*solana.AccountMeta{
solana.Meta(signer).WRITE().SIGNER(),
solana.Meta(r.ComputePdaAddress()),
solana.Meta(r.ComputePdaAddress()).WRITE(),
solana.Meta(whitelistEntry),
solana.Meta(mint),
solana.Meta(solana.TokenProgramID),
solana.Meta(from).WRITE(),
solana.Meta(to).WRITE(),
solana.Meta(solana.SystemProgramID),
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/contracts/solana/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const (
accountsNumDeposit = 3

// AccountsNumberOfDeposit is the number of accounts required for Solana gateway deposit spl instruction
// [signer, pda, whitelist_entry, mint_account, token_program, from, to]
accountsNumberDepositSPL = 7
// [signer, pda, whitelist_entry, mint_account, token_program, from, to, system_program]
accountsNumberDepositSPL = 8
)

var (
Expand Down
15 changes: 15 additions & 0 deletions pkg/contracts/solana/gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
},
{
"name": "pda",
"writable": true,
"pda": {
"seeds": [
{
Expand Down Expand Up @@ -196,6 +197,10 @@
{
"name": "to",
"writable": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
}
],
"args": [
Expand Down Expand Up @@ -234,6 +239,7 @@
},
{
"name": "pda",
"writable": true,
"pda": {
"seeds": [
{
Expand Down Expand Up @@ -287,6 +293,10 @@
{
"name": "to",
"writable": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
}
],
"args": [
Expand Down Expand Up @@ -1033,6 +1043,11 @@
"code": 6009,
"name": "SPLAtaAndMintAddressMismatch",
"msg": "SPLAtaAndMintAddressMismatch"
},
{
"code": 6010,
"name": "EmptyReceiver",
"msg": "EmptyReceiver"
}
],
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"8vquQi8xNxxBTsohf1u8xQHYbo7Fv8BEWCJz63RJSaeE",
"4GddKQ7baJpMyKna7bPPnhh7UQtpzfSGL1FgZ31hj4mp",
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"11111111111111111111111111111111",
"94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d"
],
"header": {
Expand All @@ -24,15 +25,16 @@
"recentBlockhash": "5ZB2NWKwp86t47ojCHPjRyd5vMKSWBdhxqDdtSZVPUj",
"instructions": [
{
"programIdIndex": 7,
"programIdIndex": 8,
"accounts": [
0,
3,
4,
5,
6,
1,
2
2,
7
],
"data": "5JndgWCNHDyr2qQccK9VM1NxJFrVbUDvG2hfAxRC5z6nPPAVPsj7q3A"
}
Expand Down

0 comments on commit 93f02bd

Please sign in to comment.