Skip to content
This repository was archived by the owner on Nov 13, 2022. It is now read-only.

Commit 8b2bbc9

Browse files
Fixed initialization bug
- Social token was improperly initialized causing the HH test to fail
1 parent 3c6ffb9 commit 8b2bbc9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

contracts/mimic/SocialHub.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ contract SocialHub is ISocialHub {
238238
SocialTrader storage st = listOfSocialTraders[address(token)];
239239

240240
st.twitterHandle = _twitterHandle;
241+
st.initialized = true;
241242

242243
emit SocialTraderTokenRegistered(address(token), msg.sender);
243244
}
@@ -247,7 +248,7 @@ contract SocialHub is ISocialHub {
247248
function verifySocialTraderToken(address _token) external override onlyAdmin deprecatedCheck(true) {
248249
SocialTrader storage st = listOfSocialTraders[_token];
249250

250-
if(!listOfSocialTraders[_token].initialized)
251+
if(!st.initialized)
251252
revert NotASocialTraderToken(_token);
252253

253254
st.verified = true;

test/SocialHub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('SocialHub test', () => {
9292
describe('Whitelist functions', () => {
9393
it('Should add a new address to the whitelist', async () => {
9494
await socialHub.connect(deployer).addToWhitelist(fake_traderManager.address);
95-
95+
9696
expect(await socialHub.whitelisted(fake_traderManager.address)).to.equal(true);
9797
});
9898
it('Should remove an address from the whitelist', async () => {

0 commit comments

Comments
 (0)