-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #343 from VenusProtocol/feat/VEN-2719
[VEN-2719]: Venus Stars Program Renewal
- Loading branch information
Showing
6 changed files
with
969 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,231 @@ | ||
[ | ||
{ "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, | ||
{ "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, | ||
{ "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } | ||
], | ||
"name": "Approval", | ||
"type": "event" | ||
}, | ||
{ | ||
"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": true, "internalType": "address", "name": "from", "type": "address" }, | ||
{ "indexed": true, "internalType": "address", "name": "to", "type": "address" }, | ||
{ "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } | ||
], | ||
"name": "Transfer", | ||
"type": "event" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "_decimals", | ||
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "_name", | ||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "_symbol", | ||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [ | ||
{ "internalType": "address", "name": "owner", "type": "address" }, | ||
{ "internalType": "address", "name": "spender", "type": "address" } | ||
], | ||
"name": "allowance", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ "internalType": "address", "name": "spender", "type": "address" }, | ||
{ "internalType": "uint256", "name": "amount", "type": "uint256" } | ||
], | ||
"name": "approve", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }], | ||
"name": "balanceOf", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], | ||
"name": "burn", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "decimals", | ||
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ "internalType": "address", "name": "spender", "type": "address" }, | ||
{ "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } | ||
], | ||
"name": "decreaseAllowance", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "getOwner", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ "internalType": "address", "name": "spender", "type": "address" }, | ||
{ "internalType": "uint256", "name": "addedValue", "type": "uint256" } | ||
], | ||
"name": "increaseAllowance", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], | ||
"name": "mint", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "name", | ||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "owner", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [], | ||
"name": "renounceOwnership", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "symbol", | ||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "totalSupply", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ "internalType": "address", "name": "recipient", "type": "address" }, | ||
{ "internalType": "uint256", "name": "amount", "type": "uint256" } | ||
], | ||
"name": "transfer", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ "internalType": "address", "name": "sender", "type": "address" }, | ||
{ "internalType": "address", "name": "recipient", "type": "address" }, | ||
{ "internalType": "uint256", "name": "amount", "type": "uint256" } | ||
], | ||
"name": "transferFrom", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], | ||
"name": "transferOwnership", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
[ | ||
{ | ||
"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": "tokenAddress", "type": "address" }, | ||
{ "indexed": false, "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, | ||
{ "indexed": false, "internalType": "address", "name": "withdrawAddress", "type": "address" } | ||
], | ||
"name": "WithdrawTreasuryBEP20", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ "indexed": false, "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, | ||
{ "indexed": false, "internalType": "address", "name": "withdrawAddress", "type": "address" } | ||
], | ||
"name": "WithdrawTreasuryBNB", | ||
"type": "event" | ||
}, | ||
{ "payable": true, "stateMutability": "payable", "type": "fallback" }, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "owner", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [], | ||
"name": "renounceOwnership", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], | ||
"name": "transferOwnership", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ "internalType": "address", "name": "tokenAddress", "type": "address" }, | ||
{ "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, | ||
{ "internalType": "address", "name": "withdrawAddress", "type": "address" } | ||
], | ||
"name": "withdrawTreasuryBEP20", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, | ||
{ "internalType": "address payable", "name": "withdrawAddress", "type": "address" } | ||
], | ||
"name": "withdrawTreasuryBNB", | ||
"outputs": [], | ||
"payable": true, | ||
"stateMutability": "payable", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { expect } from "chai"; | ||
import { BigNumber, Contract } from "ethers"; | ||
import { ethers } from "hardhat"; | ||
|
||
import { expectEvents } from "../../src/utils"; | ||
import { forking, testVip } from "../../src/vip-framework"; | ||
import vip349, { COMMUNITY, USDT, USDT_AMOUNT, VAI, VAI_AMOUNT } from "../../vips/vip-349/bscmainnet"; | ||
import ERC20_ABI from "./abi/ERC20.json"; | ||
import VTREASURY_ABI from "./abi/VTreasury.json"; | ||
|
||
forking(41186097, async () => { | ||
let vai: Contract; | ||
let usdt: Contract; | ||
|
||
let prevUSDTBalance: BigNumber; | ||
let prevVAIBalance: BigNumber; | ||
|
||
before(async () => { | ||
vai = new ethers.Contract(VAI, ERC20_ABI, ethers.provider); | ||
usdt = new ethers.Contract(USDT, ERC20_ABI, ethers.provider); | ||
|
||
prevUSDTBalance = await usdt.balanceOf(COMMUNITY); | ||
prevVAIBalance = await vai.balanceOf(COMMUNITY); | ||
}); | ||
|
||
testVip("VIP-349", await vip349(), { | ||
callbackAfterExecution: async txResponse => { | ||
await expectEvents(txResponse, [VTREASURY_ABI], ["WithdrawTreasuryBEP20"], [2]); | ||
}, | ||
}); | ||
|
||
describe("Post-VIP behavior", async () => { | ||
it("check balances", async () => { | ||
const usdtBalance = await usdt.balanceOf(COMMUNITY); | ||
const vaiBalance = await vai.balanceOf(COMMUNITY); | ||
|
||
expect(usdtBalance.sub(prevUSDTBalance)).to.equal(USDT_AMOUNT); | ||
expect(vaiBalance.sub(prevVAIBalance)).to.equal(VAI_AMOUNT); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.