Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 79 additions & 17 deletions OIP-XXXX.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
oip: <to be assigned>
title: <OIP title>
author: <a list of the author's or authors' name(s) and/or username(s), or name(s) and email(s), e.g. (use with the parentheses or triangular brackets): FirstName LastName (@GitHubUsername), FirstName LastName <foo@bar.com>, FirstName (@GitHubUsername) and GitHubUsername (@GitHubUsername)>
author: <a list of the author's or authors' name(s) and/or username(s), or
name(s) and email(s), e.g. (use with the parentheses or triangular
brackets): FirstName LastName (@GitHubUsername),
FirstName LastName <foo@bar.com>, FirstName (@GitHubUsername) and
GitHubUsername (@GitHubUsername)>
discussions-to: <URL>
status: Draft
type: <Standards Track | Informational | Meta>
Expand All @@ -11,41 +15,99 @@ requires (*optional): <OIP number(s)>
replaces (*optional): <OIP number(s)>
---

<!--You can leave these HTML comments in your merged OIP and delete the visible duplicate text guides, they will not appear and may be helpful to refer to if you edit it again. This is the suggested template for new OIPs. Note that an OIP number will be assigned by an editor. When opening a pull request to submit your OIP, please use an abbreviated title in the filename, `OIP-draft_title_abbrev.md`. The title should be 44 characters or less. Thanks to the Ethereum Improvement Proposal (EIP) process for the model we borrow here.-->
<!--You can leave these HTML comments in your merged OIP and delete the visible
duplicate text guides, they will not appear and may be helpful to refer to if
you edit it again. This is the suggested template for new OIPs. Note that an OIP
number will be assigned by an editor. When opening a pull request to submit your
OIP, please use an abbreviated title in the filename, `OIP-draft_title_abbrev.md`.
The title should be 44 characters or less. Thanks to the
Ethereum Improvement Proposal (EIP) process for the model we borrow here.-->
This is the suggested template for new OIPs.

Note that an OIP number will be assigned by an editor. When opening a pull request to submit your OIP, please use an abbreviated title in the filename, `OIP-draft_title_abbrev.md`.
Note that an OIP number will be assigned by an editor. When opening a pull
request to submit your OIP, please use an abbreviated title in the
filename, `OIP-draft_title_abbrev.md`.

The title should be 44 characters or less.

# OIP title

## Simple Summary
<!--"If you can't explain it simply, you don't understand it well enough." Provide a simplified and layman-accessible explanation of the OIP.-->
If you can't explain it simply, you don't understand it well enough." Provide a simplified and layman-accessible explanation of the OIP.

<!--"If you can't explain it simply, you don't understand it well enough."
Provide a simplified and layman-accessible explanation of the OIP.-->
If you can't explain it simply, you don't understand it well enough."
Provide a simplified and layman-accessible explanation of the OIP.

## Abstract

<!--A short (~200 word) description of the technical issue being addressed.-->
A short (~200 word) description of the technical issue being addressed.

## Motivation
<!--The motivation is critical for OIPs that want to change the OpenST protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the OIP solves. OIP submissions without sufficient motivation may be rejected outright.-->
The motivation is critical for OIPs that want to change the OpenST protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the OIP solves. OIP submissions without sufficient motivation may be rejected outright.

<!--The motivation is critical for OIPs that want to change the OpenST protocol.
It should clearly explain why the existing protocol specification is inadequate
to address the problem that the OIP solves. OIP submissions without sufficient
motivation may be rejected outright.-->
The motivation is critical for OIPs that want to change the OpenST protocol.
It should clearly explain why the existing protocol specification is inadequate
to address the problem that the OIP solves. OIP submissions without sufficient
motivation may be rejected outright.

## Specification
<!--The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations.-->
The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations.

<!--The technical specification should describe the syntax and semantics of any
new feature. The specification should be detailed enough to allow competing,
interoperable implementations.-->
The technical specification should describe the syntax and semantics of any
new feature. The specification should be detailed enough to allow competing,
interoperable implementations.

## Rationale
<!--The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->
The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->

<!--The rationale fleshes out the specification by describing what motivated
the design and why particular design decisions were made. It should describe
alternate designs that were considered and related work, e.g. how the feature
is supported in other languages. The rationale may also provide evidence of
consensus within the community, and should discuss important objections or
concerns raised during discussion.-->
The rationale fleshes out the specification by describing what motivated the
design and why particular design decisions were made. It should describe
alternate designs that were considered and related work, e.g. how the feature
is supported in other languages. The rationale may also provide evidence of
consensus within the community, and should discuss important objections or
concerns raised during discussion.-->

