Skip to content

Commit

Permalink
feat: bank precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
fbac committed Sep 10, 2024
1 parent d335f2d commit 1622b2b
Show file tree
Hide file tree
Showing 10 changed files with 677 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ func New(
precompiles.StatefulContracts(
&app.FungibleKeeper,
app.StakingKeeper,
app.BankKeeper,
appCodec,
storetypes.TransientGasConfig(),
),
Expand Down
74 changes: 74 additions & 0 deletions precompiles/bank/IBank.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[
{
"inputs": [
{
"internalType": "string",
"name": "zrc20",
"type": "string"
},
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "zrc20",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "deposit",
"outputs": [
{
"internalType": "bool",
"name": "success",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "zrc20",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [
{
"internalType": "bool",
"name": "success",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
254 changes: 254 additions & 0 deletions precompiles/bank/IBank.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1622b2b

Please sign in to comment.