Skip to content

Instantly share code, notes, and snippets.

@argctl
Created November 8, 2022 16:39
Show Gist options
  • Select an option

  • Save argctl/7b275486d6aa30dbef9809ef5c6e3fc9 to your computer and use it in GitHub Desktop.

Select an option

Save argctl/7b275486d6aa30dbef9809ef5c6e3fc9 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.4;
// version spect
contract c_e_coin {
//createContract with rules to sell by creating party - charge for time and movement
//generic version with my algorythm taking up first 10 spots on initial contract
//buyContract to buy from previous contract owner
struct DebtPosition {
uint id; // 0 is the pooling contract 1 is the oldest
address owner;
string func;
bool forSale;
uint currentValue;
uint initialValue;
uint minimumValue; // threshold that cashes out id and resells it in next iteration - debt simulator
mapping (uint => uint) releaseTimestamps; // timestamp to amount
uint baseCost; // cost to buy from house/institution or hosting party -- fee to the guy who has to talk to lawyers
uint saleFeePercent; // fee calculated to sell (and retain for house) on top of either current, initial, or minimum value
bool initSaleFee; // if true we use the initialValue as base for saleFeePercent
uint executionDeadline;
}
address private owner;
uint[] ids;
//mapping (address => uint) private ownerToContract;
//mapping (uint => uint) private contractAmount;
//mapping (uint => uint) private contractDeadline;
//mapping (uint => uint) private contractStartline;
//mapping (uint => string) private contractType;
//mapping (uint => uint[]) private contractInflections;
//mapping (uint => uint[]) private contractInflectionTimeStamps;
constructor (address[] memory orderedOwners, bool cutOff, uint pushBack) {
// orderedOwners order of contract
owner = msg.sender;
}
// workless contract - backed directly by previous history
//function createContract ()
// workful contract - backed by ability to withdraw against self in lieu of history
//function createContract ()
//function createContract () public returns (uint) {
// require(msg.sender == owner);
//uint id = ids.length;
//ids.push(id);
//return id;
//}
function buyContract (uint id) public returns (uint) {
//require();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment