Comments (10)
@akolotov we have to decide who will have a permission to call addBridgeContract
and removeBridgeContract
functions. Do you have any suggestions about that?
from poa-network-consensus-contracts.
@varasev I have not found a part of code which allow to set the bridge contract. My understanding now is that it is done by the upgrading the whole RewarByBlock
contract. Could addBridgeContract
and removeBridgeContract
be called in similar manner? It is up to you to implement the ability to control multiple bridge contracts in order to not spoil the current security model.
from poa-network-consensus-contracts.
My understanding now is that it is done by the upgrading the whole RewarByBlock contract.
For now, the value of bridgeContract
constant may only be changed by changing the implementation of RewardByBlock. It is possible with VotingToChangeProxyAddress
contract, so validators should vote for the change.
We could make another type of voting to add/remove bridge contract address to RewardByBlock. @igorbarinov what can you say about it?
An easier way is to allow these functions to be called only by some Multisig Wallet.
Or allow these functions to be called only by the MoC, for example, but I think it's not secure enough.
from poa-network-consensus-contracts.
What if we do in the same manner how it exists now:
So, instead of
address public constant bridgeContract = 0x0000000000000000000000000000000000000000;
we will have
mapping (address => bool) public bridgeContracts;
bridgeContracts["0x1...a"] = true;
bridgeContracts["0x2...b"] = true;
bridgeContracts["0x3...c"] = true;
from poa-network-consensus-contracts.
Yes, we can make the addresses hardcoded. In the case when we want to add some new bridge contract, we can implement addBridgeContract
that can be called by anyone but with hardcoded new address and can be called only once. For example:
function addBridgeContract() public {
address newContract = "0x4...d";
require(bridgeContracts[newContract] == false);
bridgeContracts[newContract] = true;
}
The same is for removeBridgeContract
:
function removeBridgeContract() public {
address contractToRemove = "0x1...a";
require(bridgeContracts[contractToRemove] == true);
bridgeContracts[contractToRemove] = false;
}
addBridgeContract
/ removeBridgeContract
function will have to be called after RewardByBlock's implementation is upgraded.
from poa-network-consensus-contracts.
@akolotov Instead of addBridgeContract/removeBridgeContract we could have a single initBridgeContractAddresses
as you suggested above:
function initBridgeContractAddresses() public {
bridgeContracts["0x1...a"] = false; // removed bridge
bridgeContracts["0x2...b"] = true;
bridgeContracts["0x3...c"] = true;
}
from poa-network-consensus-contracts.
To not to change the state of RewardByBlock contract we could just add the next getter in its implementation:
function isBridgeContract(address _addr) public pure returns(bool) {
if (_addr == "0x1...a") return true;
if (_addr == "0x2...b") return true;
if (_addr == "0x3...c") return true;
return false;
}
And use it inside onlyBridgeContract
modifier:
modifier onlyBridgeContract {
require(isBridgeContract(msg.sender));
_;
}
from poa-network-consensus-contracts.
It is OK for me. How about ideas for implementation of mintedByBridge
?
from poa-network-consensus-contracts.
I'll think about it and implement soon. There shouldn't be any difficulties.
from poa-network-consensus-contracts.
Done in #201.
from poa-network-consensus-contracts.
Related Issues (20)
- (Bug) KeysManager: there is no restrictions who can execute migration functions HOT 1
- (Feature) PoaNetworkConsensus.isValidatorFinalized function HOT 1
- (Fix) removeVotingKey and removePayoutKey shouldn't revert if voting/ payout key is already removed HOT 1
- (Improvement) Voting DApp creates a lot of requests to call data from smart-contracts HOT 5
- Fix solc usage HOT 4
- (Fix) Auto decrease min threshold when validator is removed HOT 1
- (Feature) VotingToManageEmissionFunds should allow canceling new ballot by its creator for 15 minutes after it's created HOT 1
- (Update) Update truffle package to 5.0
- (Update) Review the value of the depth of changing mining keys
- (Update) Using of different events for different actions
- (Fix) Add checking for contract's existence to VotingToChangeProxyAddress.createBallot
- Get rid of limitation when an account could receive coins only once per every block HOT 1
- Add ability to get total amount of coins minted by Block Reward feature HOT 1
- (Fix) VotingToManageEmissionFunds.canBeFinalizedNow function
- (Question) Are the deployed contracts versioned? HOT 3
- (Update) Introduce min ballot duration in VotingToManageEmissionFunds contract like in other VotingToChange* contracts HOT 1
- (Update) Add `contactEmail` and `isCompany` fields to ValidatorMetadata contract HOT 1
- Question about PoaNetworkConsensus contract validator states HOT 2
- I transferred POA NETWORK to my MetaMask wallet on the xDai network and I can't find the currency in my wallet so I can convert or transfer it.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poa-network-consensus-contracts.