Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Conversation

bweick
Copy link
Contributor

@bweick bweick commented Nov 16, 2018

…equired.

@coveralls
Copy link

coveralls commented Nov 16, 2018

Pull Request Test Coverage Report for Build 2872

  • 36 of 36 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 2834: 0.0%
Covered Lines: 606
Relevant Lines: 606

💛 - Coveralls

address _newRebalanceAuctionModule
)
external
onlyOwner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to timelock this function too..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we should...another PR though once yours is merged

*
* @param _newIssuanceOrderModule Address of deployed issuanceOrderModule contract
*/
function setIssuanceOrderModule(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this function? If we upgrade the issuanceOrderModule, can we just redeploy the wrappers as well?

Then, we wouldn't need to manage ownership or have the update module functions in each of the wrappers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as little redeployment of contracts as possible is best. Not necessarily because its cheaper but because we should try to make the system as static as possible, people in theory will be watching this contracts quite a bit and moving them around with a redeploy feels less scalable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are trying to house contract tracking in Core, then why not have the Wrapper call Core to check what the issuanceOrder module is?

*
* Extension used to expose internal accounting functions to module
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connect comment with line 31?

* @param _to Address to credit for deposit
* @param _quantity Amount of tokens to deposit
*/
function depositModule(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we just expose the batchDeposit version and the modules can format if they only want to pass a single deposit in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think this might be a better approach

address _to,
uint256 _quantity
)
external
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure this is WIP, but need a check that this is a module.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup added in newest commit

ICoreIssuance,
ICoreAccounting,
CoreState,
contract IssuanceOrderModule is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you thought about naming ModuleIssuanceOrder vs IssuanceOrderModule? @asoong any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the latter cause it rolls off the tongue better. It's also it's own contract so don't feel like it falls under the same category as our core extension type contracts when we prefix with Core.

address public vault;

// Mapping of filled Issuance Orders
mapping(bytes32 => uint) public orderFills;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint256

mapping(bytes32 => uint) public orderFills;

// Mapping of canceled Issuance Orders
mapping(bytes32 => uint) public orderCancels;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint256


// Verify signature is authentic
ISignatureValidator(state.signatureValidator).validateSignature(
ISignatureValidator(ICore(core).signatureValidator()).validateSignature(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense for Core to house the signatureValidator variable or for issuanceOrder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the contract tracking should still all run through Core which is why I kept it there.

);

// Call Exchange
// // Call Exchange
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate //

@bweick bweick force-pushed the brian/implement_modules branch from 0e88c4f to 19587f8 Compare November 16, 2018 20:57
// Make sure sender is rebalanceAuctionModule
require(
msg.sender == IRebalancingSetFactory(factory).core(),
msg.sender == IRebalancingSetFactory(factory).rebalanceAuctionModule(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we house contracts in Core, which ones make sense to house in the RebalancingSetFactory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main reason I didn't add specific module names to the Core is because when we add new modules we won't be able to add their specific identifier to Core. As I think about it we don't actually need to specifically identify which module is calling these functions just that a module we approve of is, so I'd be fine just doing something like ICore(core).validModule(msg.sender) which I think accomplishes the same thing instead of specifying the module we need.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

*
* @param _newIssuanceOrderModule Address of deployed issuanceOrderModule contract
*/
function setIssuanceOrderModule(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are trying to house contract tracking in Core, then why not have the Wrapper call Core to check what the issuanceOrder module is?

function addModule(
address _module
)
external
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder that we will need to add timelock Modifier

*/
function bid(
address _rebalancingSetToken,
function issueModule(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't upgrade Core, we might want to expose other functions like redeemInternal as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

* @param _module Factory address
* @return bool Boolean indicating if enabled factory
*/
function validModules(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validModule vs validModules?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We pluralized it for the other functions was just going for consistency

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

external
onlyOwner
{
state.validModules[_module] = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should emit an event, so we can keep track of history

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets jsut add that to your PR since you have a standard for how you've been doing those.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

external
onlyOwner
{
state.validModules[_module] = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same re: event. But we can do it later.

Copy link
Contributor

@felix2feng felix2feng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there - final knits

returns (address[], uint256[], uint256[])
{
// Make sure sender is Core
// Make sure sender is rebalanceAuctionModule
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In actuality, we're checking that its a valid module

*/
contract RebalancingSetTokenFactory {
contract RebalancingSetTokenFactory is
Ownable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this?

*/
contract KyberNetworkWrapper {
contract KyberNetworkWrapper is
Ownable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same - don't think we need it.

*/
contract TakerWalletWrapper {
contract TakerWalletWrapper is
Ownable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

require(
msg.sender == IRebalancingSetFactory(factory).core(),
ICore(IRebalancingSetFactory(factory).core()).validModules(msg.sender),
"RebalancingSetToken.placeBid: Sender must be core"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update me

*/
contract ZeroExExchangeWrapper {
contract ZeroExExchangeWrapper is
Ownable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@felix2feng felix2feng merged commit 15af3fd into master Nov 18, 2018
@felix2feng felix2feng deleted the brian/implement_modules branch November 18, 2018 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants