@@ -36,9 +36,6 @@ describe('XCAmple:burnFrom:accessControl', function () {
36
36
await xcAmple
37
37
. connect ( deployer )
38
38
. mint ( otherUser . getAddress ( ) , unitTokenAmount ) ;
39
- await xcAmple
40
- . connect ( otherUser )
41
- . approve ( await deployer . getAddress ( ) , unitTokenAmount ) ;
42
39
} ) ;
43
40
44
41
it ( 'should NOT be callable by other user' , async function ( ) {
@@ -74,37 +71,19 @@ describe('XCAmple:burnFrom', () => {
74
71
const mintAmt = toUFrgDenomination ( '1000000' ) ;
75
72
await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , mintAmt ) ;
76
73
const burnAmt = ( await xcAmple . balanceOf ( otherUser . getAddress ( ) ) ) . add ( 1 ) ;
77
- await xcAmple
78
- . connect ( otherUser )
79
- . approve ( await deployer . getAddress ( ) , burnAmt ) ;
80
-
81
74
await expect (
82
75
xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ,
83
76
) . to . be . reverted ;
84
77
} ) ;
85
78
} ) ;
86
79
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
-
100
80
describe ( 'when burn value = user balance' , ( ) => {
101
81
const amt1 = toUFrgDenomination ( '1000000' ) ;
102
82
const amt2 = toUFrgDenomination ( '12343588' ) ;
103
83
const totalAmt = amt1 . add ( amt2 ) ;
104
84
beforeEach ( async function ( ) {
105
85
await xcAmple . connect ( deployer ) . mint ( deployer . getAddress ( ) , amt2 ) ;
106
86
await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , amt1 ) ;
107
- await xcAmple . connect ( otherUser ) . approve ( deployer . getAddress ( ) , amt1 ) ;
108
87
} ) ;
109
88
it ( 'should burn tokens from wallet' , async function ( ) {
110
89
await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , amt1 ) ;
@@ -120,16 +99,6 @@ describe('XCAmple:burnFrom', () => {
120
99
await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , amt1 ) ;
121
100
expect ( await xcAmple . totalSupply ( ) ) . to . eq ( amt2 ) ;
122
101
} ) ;
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
- } ) ;
133
102
it ( 'should log Transfer to zero address' , async function ( ) {
134
103
await expect (
135
104
xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , amt1 ) ,
@@ -150,7 +119,6 @@ describe('XCAmple:burnFrom', () => {
150
119
151
120
beforeEach ( async function ( ) {
152
121
await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , mintAmt ) ;
153
- await xcAmple . connect ( otherUser ) . approve ( deployer . getAddress ( ) , mintAmt ) ;
154
122
} ) ;
155
123
it ( 'should burn tokens from wallet' , async function ( ) {
156
124
await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ;
@@ -163,16 +131,6 @@ describe('XCAmple:burnFrom', () => {
163
131
await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ;
164
132
expect ( await xcAmple . totalSupply ( ) ) . to . eq ( remainingBal ) ;
165
133
} ) ;
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
- } ) ;
176
134
it ( 'should log Transfer to zero address' , async function ( ) {
177
135
await expect (
178
136
xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ,
@@ -193,9 +151,6 @@ describe('XCAmple:burnFrom', () => {
193
151
beforeEach ( async function ( ) {
194
152
await xcAmple . rebase ( 1 , MAX_SUPPLY ) ;
195
153
await xcAmple . connect ( deployer ) . mint ( otherUser . getAddress ( ) , MAX_SUPPLY ) ;
196
- await xcAmple
197
- . connect ( otherUser )
198
- . approve ( deployer . getAddress ( ) , MAX_SUPPLY ) ;
199
154
} ) ;
200
155
201
156
it ( 'should burn tokens from wallet' , async function ( ) {
@@ -209,16 +164,6 @@ describe('XCAmple:burnFrom', () => {
209
164
await xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ;
210
165
expect ( await xcAmple . totalSupply ( ) ) . to . eq ( remainingBal ) ;
211
166
} ) ;
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
- } ) ;
222
167
it ( 'should log Transfer to zero address' , async function ( ) {
223
168
await expect (
224
169
xcAmple . connect ( deployer ) . burnFrom ( otherUser . getAddress ( ) , burnAmt ) ,
0 commit comments