File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ contract Core is ICore, Permissions {
3535 emit FeiUpdate (token);
3636 }
3737
38+ function setTribe (address token ) external override onlyGovernor {
39+ tribe = IERC20 (token);
40+ emit TribeUpdate (token);
41+ }
42+
3843 function setGenesisGroup (address _genesisGroup ) external override onlyGovernor {
3944 genesisGroup = _genesisGroup;
4045 }
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ interface ICore is IPermissions {
1313 // ----------- Events -----------
1414
1515 event FeiUpdate (address indexed _fei );
16+ event TribeUpdate (address indexed _tribe );
1617 event TribeAllocation (address indexed _to , uint _amount );
1718 event GenesisPeriodComplete (uint _timestamp );
1819
@@ -22,6 +23,10 @@ interface ICore is IPermissions {
2223 /// @param token new fei address
2324 function setFei (address token ) external ;
2425
26+ /// @notice sets Tribe address to a new address
27+ /// @param token new tribe address
28+ function setTribe (address token ) external ;
29+
2530 /// @notice sets Genesis Group address
2631 /// @param _genesisGroup new genesis group address
2732 function setGenesisGroup (address _genesisGroup ) external ;
Original file line number Diff line number Diff line change @@ -72,6 +72,23 @@ describe('Core', function () {
7272 } ) ;
7373 } ) ;
7474
75+ describe ( 'Tribe Update' , function ( ) {
76+ it ( 'updates' , async function ( ) {
77+ expectEvent (
78+ await this . core . setTribe ( userAddress , { from : governorAddress } ) ,
79+ 'TribeUpdate' ,
80+ {
81+ _tribe : userAddress
82+ }
83+ ) ;
84+ expect ( await this . core . tribe ( ) ) . to . be . equal ( userAddress ) ;
85+ } ) ;
86+
87+ it ( 'non governor reverts' , async function ( ) {
88+ await expectRevert ( this . core . setTribe ( userAddress , { from : userAddress } ) , "Permissions: Caller is not a governor" ) ;
89+ } ) ;
90+ } ) ;
91+
7592 describe ( 'Genesis' , function ( ) {
7693 describe ( 'Genesis Group' , function ( ) {
7794 it ( 'governor set succeeds' , async function ( ) {
You can’t perform that action at this time.
0 commit comments