Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewAR2 committed Jul 20, 2023
1 parent a6f9627 commit ae3c0a2
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 3 deletions.
4 changes: 4 additions & 0 deletions contracts/Boilerplate/Multiplexer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,8 @@ contract Multiplexer is ConstructorOwnable {
{
rolesPrivilagesStore.setRole(roleName, trueSelectors, falseSelectors);
}

function setPaused(bool _paused) public onlyOwner {
fees.setPaused(_paused);
}
}
2 changes: 1 addition & 1 deletion contracts/Front/Roles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ contract Roles is Base, Ownable {
}

function transferApollo(address[] apollo, address[] to) public {
require(head.context().catalogue().fees().isAdmin(msg.sender), "Must be admin");
require(fees.isAdmin(msg.sender), "Must be admin");
require(apollo.length == to.length, "Array lengths not equals");
uint16 i;
for (i = 0; i < apollo.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ambrosus-node-contracts",
"author": "Ambrosus",
"description": "Smart contracts used in AMB-NET",
"version": "0.0.96",
"version": "0.0.97",
"license": "MPL-2.0-no-copyleft-exception",
"repository": "git@github.com:ambrosus/ambrosus-node-contracts.git",
"main": "dist/index.js",
Expand Down
4 changes: 4 additions & 0 deletions src/actions/fees_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ export default class FeesActions {
async feeForChallenge(storagePeriods) {
return this.feesWrapper.feeForChallenge(storagePeriods);
}

async setPaused(paused) {
return this.feesWrapper.setPaused(paused);
}
}
4 changes: 4 additions & 0 deletions src/actions/multisig_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,8 @@ export default class MultisigActions {
async removePool(pool) {
return this.submitTransaction(await this.multiplexerWrapper.removePool(pool));
}

async setPaused(paused) {
return this.submitTransaction(await this.multiplexerWrapper.setPaused(paused));
}
}
9 changes: 9 additions & 0 deletions src/tasks/pooling.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export default class PoolingTask extends TaskBase {
await this.stake(options[0], options[1]);
} else if (command === 'unstake') {
await this.unstake(options[0], options[1]);
} else if (command === 'setPaused') {
await this.setPaused(options[0]);
} else {
console.error('Unknown sub-command, see yarn task pooling help');
process.exit(1);
Expand Down Expand Up @@ -112,6 +114,13 @@ export default class PoolingTask extends TaskBase {
console.error('Wrong address, use: yarn task pooling unstake [pool address, tokens]');
}

async setPaused(paused) {
if (!paused) {
return;
}
return this.multisigActions.setPaused(paused);
}

help() {
return {
options: '[create/pools/activate/deactivate/stake/unstake]',
Expand Down
2 changes: 1 addition & 1 deletion src/utils/web3_tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This Source Code Form is “Incompatible With Secondary Licenses”, as defined
import Web3 from 'web3';
import config from '../../config/config';

export const DEFAULT_GAS = 6000000;
export const DEFAULT_GAS = 10000000;

export const {utils} = new Web3();

Expand Down
5 changes: 5 additions & 0 deletions src/wrappers/fees_wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,9 @@ export default class FeesWrapper extends ManagedOwnableContractWrapper {
const contract = await this.contract();
return this.processTransaction(contract.methods.removeAdmin(admin));
}

async setPaused(paused) {
const contract = await this.contract();
return this.processTransaction(contract.methods.setPaused(paused));
}
}
4 changes: 4 additions & 0 deletions src/wrappers/multiplexer_wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,8 @@ export default class MultiplexerWrapper extends GenesisContractWrapper {
async setRole(roleName, trueSelectors, falseSelectors) {
return this.contract.methods.setRole(roleName, trueSelectors, falseSelectors).encodeABI();
}

async setPaused(paused) {
return this.contract.methods.setPaused(paused).encodeABI();
}
}

0 comments on commit ae3c0a2

Please sign in to comment.