Skip to content
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

Feature/gas subsidies #60

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mprishchepo
Copy link

This feature allows SFC to implement gas subsidies functionality on go-opera. 'Sponsor' account pays the gas fees when user interacts with a 'Nominee' contract address.

It contains methods for:

  • adding a 'Sponsor' address for a given 'Nominee' address with a specified gas amount
  • removing a 'Sponsor' address for a given 'Nominee' address
  • getter that returns first 'Sponsor' address with enough amount of gas from the list of sponsors for the specified 'Nominee' address

uint256 index;
}
//nominee -> sponsors list
mapping(address => address[]) public sponsors;
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any bound for the array?

Copy link
Author

Choose a reason for hiding this comment

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

The Sponsor array is unbounded. To save a gas and avoid reaching block's gas limit we only loop through the whole array inside view functions. All state changing operations use indexes to modify the array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants