-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow funds to be sent directly to domains #1291
base: develop
Are you sure you want to change the base?
Conversation
An open question here is what should happen in terms of the colony reward pot. I think I am of the opinion that whatever it is set to should be respected. |
So, funds sent to the main colony address or specific domain addresses will also automatically be divided up and split amongst the respective teams set by the rewards pot? Regardless if the funds are only sent to a specific team? |
This isn't really describing what the reward pot does. It is a single pot, and the only configuration available related to it is the fraction of incoming funds that gets put in to it, and those funds will eventually be divided among all people who have both reputation and native tokens. It's possible this is functionality that should be removed, but until that decision is made, anything other than respecting that configuration means that it can be totally bypassed (as instead of sending funds to a colony directly, you can send funds directly to the top-level domain). |
Haha, yeah, just crisscrossed myself with the talk of teams. I agree with you on both. Perhaps in needs to be rethought a little or removed, but until that time, if it is configured, it seems to make sense that it can't be bypassed. It just does not seem intuitive that it would be the case when a colony is transferring funds to itself, but, I understand that this is how this functionality would essentially work. |
0eb11bc
to
9575ac7
Compare
d698cfc
to
d5c36c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, will probably have some more comments on my next go-round but here are my first reactions.
c978a65
to
569309e
Compare
EDIT: Sort-of on hold until Arren and Jack have thought more about what compromise is acceptable in terms of someone looping payments to create reputation and take over a colony. |
Could say that internal tokens cannot be sent directly to domains? |
Essentially, yes, this is what I was going to implement (or, more strictly, when such tokens are claimed, they go to the root domain) but there are concerns it will render the functionality less useful than they would like. |
569309e
to
448f72c
Compare
4ac35aa
to
f888d3d
Compare
The solution that has been decided on is to let root approve a certain amount of reputation-earning tokens to enter a domain (like ERC20). Any above the approved amount are sent to root. The intention is that the typical in-domain swap (through the UI, at least) that would result in a domain receiving reputation-earning tokens would be a motion that requires root that makes the approval for an appropriate amount and then does the swap. Motions being approved at the same time should be supported (or at least not break in a surprising way). |
689000d
to
82593ee
Compare
e511717
to
e1b6828
Compare
bea8896
to
2ec9efe
Compare
2ec9efe
to
edc7c57
Compare
8f2dfd0
to
a07a09f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
a07a09f
to
1294782
Compare
1294782
to
0d08fa7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 22 out of 42 changed files in this pull request and generated no suggestions.
Files not reviewed (20)
- .storage-layouts-normalized/contracts/colony/Colony.sol:Colony.json: Language not supported
- .storage-layouts-normalized/contracts/colony/ColonyArbitraryTransaction.sol:ColonyArbitraryTransaction.json: Language not supported
- .storage-layouts-normalized/contracts/colony/ColonyDomains.sol:ColonyDomains.json: Language not supported
- .storage-layouts-normalized/contracts/colony/ColonyExpenditure.sol:ColonyExpenditure.json: Language not supported
- .storage-layouts-normalized/contracts/colony/ColonyFunding.sol:ColonyFunding.json: Language not supported
- .storage-layouts-normalized/contracts/colony/ColonyRewards.sol:ColonyRewards.json: Language not supported
- .storage-layouts-normalized/contracts/colony/ColonyRoles.sol:ColonyRoles.json: Language not supported
- .storage-layouts-normalized/contracts/colony/ColonyStorage.sol:ColonyStorage.json: Language not supported
- .storage-layouts-normalized/contracts/colonyNetwork/ColonyNetwork.sol:ColonyNetwork.json: Language not supported
- .storage-layouts-normalized/contracts/colonyNetwork/ColonyNetworkAuction.sol:ColonyNetworkAuction.json: Language not supported
- .storage-layouts-normalized/contracts/colonyNetwork/ColonyNetworkDeployer.sol:ColonyNetworkDeployer.json: Language not supported
- .storage-layouts-normalized/contracts/colonyNetwork/ColonyNetworkENS.sol:ColonyNetworkENS.json: Language not supported
- .storage-layouts-normalized/contracts/colonyNetwork/ColonyNetworkExtensions.sol:ColonyNetworkExtensions.json: Language not supported
- .storage-layouts-normalized/contracts/colonyNetwork/ColonyNetworkMining.sol:ColonyNetworkMining.json: Language not supported
- .storage-layouts-normalized/contracts/colonyNetwork/ColonyNetworkSkills.sol:ColonyNetworkSkills.json: Language not supported
- .storage-layouts-normalized/contracts/colonyNetwork/ColonyNetworkStorage.sol:ColonyNetworkStorage.json: Language not supported
- .storage-layouts-normalized/contracts/common/DomainTokenReceiver.sol:DomainTokenReceiver.json: Language not supported
- .storage-layouts-normalized/contracts/testHelpers/FunctionsNotAvailableOnColony.sol:FunctionsNotAvailableOnColony.json: Language not supported
- .storage-layouts-normalized/contracts/testHelpers/NoLimitSubdomains.sol:NoLimitSubdomains.json: Language not supported
- contracts/colony/Colony.sol: Language not supported
As-is, this means domains can send money between each other arbitrarily (while paying a network free), which we have prevented in the past. I don't believe it is possible, but would like to be proven wrong. |
This is work that I've done while working on #1285 as a prerequisite for the required functionality of domains to be able to manage and exchange tokens cross-chain. For that functionality to work, I believe this functionality (or something equivalent) is required; where such an exchange is happening cross-chain, and we can't directly interrogate balances before and after the exchange on the other chain, we need a more generic way to send tokens to a domain directly in order to do the bookkeeping correctly.
Because we can't send extra data with an ERC20 token transfer that's executed by other parties, I believe the only way to do this is have a system where each domain has a unique address that can have tokens swept from it in to the corresponding domain.
Fortunately, we can (re-)use CreateX for this. By using a contract deployment salt that's a function of the colony address and domain id, we can deploy a helper contract (
DomainTokenReceiver
) to a fixed address for each domain (even across chains) with simple functionality to allow the sweep to occur.I've tried to make this as transparent as possible - the deployment, upgrading, and management of the receiving contract is intended to not require any explicit interaction from the user. The experience should be that the users send tokens to a domain-specific address (which they can get from
getDomainTokenReceiverAddress
onColonyNetwork
) and then claim them (viaclaimDomainFunds
onColony
) without having to check whether the contract is already deployed and/or up-to-date.Tagging this as
ready-for-review
because I want feedback, but leaving as draft because I don't want it merged yet. I think the biggest question I have hanging over this implementation is what the split between theColony
andColonyNetwork
should be for the implementation but open to feedback from any and all directions.