-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from Into-the-Fathom/dev-multisig-scripts
Multisig Scripts - Maximum Coverage
- Loading branch information
Showing
56 changed files
with
1,182 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
const SUBMIT_TRANSACTION_EVENT = "SubmitTransaction(uint256,address,address,uint256,bytes)"; | ||
const EMPTY_BYTES = '0x0000000000000000000000000000000000000000000000000000000000000000'; | ||
|
||
const NULL_ADDRESS = '0x0000000000000000000000000000000000000000' | ||
// Update the PATH_TO_ADDRESSES based on the NODE_ENV environment variable | ||
const env = process.env.NODE_ENV || 'dev'; | ||
const PATH_TO_ADDRESSES = `../../addresses.${env}.json`; | ||
const PATH_TO_ADDRESSES_FOR_DEX_FOLDER = `../../../config/config.${env}` | ||
const PATH_TO_ADDRESSES_FOR_STABLECOIN_FOLDER = `../../../../config/config.${env}` | ||
const PATH_TO_NEWLY_GENERATED_TRANSACTION_INDEX = `./config/newly-generated-transaction-index.${env}.json`; | ||
const PATH_TO_ADDRESSES_FOR_STAKING_POSITION_FOLDER = `../../../addresses.staking-position.${env}.json`; | ||
|
||
module.exports = { | ||
SUBMIT_TRANSACTION_EVENT, | ||
EMPTY_BYTES, | ||
PATH_TO_ADDRESSES, | ||
PATH_TO_NEWLY_GENERATED_TRANSACTION_INDEX, | ||
PATH_TO_ADDRESSES_FOR_DEX_FOLDER, | ||
PATH_TO_ADDRESSES_FOR_STABLECOIN_FOLDER | ||
PATH_TO_ADDRESSES_FOR_STABLECOIN_FOLDER, | ||
PATH_TO_ADDRESSES_FOR_STAKING_POSITION_FOLDER, | ||
NULL_ADDRESS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
scripts/units/stablecoin/adapter/collateral-token-adapter-whitelist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const fs = require('fs'); | ||
const txnHelper = require('../../helpers/submitAndExecuteTransaction') | ||
|
||
const constants = require('../../helpers/constants') | ||
const addressesConfig = require(constants.PATH_TO_ADDRESSES_FOR_STABLECOIN_FOLDER) | ||
const COLLATERAL_TOKEN_ADAPTER_ADDRESS =addressesConfig.COLLATERAL_TOKEN_ADAPTER_ADDRESS | ||
const toBeWhitelisted = "" | ||
const _encodeAddToWhitelist = (toBeWhitelisted) => { | ||
let toRet = web3.eth.abi.encodeFunctionCall({ | ||
name: 'whitelist', | ||
type: 'function', | ||
inputs: [{ | ||
type: 'address', | ||
name: 'toBeWhitelisted' | ||
}] | ||
}, [toBeWhitelisted]); | ||
|
||
return toRet; | ||
} | ||
|
||
|
||
module.exports = async function(deployer) { | ||
|
||
await txnHelper.submitAndExecute( | ||
_encodeAddToWhitelist(toBeWhitelisted), | ||
COLLATERAL_TOKEN_ADAPTER_ADDRESS, | ||
"WhitelistCollateralTokenAdapter" | ||
) | ||
} |
35 changes: 35 additions & 0 deletions
35
scripts/units/stablecoin/adapter/withdraw-collateral-token-adapter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const fs = require('fs'); | ||
const txnHelper = require('../../helpers/submitAndExecuteTransaction') | ||
|
||
const constants = require('../../helpers/constants') | ||
const addressesConfig = require(constants.PATH_TO_ADDRESSES_FOR_STABLECOIN_FOLDER) | ||
const COLLATERAL_TOKEN_ADAPTER_ADDRESS =addressesConfig.COLLATERAL_TOKEN_ADAPTER_ADDRESS | ||
const _amount = web3.utils.toWei("100000","wei") | ||
const _usr = "" | ||
const _encodeWithdraw = (_usr, _amount) => { | ||
let toRet = web3.eth.abi.encodeFunctionCall({ | ||
name: 'withdraw', | ||
type: 'function', | ||
inputs: [{ | ||
type: 'address', | ||
name: '_usr' | ||
}, { | ||
type: 'uint256', | ||
name: '_amount' | ||
},{ | ||
type: 'bytes' | ||
}] | ||
}, [_usr,_amount]); | ||
|
||
return toRet; | ||
} | ||
|
||
|
||
module.exports = async function(deployer) { | ||
|
||
await txnHelper.submitAndExecute( | ||
_encodeWithdraw(_usr,_amount), | ||
COLLATERAL_TOKEN_ADAPTER_ADDRESS, | ||
"WithdrawCollateralTokenAdapter" | ||
) | ||
} |
36 changes: 36 additions & 0 deletions
36
scripts/units/stablecoin/adapter/withdraw-stablecoin-adapter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const fs = require('fs'); | ||
const txnHelper = require('../../helpers/submitAndExecuteTransaction') | ||
|
||
const constants = require('../../helpers/constants') | ||
const addressesConfig = require(constants.PATH_TO_ADDRESSES_FOR_STABLECOIN_FOLDER) | ||
const BOOK_KEEPER_ADDRESS =addressesConfig.BOOK_KEEPER_ADDRESS | ||
const STABLE_COIN_ADAPTER_ADDRESS =addressesConfig.STABLE_COIN_ADAPTER_ADDRESS | ||
const wad = web3.utils.toWei("100000","wei") | ||
const usr = "" | ||
const _encodeWithdraw = (usr, wad) => { | ||
let toRet = web3.eth.abi.encodeFunctionCall({ | ||
name: 'withdraw', | ||
type: 'function', | ||
inputs: [{ | ||
type: 'address', | ||
name: 'usr' | ||
}, { | ||
type: 'uint256', | ||
name: 'wad' | ||
},{ | ||
type: 'bytes' | ||
}] | ||
}, [usr,wad]); | ||
|
||
return toRet; | ||
} | ||
|
||
|
||
module.exports = async function(deployer) { | ||
|
||
await txnHelper.submitAndExecute( | ||
_encodeWithdraw(usr,wad), | ||
STABLE_COIN_ADAPTER_ADDRESS, | ||
"WithdrawStablecoinAdapter" | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ module.exports = async function(deployer) { | |
BOOK_KEEPER_ADDRESS, | ||
"setAllowlistedAddressBookkeeper" | ||
) | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
scripts/units/stablecoin/book-keeper/set-access-collateral-config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const fs = require('fs'); | ||
const txnHelper = require('../../helpers/submitAndExecuteTransaction') | ||
|
||
const constants = require('../../helpers/constants') | ||
const addressesConfig = require(constants.PATH_TO_ADDRESSES_FOR_STABLECOIN_FOLDER) | ||
|
||
const BOOK_KEEPER_ADDRESS =addressesConfig.BOOK_KEEPER_ADDRESS | ||
const AccessControlConfig = "" | ||
const _encodeSetAccessControlConfig = (_accessControlConfig) => { | ||
let toRet = web3.eth.abi.encodeFunctionCall({ | ||
name: 'setAccessControlConfig', | ||
type: 'function', | ||
inputs: [{ | ||
type: 'address', | ||
name: '_accessControlConfig' | ||
}] | ||
}, [_accessControlConfig]); | ||
|
||
return toRet; | ||
} | ||
|
||
|
||
module.exports = async function(deployer) { | ||
|
||
await txnHelper.submitAndExecute( | ||
_encodeSetAccessControlConfig(AccessControlConfig), | ||
BOOK_KEEPER_ADDRESS, | ||
"setAccessControlConfig" | ||
) | ||
} |
30 changes: 30 additions & 0 deletions
30
scripts/units/stablecoin/book-keeper/set-collateral-pool-config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const fs = require('fs'); | ||
const txnHelper = require('../../helpers/submitAndExecuteTransaction') | ||
|
||
const constants = require('../../helpers/constants') | ||
const addressesConfig = require(constants.PATH_TO_ADDRESSES_FOR_STABLECOIN_FOLDER) | ||
|
||
const BOOK_KEEPER_ADDRESS =addressesConfig.BOOK_KEEPER_ADDRESS | ||
const CollateralPoolConfig = "" | ||
const _encodeSetCollateralPoolConfig = (_collateralPoolConfig) => { | ||
let toRet = web3.eth.abi.encodeFunctionCall({ | ||
name: 'setCollateralPoolConfig', | ||
type: 'function', | ||
inputs: [{ | ||
type: 'address', | ||
name: '_collateralPoolConfig' | ||
}] | ||
}, [_collateralPoolConfig]); | ||
|
||
return toRet; | ||
} | ||
|
||
|
||
module.exports = async function(deployer) { | ||
|
||
await txnHelper.submitAndExecute( | ||
_encodeSetCollateralPoolConfig(CollateralPoolConfig), | ||
BOOK_KEEPER_ADDRESS, | ||
"setCollateralPoolConfig" | ||
) | ||
} |
Oops, something went wrong.