## Backwards Compatibility
<!--All OIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The OIP must explain how the author proposes to deal with these incompatibilities. OIP submissions without a sufficient backwards compatibility treatise may be rejected outright.-->
All OIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The OIP must explain how the author proposes to deal with these incompatibilities. OIP submissions without a sufficient backwards compatibility treatise may be rejected outright.

<!--All OIPs that introduce backwards incompatibilities must include a section
describing these incompatibilities and their severity. The OIP must explain how
the author proposes to deal with these incompatibilities. OIP submissions
without a sufficient backwards compatibility treatise may be rejected outright.-->
All OIPs that introduce backwards incompatibilities must include a section
describing these incompatibilities and their severity. The OIP must explain how
the author proposes to deal with these incompatibilities. OIP submissions
without a sufficient backwards compatibility treatise may be rejected outright.

## Test Cases
<!--Test cases for an implementation are mandatory for OIPs that are affecting consensus changes. Other OIPs can choose to include links to test cases if applicable.-->
Test cases for an implementation are mandatory for OIPs that are affecting consensus changes. Other OIPs can choose to include links to test cases if applicable.

<!--Test cases for an implementation are mandatory for OIPs that are affecting
consensus changes. Other OIPs can choose to include links to test cases
if applicable.-->
Test cases for an implementation are mandatory for OIPs that are affecting
consensus changes. Other OIPs can choose to include links to test cases
if applicable.

## Implementation
<!--The implementations must be completed before any OIP is given status "Final", but it need not be completed before the OIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details.-->
The implementations must be completed before any OIP is given status "Final", but it need not be completed before the OIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details.

<!--The implementations must be completed before any OIP is given status
"Final", but it need not be completed before the OIP is accepted. While there
is merit to the approach of reaching consensus on the specification and
rationale before writing code, the principle of "rough consensus and running
code" is still useful when it comes to resolving many discussions of API details.-->
The implementations must be completed before any OIP is given status "Final",
but it need not be completed before the OIP is accepted. While there is merit
to the approach of reaching consensus on the specification and rationale before
writing code, the principle of "rough consensus and running code" is still
useful when it comes to resolving many discussions of API details.
Binary file added OIPS/oip-draft-credit/class-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions OIPS/oip-draft-credit/class-diagram.wsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
@startuml class-diagram

class CreditBudgetHolder <<Contract>> {
..
+**executeRule (** \n\
""address"" _tokenHolder, \n\
""uint256"" _creditAmount, \n\
""address"" _to, \n\
""bytes"" _data, \n\
""uint256"" _nonce, \n\
""uint8"" _v, \n\
""bytes32"" _r, \n\
""bytes32"" _s
**)** \n\
**onlyWorker** \n\
""payable"" \n\
""returns"" (""bool"")
..
+**transfer (** \n\
""address"" _to, \n\
""uint256"" _value
**)** \n\
**onlyOwner** \n\
""returns"" (""bool"")
..
#**constructor (** \n\
""address"" _tokenRules, \n\
""address"" _token, \n\
""address"" _organization
**)**
..
}

class TokenHolder <<Contract>> {
..
+**executeRule (** \n\
""address"" _to, \n\
""bytes"" _data, \n\
""uint256"" _nonce, \n\
""uint8"" _v, \n\
""bytes32"" _r, \n\
""bytes32"" _s
**)** ""returns"" (""bool"")
..
}

class Credit <<Contract>> {
..
+**executeTransfers (** \n\
""address"" _from, \n\
""address[]"" _transfersTo, \n\
""uint256[]"" _transfersAmount
**)**
..
#**constructor (** \n\
""address"" _creditBudgetHolder, \n\
""address"" _tokenRules, \n\
""address"" _token
**)**
..
}

class UtilityBrandedToken <<Contract>> {
..
#**approve (** \n\
""address"" _spender, \n\
""uint256"" _value
**)** \n\
""returns"" (""bool"")
..
#**allowance (** \n\
""address"" _owner, \n\
""address"" _spender
**)** ""returns"" (""uint256"")
..
}

class CreditRule <<Rule Contract>>

class TokenRules <<Contract>> {
..
+**executeTransfers (** \n\
""address"" _from, \n\
""address[]"" _transfersTo, \n\
""uint256[]"" _transfersAmount
**)**
..
}

class Organized <<Contract>>

together {
class Organized
class CreditBudgetHolder
}

together {
class Credit
class CreditRule
}

Organized <|-- CreditBudgetHolder

CreditBudgetHolder o-- TokenRules
CreditBudgetHolder o-- UtilityBrandedToken
TokenHolder o-- TokenRules
CreditRule o-- TokenRules
CreditRule o-- Credit
Credit o-- CreditBudgetHolder
Credit o-- TokenRules
TokenRules o-- CreditRule
Credit o-- UtilityBrandedToken

CreditBudgetHolder - CreditRule
TokenHolder - CreditRule

@enduml
Loading