@@ -36,9 +36,6 @@ describe('XCAmple:burnFrom:accessControl', function () {
3636 await xcAmple
3737 . connect ( deployer )
3838 . mint ( otherUser . getAddress ( ) , unitTokenAmount ) ;
39- await xcAmple
40- . connect ( otherUser )
41- . approve ( await deployer . getAddress ( ) , unitTokenAmount ) ;
4239 } ) ;
4340
4441 it ( 'should NOT be callable by other user' , async function ( ) {
@@ -74,37 +71,19 @@ describe('XCAmple:burnFrom', () => {
7471 const mintAmt = toUFrgDenomination ( '1000000' ) ;
7572 await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , mintAmt ) ;
7673 const burnAmt = ( await xcAmple . balanceOf ( otherUser . getAddress ( ) ) ) . add ( 1 ) ;
77- await xcAmple
78- . connect ( otherUser )
79- . approve ( await deployer . getAddress ( ) , burnAmt ) ;
80-
8174 await expect (
8275 xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ,
8376 ) . to . be . reverted ;
8477 } ) ;
8578 } ) ;
8679
87- describe ( 'when burn value > approved amount' , ( ) => {
88- it ( 'should revert' , async function ( ) {
89- const mintAmt = toUFrgDenomination ( '1000000' ) ;
90- await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , mintAmt ) ;
91- await xcAmple
92- . connect ( otherUser )
93- . approve ( await deployer . getAddress ( ) , mintAmt . sub ( 1 ) ) ;
94- await expect (
95- xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , mintAmt ) ,
96- ) . to . be . reverted ;
97- } ) ;
98- } ) ;
99-
10080 describe ( 'when burn value = user balance' , ( ) => {
10181 const amt1 = toUFrgDenomination ( '1000000' ) ;
10282 const amt2 = toUFrgDenomination ( '12343588' ) ;
10383 const totalAmt = amt1 . add ( amt2 ) ;
10484 beforeEach ( async function ( ) {
10585 await xcAmple . connect ( deployer ) . mint ( deployer . getAddress ( ) , amt2 ) ;
10686 await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , amt1 ) ;
107- await xcAmple . connect ( otherUser ) . approve ( deployer . getAddress ( ) , amt1 ) ;
10887 } ) ;
10988 it ( 'should burn tokens from wallet' , async function ( ) {
11089 await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , amt1 ) ;
@@ -120,16 +99,6 @@ describe('XCAmple:burnFrom', () => {
12099 await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , amt1 ) ;
121100 expect ( await xcAmple . totalSupply ( ) ) . to . eq ( amt2 ) ;
122101 } ) ;
123- it ( 'should reduce the approved amount' , async function ( ) {
124- const allowanceBefore = await xcAmple . allowance (
125- otherUser . getAddress ( ) ,
126- deployer . getAddress ( ) ,
127- ) ;
128- await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , amt1 ) ;
129- expect (
130- await xcAmple . allowance ( otherUser . getAddress ( ) , deployer . getAddress ( ) ) ,
131- ) . to . eq ( allowanceBefore - amt1 ) ;
132- } ) ;
133102 it ( 'should log Transfer to zero address' , async function ( ) {
134103 await expect (
135104 xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , amt1 ) ,
@@ -150,7 +119,6 @@ describe('XCAmple:burnFrom', () => {
150119
151120 beforeEach ( async function ( ) {
152121 await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , mintAmt ) ;
153- await xcAmple . connect ( otherUser ) . approve ( deployer . getAddress ( ) , mintAmt ) ;
154122 } ) ;
155123 it ( 'should burn tokens from wallet' , async function ( ) {
156124 await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ;
@@ -163,16 +131,6 @@ describe('XCAmple:burnFrom', () => {
163131 await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ;
164132 expect ( await xcAmple . totalSupply ( ) ) . to . eq ( remainingBal ) ;
165133 } ) ;
166- it ( 'should reduce the approved amount' , async function ( ) {
167- const allowanceBefore = await xcAmple . allowance (
168- otherUser . getAddress ( ) ,
169- deployer . getAddress ( ) ,
170- ) ;
171- await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ;
172- expect (
173- await xcAmple . allowance ( otherUser . getAddress ( ) , deployer . getAddress ( ) ) ,
174- ) . to . eq ( allowanceBefore - burnAmt ) ;
175- } ) ;
176134 it ( 'should log Transfer to zero address' , async function ( ) {
177135 await expect (
178136 xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ,
@@ -193,9 +151,6 @@ describe('XCAmple:burnFrom', () => {
193151 beforeEach ( async function ( ) {
194152 await xcAmple . rebase ( 1 , MAX_SUPPLY ) ;
195153 await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , MAX_SUPPLY ) ;
196- await xcAmple
197- . connect ( otherUser )
198- . approve ( deployer . getAddress ( ) , MAX_SUPPLY ) ;
199154 } ) ;
200155
201156 it ( 'should burn tokens from wallet' , async function ( ) {
@@ -209,16 +164,6 @@ describe('XCAmple:burnFrom', () => {
209164 await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ;
210165 expect ( await xcAmple . totalSupply ( ) ) . to . eq ( remainingBal ) ;
211166 } ) ;
212- it ( 'should reduce the approved amount' , async function ( ) {
213- const allowanceBefore = await xcAmple . allowance (
214- otherUser . getAddress ( ) ,
215- deployer . getAddress ( ) ,
216- ) ;
217- await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ;
218- expect (
219- await xcAmple . allowance ( otherUser . getAddress ( ) , deployer . getAddress ( ) ) ,
220- ) . to . eq ( allowanceBefore . sub ( burnAmt ) ) ;
221- } ) ;
222167 it ( 'should log Transfer to zero address' , async function ( ) {
223168 await expect (
224169 xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ,
0 commit comments