Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. // getSponsoringCount(): returns the number of points _sponsor is
  2. // providing service to
  3. //
  4. function getSponsoringCount(uint32 _sponsor)
  5. view
  6. external
  7. returns (uint256 count)
  8. {
  9. return sponsoring[_sponsor].length;
  10. }
  11.  
  12. // getSponsoring(): returns a list of points _sponsor is providing
  13. // service to
  14. //
  15. // Note: only useful for clients, as Solidity does not currently
  16. // support returning dynamic arrays.
  17. //
  18. function getSponsoring(uint32 _sponsor)
  19. view
  20. external
  21. returns (uint32[] sponsees)
  22. {
  23. return sponsoring[_sponsor];
  24. }
  25.  
  26. // sponsoring: per point, the points they are sponsoring
  27. //
  28. mapping(uint32 => uint32[]) public sponsoring;
  29.  
  30. // sponsoringIndexes: per point, per point, (index + 1) in
  31. // the sponsoring array
  32. //
  33. mapping(uint32 => mapping(uint32 => uint256)) public sponsoringIndexes;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement