Skip to content

Commit

Permalink
feat: add swingby contract (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryenguyen7411 authored Aug 12, 2022
1 parent 6a4ae9d commit 3649cb4
Show file tree
Hide file tree
Showing 2 changed files with 272 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/modules/contracts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import WBTC_ABI from './wbtc-abi.json';
import SBBTC_ABI from './sbbtc-abi.json';
import BTC_ERC_ABI from './btc_erc-abi.json';
import BTC_SKYPOOL_ABI from './btc_skypool-abi.json';
import SWINGBY_SWAP_REWARDS_ABI from './swingby-swap-rewards-abi.json';

const WBTC = {
test: {
Expand Down Expand Up @@ -73,4 +74,16 @@ export const CONTRACTS = {
},
},
},
swap: {
swingby: {
test: {
address: '', // TODO: need change
abi: SWINGBY_SWAP_REWARDS_ABI as AbiItem[],
},
production: {
address: '0x2a3040d8b2a4ea8d3c36c04ae2affb9c5a8e856d',
abi: SWINGBY_SWAP_REWARDS_ABI as AbiItem[],
},
},
},
} as const;
259 changes: 259 additions & 0 deletions src/modules/contracts/swingby-swap-rewards-abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
},
{
"internalType": "address",
"name": "_swingby",
"type": "address"
},
{
"internalType": "uint256",
"name": "_pricePerBTC",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "rebate",
"type": "uint256"
}
],
"name": "Paid",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pricePerBTC",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_dest",
"type": "address"
},
{
"internalType": "address",
"name": "_receiver",
"type": "address"
},
{
"internalType": "uint256",
"name": "_swapped",
"type": "uint256"
}
],
"name": "pullRewards",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_dest",
"type": "address"
},
{
"internalType": "address[]",
"name": "_receiver",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "_swapped",
"type": "uint256[]"
}
],
"name": "pullRewardsMulti",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "rebateRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "rewardToken",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_pricePerBTC",
"type": "uint256"
}
],
"name": "setSWINGBYPrice",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_swap",
"type": "address"
},
{
"internalType": "uint256",
"name": "_newRebateRate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_thresholdRatio",
"type": "uint256"
}
],
"name": "setSwap",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "swapContract",
"outputs": [
{
"internalType": "contract ISwapContract",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "thresholdRatio",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

0 comments on commit 3649cb4

Please sign in to comment.