File tree 2 files changed +20
-4
lines changed
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ contract GetWhitelist is Ownable {
7
7
using SafeMathLib for uint ;
8
8
9
9
event NewEntry (address whitelisted );
10
+ event NewBatch ();
10
11
event EdittedEntry (address whitelisted , uint tier );
11
12
event WhitelisterChange (address whitelister , bool iswhitelister );
12
13
@@ -46,15 +47,30 @@ contract GetWhitelist is Ownable {
46
47
}
47
48
48
49
function acceptBatched (address [] _addresses , bool _isEarly ) onlyWhitelister {
50
+ // trying to save up some gas here
51
+ uint _presaleCap;
52
+ if (_isEarly) {
53
+ _presaleCap = presaleCap;
54
+ } else {
55
+ _presaleCap = 0 ;
56
+ }
49
57
for (uint i= 0 ; i< _addresses.length ; i++ ) {
50
- accept (_addresses[i], _isEarly);
58
+ entries[_addresses[i]] = WhitelistInfo (
59
+ _presaleCap,
60
+ tier1Cap,
61
+ tier2Cap,
62
+ tier3Cap,
63
+ tier4Cap,
64
+ true
65
+ );
51
66
}
67
+ NewBatch ();
52
68
}
53
69
54
- function accept (address _address , bool isEarly ) onlyWhitelister {
70
+ function accept (address _address , bool _isEarly ) onlyWhitelister {
55
71
require (! entries[_address].isWhitelisted);
56
72
uint _presaleCap;
57
- if (isEarly ) {
73
+ if (_isEarly ) {
58
74
_presaleCap = presaleCap;
59
75
} else {
60
76
_presaleCap = 0 ;
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ contract('GetWhitelist', function(accounts) {
185
185
} ) ;
186
186
187
187
it ( "whitelister can add multiple addresses" , async function ( ) {
188
- const n = 37 ; //37 is the max without out of gas exception
188
+ const n = 38 ; //38 is the max without out of gas exception
189
189
var whitelist = await GetWhitelist . deployed ( ) ;
190
190
let randomAccounts = ( new Array ( n ) ) . fill ( true ) . map ( ( ) => {
191
191
return VanityEth . getVanityWallet ( ) . address
You can’t perform that action at this time.
0 commit comments