Under Oregon law, bicycles are allowed to ride on sidewalks and crosswalks with the same rights and duties as pedestrians, provided they do so safely as defined under ORS 814.410(below). Remember that city ordinance may outlaw riding bicycles on the sidewalk, and some extra-wide sidewalks may actually be defined as multi-use trails which can exempt this. ORS 814.410(below) also requires you to give an audible signal before overtaking a pedestrian.
Riding on the sidewalk and hugging shoulders should be avoided regardless; it's actually more dangerous since the cyclist is put outside a driver's peripheral vision, and they are obscured by parked cars, trees, and street furniture. It's also the last place a driver checks when exiting the road or coming out from side streets (pay attention to where you look when you exit a parking lot, drivers don't expect a 20mph cyclist on the sidewalk.) And, worst of all, if you were to be hit by a driver where the sidewalk intersects a driveway, street, curb cut/ramp, or while on a crosswalk, if you were traveling at a speed greater than an "ordinary walk" you would be at fault as you'd be violating ORS 814.410(1D)(below.)
E-bikes are NOT allowed to ride on sidewalks under ORS 814.410(1E)(below), however, they are allowed to use multi-use and bicycle trails, including ones marked with "no motorized vehicle" signs, as they are considered bicycles rather than motorized vehicles under ORS 814.405.